RFR: 8307865: Invalid is_in_any_VTMS_transition() check in post_dynamic_code_generated_while_holding_locks

Chris Plummer cjplummer at openjdk.org
Thu May 18 20:45:03 UTC 2023


On Thu, 11 May 2023 01:02:48 GMT, Leonid Mesnik <lmesnik at openjdk.org> wrote:

> Method post_dynamic_code_generated_while_holding_locks()
> register stubs and might be called during VTMT transitions.
> At least it is called in tmp VTMT transition, and stubs might be generated during standard VTMT transition.
> 
> The method doesn't post event but just register stub for later posting so it might be called during transition.
> 
> Also, the test has been updated to test virtual threads. It crashed before fix and start passing after fix.
> Additionally, checked this test with Xcomp, run tier1/tier5 and some stress testing

src/hotspot/share/prims/jvmtiExport.cpp line 2599:

> 2597: {
> 2598:   JavaThread* thread = JavaThread::current();
> 2599:   assert(!thread->is_in_any_VTMS_transition(), "dynamic code generated events are not allowed in any VTMS transition");

Removing this makes sense. Looks like it was copied from other similar APIs that will generate the event, but this API just queues it up to generate the event later.

test/hotspot/jtreg/serviceability/jvmti/DynamicCodeGenerated/DynamicCodeGeneratedTest.java line 55:

> 53:         Runnable task = () -> {
> 54:             String result = "string" + System.currentTimeMillis();
> 55:             LockSupport.parkNanos(1);

Why is this needed?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13921#discussion_r1198283943
PR Review Comment: https://git.openjdk.org/jdk/pull/13921#discussion_r1198279377


More information about the hotspot-dev mailing list