RFR: 8369150: NMethodRelocationTest fails when JVMTI events not published before JVM exit [v2]
Leonid Mesnik
lmesnik at openjdk.org
Tue Dec 30 19:26:57 UTC 2025
On Thu, 18 Dec 2025 20:29:38 GMT, Chad Rakoczy <duke at openjdk.org> wrote:
>> [JDK-8369150](https://bugs.openjdk.org/browse/JDK-8369150)
>>
>> The test checks for JVMTI `COMPILED_METHOD_LOAD` and `COMPILED_METHOD_UNLOAD` events to be published for a relocated nmethod. It would originally intermittently fail if the JVM exited before it had time to publish the events so now it loops and forces GCs to encourage event publishing. The test fails if the events are received in the incorrect order (such as an unload before a load) or if the correct events are not received and the test times out.
>
> Chad Rakoczy has updated the pull request incrementally with two additional commits since the last revision:
>
> - Require load and unload events
> - Revert "Fix NMethodRelocationTest"
>
> This reverts commit dae91d8d12820c94c2c412f3e84935072e572595.
Changes requested by lmesnik (Reviewer).
test/hotspot/jtreg/serviceability/jvmti/NMethodRelocation/NMethodRelocationTest.java line 60:
> 58: "--enable-native-access=ALL-UNNAMED",
> 59: "-Xbootclasspath/a:.",
> 60: "-Xbatch",
I think that
"-XX:+UseSerialGC",
might be removed
The WB.fullGC() should works for any GC.
As I know, createTestJavaProcessBuilder() propagate all VM arguments to forked process. So not clear how it works now.
test/hotspot/jtreg/serviceability/jvmti/NMethodRelocation/NMethodRelocationTest.java line 188:
> 186: WHITE_BOX.deoptimizeAll();
> 187:
> 188: while (true) {
It would be better to have some variable that is set in 'callbackCompiledMethodUnload' to sync exit.
I think that it is more reliable then using stdout for this (even with flushing).
However, it might be fixed later, if we find any issues with current version.
-------------
PR Review: https://git.openjdk.org/jdk/pull/28683#pullrequestreview-3619074331
PR Review Comment: https://git.openjdk.org/jdk/pull/28683#discussion_r2653705691
PR Review Comment: https://git.openjdk.org/jdk/pull/28683#discussion_r2653690321
More information about the serviceability-dev
mailing list