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

JDWP exit error AGENT_ERROR_INVALID_THREAD(203): missing entry in running thread table

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 21
    • 21
    • core-svc
    • None
    • b18

      I modified the new com/sun/jdi/ThreadMemoryLeakTest.java to support virtual threads. When I did that the test passed, but I noticed the following in the test output:

      Goodbye from ThreadMemoryLeakTarg after 247744 iterations!
      JDWP exit error AGENT_ERROR_INVALID_THREAD(203): missing entry in running thread table [/scratch/cplummer/ws/jdk/jdk.clean/open/src/jdk.jdwp.agent/share/native/libjdwp/threadControl.c:1115]
      FATAL ERROR in native method: JDWP missing entry in running thread table, jvmtiError=AGENT_ERROR_INVALID_THREAD(203)
      Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
      V [libjvm.so+0x118c75b] jni_FatalError+0xeb (jni.cpp:630)
      C [libjdwp.so+0x10833] jniFatalError.constprop.0+0xc3 (debugInit.c:608)
      C [libjdwp.so+0x10a6f] debugInit_exit+0x6f (debugInit.c:1338)
      C [libjdwp.so+0x24fca] threadControl_resumeAll+0x2aa (threadControl.c:1115)
      C [libjdwp.so+0xdb04] resume+0x24 (VirtualMachineImpl.c:656)
      C [libjdwp.so+0x137a9] debugLoop_run+0x2a9 (debugLoop.c:162)
      C [libjdwp.so+0x283f4] attachThread+0x54 (transport.c:392)
      V [libjvm.so+0x13bfb8a] JvmtiAgentThread::call_start_function()+0x17a (jvmtiImpl.cpp:89)
      V [libjvm.so+0x109f236] JavaThread::thread_main_inner()+0x206 (javaThread.cpp:710)
      V [libjvm.so+0x1aab090] Thread::call_run()+0x100 (thread.cpp:224)
      V [libjvm.so+0x1748373] thread_native_entry(Thread*)+0x103 (os_linux.cpp:740)

      The debuggee ran properly and exited, but then the debug agent asserted during the exit. The bug in the debug agent is a missing check to see if the thread is on runningVThreads. It only checked runningThreads. That fix is simple. However, there is the further problem of why this didn't result in a test failure. The reason is because there is no check for a proper exitCode. TestScaffold. waitForVMDisconnect() should wait for process exit and then verify the exitCode.

            cjplummer Chris Plummer
            cjplummer Chris Plummer
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: