JDK-8304354 : nsk/jdi/Event/equals/equals001 fails: assert(!state->is_interp_only_mode()) failed: sanity check
  • Type: Bug
  • Component: hotspot
  • Sub-Component: jvmti
  • Affected Version: 21
  • Priority: P3
  • Status: Open
  • Resolution: Unresolved
  • OS: linux
  • CPU: x86_64
  • Submitted: 2023-03-16
  • Updated: 2024-06-05
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 24
24Unresolved
Related Reports
Relates :  
Description
The following test failed in the JDK21 CI:

vmTestbase/nsk/jdi/Event/equals/equals001/TestDescription.java

Here's a snippet from the log file:

----------System.out:(58/5646)*----------
binder> VirtualMachineManager: version 21.0
binder> Finding connector: default
binder> LaunchingConnector:
binder>     name: com.sun.jdi.CommandLineLaunch
binder>     description: Launches target using Sun Java VM command line and attaches to it
binder>     transport: com.sun.tools.jdi.SunCommandLineLauncher$2@2b679a81
binder> Connector arguments:
binder>     main=nsk.share.MainWrapper Virtual nsk.jdi.Event.equals.equals001a \u0000-verbose\u0000 \u0000-arch=linux-x64\u0000 \u0000-waittime=5\u0000 \u0000-debugee.vmkind=java\u0000 \u0000-transport.address=dynamic\u0000 \u0000-debugee.vmkeys="-XX:MaxRAMPercentage=4.16667 -Dtest.boot.jdk=/opt/mach5/mesos/work_dir/jib-master/install/jdk/19/36/bundles/linux-x64/jdk-19_linux-x64_bin.tar.gz/jdk-19 -Djava.io.tmpdir=/opt/mach5/mesos/work_dir/slaves/91e16c40-06d4-468a-9fc3-7198a5bb7d5a-S113439/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/4eb8263f-942c-4aad-83fa-be83c25ca194/runs/ae5c96c1-b006-487a-91a3-49c56d8ea06b/testoutput/test-support/jtreg_open_test_hotspot_jtreg_vmTestbase_nsk_jdi/tmp -Dmain.wrapper=Virtual -XX:-VerifyContinuations"\u0000 \u0000-pipe.port=49169\u0000
binder>     includevirtualthreads=y
binder>     quote=\u0000
binder>     home=/opt/mach5/mesos/work_dir/jib-master/install/jdk-21+14-1159/linux-x64-debug.jdk/jdk-21/fastdebug
binder>     vmexec=java
binder>     suspend=true
binder>     options=-XX:MaxRAMPercentage=4.16667 -Dtest.boot.jdk=/opt/mach5/mesos/work_dir/jib-master/install/jdk/19/36/bundles/linux-x64/jdk-19_linux-x64_bin.tar.gz/jdk-19 -Djava.io.tmpdir=/opt/mach5/mesos/work_dir/slaves/91e16c40-06d4-468a-9fc3-7198a5bb7d5a-S113439/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/4eb8263f-942c-4aad-83fa-be83c25ca194/runs/ae5c96c1-b006-487a-91a3-49c56d8ea06b/testoutput/test-support/jtreg_open_test_hotspot_jtreg_vmTestbase_nsk_jdi/tmp -Dmain.wrapper=Virtual -XX:-VerifyContinuations --enable-preview -Djdk.virtualThreadScheduler.parallelism=15
binder> Launching debugee
binder> Waiting for VM initialized
Initial VMStartEvent received: VMStartEvent in thread main
binder> Received expected signal from debugee: ready
debugger > setting up StepRequest
debugger > setting up AccessWatchpointRequest
debugger > setting up ModificationWatchpointRequest
debugger > setting up ClassPrepareRequest
debugger > setting up ClassUnloadRequest
debugger > setting up MethodEntryRequest
debugger > setting up MethodExitRequest
debugger > setting up ThreadDeathRequest
debugger > setting up ThreadStartRequest
debugger > setting up ExceptionRequest
debugger > setting up BreakpointRequest
debugger > Checking equals() method for Event object : MethodExitEvent@sun.nio.ch.EPoll.wait(int, long, int, int)+-1 in thread Read-Poller
debugger > Checking equals() method for Event object : MethodEntryEvent@sun.nio.ch.EPoll:90 in thread Read-Poller
debugger > Checking equals() method for Event object : ClassPrepareEvent in thread main
debugee.stderr> debuggee > debugger's <go> signal received.
debugger > Checking equals() method for Event object : StepEvent@nsk.jdi.Event.equals.equals001aThread:125 in thread thread1
debugger > Checking equals() method for Event object : BreakpointEvent@nsk.jdi.Event.equals.equals001aThread:145 in thread thread1
debugger > Checking equals() method for Event object : ModificationWatchpoint@nsk.jdi.Event.equals.equals001aThread:145 in thread thread1
debugee.stdout> #
debugee.stdout> # A fatal error has been detected by the Java Runtime Environment:
debugee.stdout> #
debugee.stdout> #  Internal Error (/opt/mach5/mesos/work_dir/slaves/741e9afd-8c02-45c3-b2e2-9db1450d0832-S5022/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/fe148568-9f76-4a53-a1d8-cb00435adbc6/runs/657ec1cf-c2db-48c6-b7af-9a4d244003d4/workspace/open/src/hotspot/share/prims/jvmtiEventController.cpp:387), pid=937896, tid=937927
debugee.stdout> #  assert(!state->is_interp_only_mode()) failed: sanity check
debugee.stdout> #
debugee.stdout> # JRE version: Java(TM) SE Runtime Environment (21.0+14) (fastdebug build 21-ea+14-LTS-1159)
debugee.stdout> # Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 21-ea+14-LTS-1159, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
debugee.stdout> # Problematic frame:
debugee.stdout> # V  [libjvm.so+0x1384c39]  JvmtiEventControllerPrivate::leave_interp_only_mode(JvmtiThreadState*)+0x2f9
debugee.stdout> #
debugee.stdout> # Core dump will be written. Default location: Core dumps may be processed with "/opt/core.sh %p" (or dumping to /opt/mach5/mesos/work_dir/slaves/91e16c40-06d4-468a-9fc3-7198a5bb7d5a-S113439/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/4eb8263f-942c-4aad-83fa-be83c25ca194/runs/ae5c96c1-b006-487a-91a3-49c56d8ea06b/testoutput/test-support/jtreg_open_test_hotspot_jtreg_vmTestbase_nsk_jdi/scratch/4/core.937896)
debugee.stdout> #
debugee.stdout> # An error report file with more information is saved as:
debugee.stdout> # /opt/mach5/mesos/work_dir/slaves/91e16c40-06d4-468a-9fc3-7198a5bb7d5a-S113439/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/4eb8263f-942c-4aad-83fa-be83c25ca194/runs/ae5c96c1-b006-487a-91a3-49c56d8ea06b/testoutput/test-support/jtreg_open_test_hotspot_jtreg_vmTestbase_nsk_jdi/scratch/4/hs_err_pid937896.log
debugee.stdout> [2.170s][warning][os] Loading hsdis library failed
debugee.stdout> #
debugee.stdout> # If you would like to submit a bug report, please visit:
debugee.stdout> #   https://bugreport.java.com/bugreport/crash.jsp
debugee.stdout> #
debugger > Checking equals() method for Event object : VMDisconnectEvent
debugger > Checking completed!
----------System.err:(12/715)----------
nsk.share.Failure: UNEXPECTED Debugee's exit status : 134
	at nsk.jdi.Event.equals.equals001.run(equals001.java:102)
	at nsk.jdi.Event.equals.equals001.main(equals001.java:72)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:578)
	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:125)
	at java.base/java.lang.Thread.run(Thread.java:1623)

JavaTest Message: Test threw exception: nsk.share.Failure: UNEXPECTED Debugee's exit status : 134
JavaTest Message: shutting down test

STATUS:Failed.`main' threw exception: nsk.share.Failure: UNEXPECTED Debugee's exit status : 134
----------rerun:(36/8511)*----------

Here's the stack trace for the crashing thread:

---------------  T H R E A D  ---------------

Current thread (0x00007fa994003940):  JavaThread "ForkJoinPool-1-worker-2" daemon [_thread_in_vm, id=937927, stack(0x00007fa9daba6000,0x00007fa9daca6000)] _threads_hazard_ptr=0x00007fa9941eaaa0, _nested_threads_hazard_ptr_cnt=0

Stack: [0x00007fa9daba6000,0x00007fa9daca6000],  sp=0x00007fa9daca38b0,  free space=1014k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x1384c39]  JvmtiEventControllerPrivate::leave_interp_only_mode(JvmtiThreadState*)+0x2f9  (jvmtiEventController.cpp:387)
V  [libjvm.so+0x1386afd]  JvmtiEventControllerPrivate::recompute_thread_enabled(JvmtiThreadState*) [clone .part.0]+0x13d  (jvmtiEventController.cpp:599)
V  [libjvm.so+0x1389a28]  JvmtiEventControllerPrivate::recompute_enabled()+0x188  (jvmtiEventController.cpp:558)
V  [libjvm.so+0x1390185]  JvmtiEventController::change_field_watch(jvmtiEvent, bool)+0xa5  (jvmtiEventController.cpp:971)
V  [libjvm.so+0x1368374]  JvmtiEnv::ClearFieldAccessWatch(fieldDescriptor*)+0xa4  (jvmtiEnv.cpp:2752)
V  [libjvm.so+0x1303bc8]  jvmti_ClearFieldAccessWatch+0x278  (jvmtiEnter.cpp:2738)
C  [libjdwp.so+0x15e08]  eventFilterRestricted_deinstall+0x378  (eventFilter.c:1198)
C  [libjdwp.so+0x163b0]  freeHandler.part.0+0x50  (eventHandler.c:1349)
C  [libjdwp.so+0x168df]  event_callback+0x17f  (eventHandler.c:1347)
C  [libjdwp.so+0x19865]  cbFieldAccess+0xe5  (eventHandler.c:980)
V  [libjvm.so+0x13a00af]  JvmtiExport::post_field_access(JavaThread*, Method*, unsigned char*, Klass*, Handle, _jfieldID*)+0x20f  (jvmtiExport.cpp:2204)
V  [libjvm.so+0x103700b]  InterpreterRuntime::post_field_access(JavaThread*, oopDesc*, ConstantPoolCacheEntry*)+0x30b  (interpreterRuntime.cpp:1171)
j  nsk.jdi.Event.equals.equals001aThread.foo()V+7
j  nsk.jdi.Event.equals.equals001aThread.run()V+39
j  java.lang.VirtualThread.runWith(Ljava/lang/Object;Ljava/lang/Runnable;)V+5 java.base@21-ea
j  java.lang.VirtualThread.run(Ljava/lang/Runnable;)V+72 java.base@21-ea
j  java.lang.VirtualThread$VThreadContinuation.lambda$new$0(Ljava/lang/VirtualThread;Ljava/lang/Runnable;)V+2 java.base@21-ea
j  java.lang.VirtualThread$VThreadContinuation$$Lambda+0x0000000801048528.run()V+8 java.base@21-ea
j  jdk.internal.vm.Continuation.enter0()V+4 java.base@21-ea
j  jdk.internal.vm.Continuation.enter(Ljdk/internal/vm/Continuation;Z)V+1 java.base@21-ea
J 97  jdk.internal.vm.Continuation.enterSpecial(Ljdk/internal/vm/Continuation;ZZ)V java.base@21-ea (0 bytes) @ 0x00007fa9f4733f44 [0x00007fa9f4733de0+0x0000000000000164]
j  jdk.internal.vm.Continuation.run()V+122 java.base@21-ea
j  java.lang.VirtualThread.runContinuation()V+81 java.base@21-ea
j  java.lang.VirtualThread$$Lambda+0x0000000801048750.run()V+4 java.base@21-ea
j  java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec()Z+4 java.base@21-ea
j  java.util.concurrent.ForkJoinTask.doExec()I+10 java.base@21-ea
j  java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(Ljava/util/concurrent/ForkJoinTask;Ljava/util/concurrent/ForkJoinPool$WorkQueue;)V+19 java.base@21-ea
j  java.util.concurrent.ForkJoinPool.scan(Ljava/util/concurrent/ForkJoinPool$WorkQueue;II)I+211 java.base@21-ea
j  java.util.concurrent.ForkJoinPool.runWorker(Ljava/util/concurrent/ForkJoinPool$WorkQueue;)V+35 java.base@21-ea
j  java.util.concurrent.ForkJoinWorkerThread.run()V+31 java.base@21-ea
v  ~StubRoutines::call_stub 0x00007fa9f4198d21
V  [libjvm.so+0x105a9b0]  JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, JavaThread*)+0x500  (javaCalls.cpp:415)
V  [libjvm.so+0x105b1e0]  JavaCalls::call_virtual(JavaValue*, Klass*, Symbol*, Symbol*, JavaCallArguments*, JavaThread*)+0x450  (javaCalls.cpp:329)
V  [libjvm.so+0x105b8b1]  JavaCalls::call_virtual(JavaValue*, Handle, Klass*, Symbol*, Symbol*, JavaThread*)+0x71  (javaCalls.cpp:191)
V  [libjvm.so+0x11dddbb]  thread_entry(JavaThread*, JavaThread*)+0x12b  (jvm.cpp:2924)
V  [libjvm.so+0x108e936]  JavaThread::thread_main_inner()+0x206  (javaThread.cpp:710)
V  [libjvm.so+0x1a94780]  Thread::call_run()+0x100  (thread.cpp:224)
V  [libjvm.so+0x1732213]  thread_native_entry(Thread*)+0x103  (os_linux.cpp:740)
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  nsk.jdi.Event.equals.equals001aThread.foo()V+7
j  nsk.jdi.Event.equals.equals001aThread.run()V+39
j  java.lang.VirtualThread.runWith(Ljava/lang/Object;Ljava/lang/Runnable;)V+5 java.base@21-ea
j  java.lang.VirtualThread.run(Ljava/lang/Runnable;)V+72 java.base@21-ea
j  java.lang.VirtualThread$VThreadContinuation.lambda$new$0(Ljava/lang/VirtualThread;Ljava/lang/Runnable;)V+2 java.base@21-ea
j  java.lang.VirtualThread$VThreadContinuation$$Lambda+0x0000000801048528.run()V+8 java.base@21-ea
j  jdk.internal.vm.Continuation.enter0()V+4 java.base@21-ea
j  jdk.internal.vm.Continuation.enter(Ljdk/internal/vm/Continuation;Z)V+1 java.base@21-ea
J 97  jdk.internal.vm.Continuation.enterSpecial(Ljdk/internal/vm/Continuation;ZZ)V java.base@21-ea (0 bytes) @ 0x00007fa9f4733f44 [0x00007fa9f4733de0+0x0000000000000164]
j  jdk.internal.vm.Continuation.run()V+122 java.base@21-ea
j  java.lang.VirtualThread.runContinuation()V+81 java.base@21-ea
j  java.lang.VirtualThread$$Lambda+0x0000000801048750.run()V+4 java.base@21-ea
j  java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec()Z+4 java.base@21-ea
j  java.util.concurrent.ForkJoinTask.doExec()I+10 java.base@21-ea
j  java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(Ljava/util/concurrent/ForkJoinTask;Ljava/util/concurrent/ForkJoinPool$WorkQueue;)V+19 java.base@21-ea
j  java.util.concurrent.ForkJoinPool.scan(Ljava/util/concurrent/ForkJoinPool$WorkQueue;II)I+211 java.base@21-ea
j  java.util.concurrent.ForkJoinPool.runWorker(Ljava/util/concurrent/ForkJoinPool$WorkQueue;)V+35 java.base@21-ea
j  java.util.concurrent.ForkJoinWorkerThread.run()V+31 java.base@21-ea
v  ~StubRoutines::call_stub 0x00007fa9f4198d21
Comments
ILW=MMH=P3
02-06-2023

[~dholmes] Will check it. Just linked the two for now. I think, I understand the root cause of this assert but not sure about JDK-8302351 yet.
21-03-2023

Connection to JDK-8302351?
17-03-2023