Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8274462

addthreadfilter004.java fails with "ERROR: property is not : ThreadDeathRequest1"

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Not an Issue
    • Affects Version/s: 18
    • Fix Version/s: None
    • Component/s: core-svc
    • Labels:

      Description

      In the loom repo we are seeing vmTestbase/nsk/jdi/ThreadDeathRequest/addThreadFilter/addthreadfilter004/TestDescription.java fail with "ERROR: property is not : ThreadDeathRequest1".

      This happens when the test is run with the vthread wrapper, although vthreads are only playing a minor role in the failure, which could happen with regular threads also. The test fails in this manner when the 2nd thread that the test starts up exits before the first thread. This seems to happen sometimes when the threads are vthreads. We haven't seen it with regular threads, but it can be forced with a short delay in the run() method that is only done for the first thread.

      The test has some inconsistencies in both its description and implementation:

       * (1) For ThreadDeathRequest2, both invocations are with different
       * ThreadReferences restricting one ThreadDeath event to two threads.
       * The test expects no ThreadDeath event will be received.
       * (2) For ThreadDeathRequest1, both invocations are with the same
       * ThreadReference restricting one ThreadDeath event to one thread.
       * The test expects this ThreadDeath event will be received.

      The “invocations” it is referring to are for addThreadFilter() calls. ThreadDeathRequest2 makes the call for both thread1 and thread2, so it should receive ThreadDeathEvents for both, but above it says it should receive none. The description of ThreadDeathRequest1 seems to be correct. The description of the test and the checks in the test expect ThreadDeathRequest2 not to receive any ThreadDeathEvents, but the setup of ThreadDeathRequest2 means that it will in fact receive 2.

      The test only checks the first ThreadDeathEvent that arrives. If it happens to be for thread2, it will always fail:

      debugee.stderr> **> debuggee: 'run': enter :: threadName == thread1
      debugee.stderr> **> debuggee: 'run': enter :: threadName == thread2
      debugee.stderr> **> debuggee: synchronized(lockingObj[0])
      debugee.stderr> **> debuggee: 'run': exit :: threadName == thread2
      EventHandler> Received event set with policy = SUSPEND_ALL
      EventHandler> Event: ThreadDeathEventImpl req thread death request (enabled)
      EventHandler> waitForRequestedEvent: Received event(ThreadDeathEvent in thread thread2) for request(thread death request (enabled))
      EventHandler> Removing listener nsk.share.jdi.EventHandler$6@7c556d64
      debugger> got new ThreadDeathEvent with property 'number' == ThreadDeathRequest2
      # ERROR: debugger> ERROR: property is not : ThreadDeathRequest1
      The following stacktrace is for failure analysis.
      nsk.share.TestFailure: debugger> ERROR: property is not : ThreadDeathRequest1
      at nsk.share.Log.logExceptionForFailureAnalysis(Log.java:432)
      at nsk.share.Log.complain(Log.java:403)
      at nsk.share.jdi.TestDebuggerType1.complain(TestDebuggerType1.java:78)
      at nsk.share.jdi.TestDebuggerType1.setFailedStatus(TestDebuggerType1.java:85)
      at nsk.jdi.ThreadDeathRequest.addThreadFilter.addthreadfilter004.testRun(addthreadfilter004.java:146)
      at nsk.share.jdi.TestDebuggerType1.runThis(TestDebuggerType1.java:119)
      at nsk.jdi.ThreadDeathRequest.addThreadFilter.addthreadfilter004.run(addthreadfilter004.java:82)
      at nsk.jdi.ThreadDeathRequest.addThreadFilter.addthreadfilter004.main(addthreadfilter004.java:77)
      at java.base/jdk.internal.reflect.NewAccessorImplFactory$1.invoke(NewAccessorImplFactory.java:83)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:93)
      at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.base/java.lang.reflect.Method.invoke(Method.java:568)
      at com.sun.javatest.regtest.agent.MainWrapper$MainTask.run(MainWrapper.java:136)
      at java.base/java.lang.VirtualThread.run(VirtualThread.java:312)
      at java.base/java.lang.VirtualThread$VThreadContinuation.lambda$new$0(VirtualThread.java:179)
      at java.base/jdk.internal.vm.Continuation.enter0(Continuation.java:374)
      at java.base/jdk.internal.vm.Continuation.enter(Continuation.java:367)

        Attachments

          Activity

            People

            Assignee:
            cjplummer Chris Plummer
            Reporter:
            cjplummer Chris Plummer
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: