Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
wants to merge 3 commits into from

Conversation

mgronlun
Copy link

@mgronlun mgronlun commented Sep 1, 2023

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 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


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8315220: Event NativeLibraryLoad breaks invariant by taking a stacktrace when thread is in state _thread_in_native (Bug - P3)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/15535/head:pull/15535
$ git checkout pull/15535

Update a local copy of the PR:
$ git checkout pull/15535
$ git pull https://git.openjdk.org/jdk.git pull/15535/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 15535

View PR using the GUI difftool:
$ git pr show -t 15535

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/15535.diff

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Sep 1, 2023

👋 Welcome back mgronlun! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot added the rfr Pull request is ready for review label Sep 1, 2023
@openjdk
Copy link

openjdk bot commented Sep 1, 2023

@mgronlun The following label will be automatically applied to this pull request:

  • hotspot

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the hotspot hotspot-dev@openjdk.org label Sep 1, 2023
@mgronlun
Copy link
Author

mgronlun commented Sep 1, 2023

/label add hotspot-jfr

@mlbridge
Copy link

mlbridge bot commented Sep 1, 2023

Webrevs

@openjdk openjdk bot added the hotspot-jfr hotspot-jfr-dev@openjdk.org label Sep 1, 2023
@openjdk
Copy link

openjdk bot commented Sep 1, 2023

@mgronlun
The hotspot-jfr label was successfully added.

Copy link
Member

@MBaesken MBaesken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@openjdk
Copy link

openjdk bot commented Sep 7, 2023

@mgronlun This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

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

Reviewed-by: mbaesken, egahlin

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 71 new commits pushed to the master branch:

  • 2fd870a: 8315444: Convert test/jdk/tools to Classfile API
  • 81f8c57: 8314632: Intra-case dominance check fails in the presence of a guard
  • b408a82: 8314260: Unable to load system libraries on Windows when using a SecurityManager
  • 726c9c9: 8315735: VerifyError when switch statement used with synchronized block
  • fd6442c: 8315602: Open source swing security manager test
  • e22eb06: 8315651: Stop hiding AIX specific multicast socket errors via NetworkConfiguration (aix)
  • 9887cd8: 8315751: RandomTestBsi1999 fails often with timeouts on Linux ppc64le
  • 8107eab: 8314121: test tools/jpackage/share/RuntimePackageTest.java#id0 fails on RHEL8
  • ab28300: 8315698: Crash when comparing BasicType as int after JDK-8310577
  • b05198a: 8315600: Open source few more headless Swing misc tests
  • ... and 61 more: https://git.openjdk.org/jdk/compare/d5973bdb986a1dd823b6a761ff719de005c549f6...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Sep 7, 2023
@mgronlun
Copy link
Author

mgronlun commented Sep 7, 2023

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

Thank you, Matthias!

@mgronlun
Copy link
Author

mgronlun commented Sep 7, 2023

Thank you @egahlin and @MBaesken, for your reviews.

@mgronlun
Copy link
Author

mgronlun commented Sep 7, 2023

/integrate

@openjdk
Copy link

openjdk bot commented Sep 7, 2023

Going to push as commit 1cae0f5.
Since your change was applied there have been 73 commits pushed to the master branch:

  • 8f7e29b: 8313422: test/langtools/tools/javac 144 test classes uses com.sun.tools.classfile library
  • 8557205: 8312569: RISC-V: Missing intrinsics for Math.ceil, floor, rint
  • 2fd870a: 8315444: Convert test/jdk/tools to Classfile API
  • 81f8c57: 8314632: Intra-case dominance check fails in the presence of a guard
  • b408a82: 8314260: Unable to load system libraries on Windows when using a SecurityManager
  • 726c9c9: 8315735: VerifyError when switch statement used with synchronized block
  • fd6442c: 8315602: Open source swing security manager test
  • e22eb06: 8315651: Stop hiding AIX specific multicast socket errors via NetworkConfiguration (aix)
  • 9887cd8: 8315751: RandomTestBsi1999 fails often with timeouts on Linux ppc64le
  • 8107eab: 8314121: test tools/jpackage/share/RuntimePackageTest.java#id0 fails on RHEL8
  • ... and 63 more: https://git.openjdk.org/jdk/compare/d5973bdb986a1dd823b6a761ff719de005c549f6...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Sep 7, 2023
@openjdk openjdk bot closed this Sep 7, 2023
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Sep 7, 2023
@openjdk
Copy link

openjdk bot commented Sep 7, 2023

@mgronlun Pushed as commit 1cae0f5.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot hotspot-dev@openjdk.org hotspot-jfr hotspot-jfr-dev@openjdk.org integrated Pull request has been integrated
3 participants