RFR: 8364314: java_lang_Thread::get_thread_status fails assert(base != nullptr) failed: Invalid base [v2]

Alan Bateman alanb at openjdk.org
Mon Aug 4 14:05:56 UTC 2025


On Thu, 31 Jul 2025 12:07:42 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>>> If the JvmtiVTMSTransitionDisabler only works when there's an agent attached, I don't think we're protecting the carrier thread at all since it can become unmounted at anytime when there's no agent.
>> 
>> Right. The issue was discovered several weeks ago: https://bugs.openjdk.org/browse/JDK-8361913 Work in progress
>
>> If the JvmtiVTMSTransitionDisabler only works when there's an agent attached,
> I don't think we're protecting the carrier thread at all since it can become unmounted
> at anytime when there's no agent.
> 
> I've pushed some initial changes to the loom repo to deal with the transitions. This drops the use of JvmtiVTMSTransitionDisabler as this requires a JVMTI environment. We have a new stress too that bashes on dumpThreads while many virtual threads are parking and unparking. Need to go over this with @alexmenkov and @sspitsyn before proposing anything for main line.

> As noted above this particular code is problematic for a range of reasons, but for now this fix maintains the pretense that the transition disabler actually works, and @AlanBateman will be fixing that as noted above.

Yes, get_thread_snapshot has a bug tail. Longer term we need to put in infrastructure to interact with a specific virtual thread or all virtual threads. We need this for a second phase of thread dump anyway.  Short term we can use the same approach as Thread::getStackTrace by suspending the virtual thread when unmounted, have the handshake op check that the virtual thread and continuation is mounted, and retry if attempting a snapshot during a transition. I've put a possible change in this [draft PR](https://github.com/openjdk/jdk/pull/26612) - I need to discuss with Serguei and Alex on how they want to handle this.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/26544#issuecomment-3150854651


More information about the hotspot-runtime-dev mailing list