JDK-8303357 : [JVMCI] thread is _thread_in_vm when committing JFR compilation event
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 19,20,21
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2023-02-28
  • Updated: 2025-10-09
  • Resolved: 2023-03-01
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 21
21 b12Fixed
Related Reports
Relates :  
Description
JDK-8280844 added a native-to-VM thread transition when committing a JFR compilation event. This is not necessary for a JVMCI compiler as it is already _thread_in_vm at the commit point. This is shown by the following assertion failure:

#  Internal Error (/b/b/e/main/jdk_tlda/open/src/hotspot/share/runtime/interfaceSupport.inline.hpp:97), pid=4974, tid=5013
#  assert(thread->thread_state() == _thread_in_native) failed: coming from wrong thread state

Stack: [0x000014376aff6000,0x000014376b1f7000],  sp=0x000014376b1f54b0,  free space=2045k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0xb1f1a2]  CompilerEvent::CompilationEvent::post(EventCompilation&, int, CompilerType, Method*, int, bool, bool, int, int)+0x192  (interfaceSupport.inline.hpp:97)
V  [libjvm.so+0xaf1ab9]  post_compilation_event(EventCompilation&, CompileTask*)+0x79
V  [libjvm.so+0xafb4fd]  CompileBroker::invoke_compiler_on_method(CompileTask*)+0xc7d
V  [libjvm.so+0xafc0b8]  CompileBroker::compiler_thread_loop()+0x5d8
V  [libjvm.so+0x106a7c6]  JavaThread::thread_main_inner()+0x206
V  [libjvm.so+0x1a6f260]  Thread::call_run()+0x100
V  [libjvm.so+0x1702eb3]  thread_native_entry(Thread*)+0x103
Comments
A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/12787 Date: 2023-02-28 14:25:50 +0000
20-08-2024

Changeset: 2451c5a4 Author: Doug Simon <dnsimon@openjdk.org> Date: 2023-03-01 10:47:49 +0000 URL: https://git.openjdk.org/jdk/commit/2451c5a4620d5aec0ea9bc52fee5f3a54eb89d62
01-03-2023

ILW = Assert due to invalid thread transition, with JVMCI and JFR, no workaround = MMH = P3
28-02-2023