JDK-8231162 : JVMTI RawMonitorWait triggers assertion failure: Only JavaThreads can be interruptible
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 14
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2019-09-18
  • Updated: 2019-09-26
  • Resolved: 2019-09-18
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 14
14 b15Fixed
Related Reports
Relates :  
Description
# To suppress the following error report, specify this argument
# after -XX: or in .hotspotrc:  SuppressErrorAt=/jvmtiRawMonitor.cpp:377
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (open/src/hotspot/share/prims/jvmtiRawMonitor.cpp:377), pid=31520, tid=31753
#  assert(__the_thread__->is_Java_thread()) failed: Only JavaThreads can be interruptible
#
# JRE version: Java(TM) SE Runtime Environment (14.0+15) (fastdebug build 14-ea+15-611)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 14-ea+15-611, compiled mode, sharing, compressed oops, g1 gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0x1129f54]  JvmtiRawMonitor::raw_wait(long, bool, Thread*)+0x334

This is triggered by the changes in JDK-8230424, but we need to see how an interruptible wait arises here.
Comments
URL: https://hg.openjdk.java.net/jdk/jdk/rev/ee37c9b2eb61 User: dholmes Date: 2019-09-18 21:31:58 +0000
18-09-2019

Seeing this with G1 in current jdk/jdk, like this: $ CONF=linux-x86_64-server-fastdebug make images run-test TEST=vmTestbase/nsk/jvmti/IterateOverHeap/ # # Internal Error (/home/shade/trunks/jdk-jdk/src/hotspot/share/prims/jvmtiRawMonitor.cpp:377), pid=28351, tid=28361 # assert(__the_thread__->is_Java_thread()) failed: Only JavaThreads can be interruptible # # JRE version: OpenJDK Runtime Environment (14.0) (fastdebug build 14-internal+0-adhoc.shade.jdk-jdk) # Java VM: OpenJDK 64-Bit Server VM (fastdebug 14-internal+0-adhoc.shade.jdk-jdk, mixed mode, sharing, tiered, compressed oops, g1 gc, linux-amd64) # Problematic frame: # V [libjvm.so+0x1149b6e] JvmtiRawMonitor::raw_wait(long, bool, Thread*)+0x4ce --------------- S U M M A R Y ------------ Command Line: -XX:MaxRAMPercentage=3 -Djava.library.path=/home/shade/trunks/jdk-jdk/build/linux-x86_64-server-fastdebug/images/test/hotspot/jtreg/native -agentlib:iterheap005=-waittime=5 -verbose nsk.jvmti.IterateOverHeap.iterheap005 Host: shade-desktop, Intel(R) Core(TM) i7-7820X CPU @ 3.60GHz, 16 cores, 125G, Ubuntu 18.04.3 LTS Time: Wed Sep 18 18:55:41 2019 CEST elapsed time: 0 seconds (0d 0h 0m 0s) --------------- T H R E A D --------------- Current thread (0x00007f3fd89d8800): VMThread "VM Thread" [stack: 0x00007f3fb4015000,0x00007f3fb4115000] [id=28361] Stack: [0x00007f3fb4015000,0x00007f3fb4115000], sp=0x00007f3fb4113720, free space=1017k Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code) V [libjvm.so+0x1149b6e] JvmtiRawMonitor::raw_wait(long, bool, Thread*)+0x4ce V [libjvm.so+0x1115963] JvmtiEnv::RawMonitorWait(JvmtiRawMonitor*, long)+0x183 C [libiterheap005.so+0xbd51] heapObjectCallback+0x1d1 V [libjvm.so+0x115b077] IterateOverHeapObjectClosure::do_object(oop)+0xc7 V [libjvm.so+0xd67b28] G1ContiguousSpace::object_iterate(ObjectClosure*)+0x38 V [libjvm.so+0xc1a70f] IterateObjectClosureRegionClosure::do_heap_region(HeapRegion*)+0x2f V [libjvm.so+0xd7b0d3] HeapRegionManager::iterate(HeapRegionClosure*) const+0x143 V [libjvm.so+0xc08a6b] G1CollectedHeap::object_iterate(ObjectClosure*)+0x2b V [libjvm.so+0x115f3d7] VM_HeapIterateOperation::doit()+0x57 V [libjvm.so+0x190b2a1] VM_Operation::evaluate()+0x1f1 V [libjvm.so+0x193bb40] VMThread::evaluate_operation(VM_Operation*) [clone .constprop.64]+0x180 V [libjvm.so+0x193c5b3] VMThread::loop()+0x733 V [libjvm.so+0x193cbfa] VMThread::run()+0xca V [libjvm.so+0x1847a16] Thread::call_run()+0xf6 V [libjvm.so+0x14488be] thread_native_entry(Thread*)+0x10e
18-09-2019

jvmtiError JvmtiEnv::RawMonitorWait(JvmtiRawMonitor * rmonitor, jlong millis) { ... if (thread->is_Java_thread()) { JavaThread* current_thread = (JavaThread*)thread; ... r = rmonitor->raw_wait(millis, true, current_thread); } else { if (thread->is_Named_thread()) { r = rmonitor->raw_wait(millis, true, thread); <= ERROR HERE This passes interruptible==true for non-JavaThreads, which makes no sense as only JavaThreads have an interrupt mechanism.
18-09-2019