RFR: 8315220: Event NativeLibraryLoad breaks invariant by taking a stacktrace when thread is in state _thread_in_native

Matthias Baesken mbaesken at openjdk.org
Thu Sep 7 14:05:41 UTC 2023


On Fri, 1 Sep 2023 12:03:39 GMT, Markus Grönlund <mgronlun at openjdk.org> wrote:

> Greetings,
> 
> This change set fixes the issue of taking a JFR stack trace in the wrong thread state for the NativeLibraryLoad and NativeLibraryUnload events.
> 
> A follow-up change set, [JDK-8315364](https://bugs.openjdk.org/browse/JDK-8315364) will add assertions to the JFR stack trace code to help find similar issues earlier.
> 
> There are a few additional improvements:
> 
> The event declaration in metadata.xml now includes the generating thread since a stack trace without the generating thread is subpar.
> 
> In os_linux.cpp, the NativeLibraryLoad event was located after the call to dlopen(), which means that the event, declared durational, fails to capture the duration of the call.
> 
> Finally, the test is extended to validate the captured stack trace.
> 
> Testing: jdk_jfr, stress testing
> 
> Thanks
> Markus

LGTM (we tested it also for some days in our internal infrastructure)

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

Marked as reviewed by mbaesken (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/15535#pullrequestreview-1615524142


More information about the hotspot-jfr-dev mailing list