RFR: 8369150: NMethodRelocationTest fails when JVMTI events not published before JVM exit [v4]

Leonid Mesnik lmesnik at openjdk.org
Thu Jan 1 20:04:10 UTC 2026


On Tue, 30 Dec 2025 23:20:34 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 one additional commit since the last revision:
> 
>   Add check for different addresses

Changes requested by lmesnik (Reviewer).

test/hotspot/jtreg/serviceability/jvmti/NMethodRelocation/libNMethodRelocationTest.cpp line 56:

> 54:     }
> 55: 
> 56:     printf("<COMPILED_METHOD_LOAD>:   name: %s, code: 0x%016" PRIxPTR "\n", name, (uintptr_t)code_addr);

I recommend  to use 
"jvmti_common.hpp"
Use 
`LOG()`
to print messages,
`fatal()`
to fail test.

Also, there are methods, like `get_method_name` that checks error code.

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

PR Review: https://git.openjdk.org/jdk/pull/28683#pullrequestreview-3622028999
PR Review Comment: https://git.openjdk.org/jdk/pull/28683#discussion_r2656580219


More information about the serviceability-dev mailing list