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

8268364: jmethod clearing should be done during unloading #2935

Closed
wants to merge 2 commits into from

Conversation

krk
Copy link
Contributor

@krk krk commented Sep 18, 2024

Backport of 8268364, single hunk conflict resolved by accepting "empty" from the backport commit vs. clear_jmethod_ids invocation in the dtor. Backport commit moves the clear_jmethod_ids invocation to unload method instead.

It fixes crashes when accessing jmethodIDs of a class being unloaded.

Here is the reproducer that crashes JVM in ~1 second without the patch, but works fine with it: gist.

This fix also resolves the issue reported at async-profiler/async-profiler#974 for Java 11.

To run the repro:

javac Main.java
gcc -shared -I"$JAVA_HOME/include" -I"$JAVA_HOME/include/linux" -fPIC repro.cpp -orepro.so

java -agentpath:"$(pwd)/repro.so" -Xmx100m -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -XX:+ExplicitGCInvokesConcurrent Main

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
  • JDK-8268364 needs maintainer approval

Warning

 ⚠️ Found leading lowercase letter in issue title for 8268364: jmethod clearing should be done during unloading

Issue

  • JDK-8268364: jmethod clearing should be done during unloading (Bug - P4 - Approved)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk11u-dev.git pull/2935/head:pull/2935
$ git checkout pull/2935

Update a local copy of the PR:
$ git checkout pull/2935
$ git pull https://git.openjdk.org/jdk11u-dev.git pull/2935/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 2935

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk11u-dev/pull/2935.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Sep 18, 2024

👋 Welcome back krk! 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
Copy link

openjdk bot commented Sep 18, 2024

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

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

8268364: jmethod clearing should be done during unloading

Reviewed-by: coleenp

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 33 new commits pushed to the master branch:

  • 1c80800: 8340552: Harden TzdbZoneRulesCompiler against missing zone names
  • 874b25e: 8339637: (tz) Update Timezone Data to 2024b
  • 2155f8d: 8339803: Acknowledge case insensitive unambiguous keywords in tzdata files
  • c99638d: 8335801: [11u] Backport of 8210988 to 11u removes gcc warnings
  • 513a67a: 8303920: Avoid calling out to python in DataDescriptorSignatureMissing test
  • cf53387: 8342629: [11u] Properly message out that shenandoah is disabled
  • 249144c: 8225045: javax/swing/JInternalFrame/8146321/JInternalFrameIconTest.java fails on linux-x64
  • 04e6f37: 8247706: Unintentional use of new Date(year...) with absolute year
  • add9000: 8232367: Update Reactive Streams to 1.0.3 -- tests only
  • 827528c: 8339470: [17u] More defensive fix for 8163921
  • ... and 23 more: https://git.openjdk.org/jdk11u-dev/compare/2232d1f7b497d782edb6fa5f41ec9fd2a90ca33d...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.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@coleenp) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot changed the title Backport 3d84398d128bb2eed6280ebbc3f57afb3b89908f 8268364: jmethod clearing should be done during unloading Sep 18, 2024
@openjdk
Copy link

openjdk bot commented Sep 18, 2024

This backport pull request has now been updated with issue from the original commit.

@openjdk openjdk bot added backport rfr Pull request is ready for review labels Sep 18, 2024
@krk
Copy link
Contributor Author

krk commented Sep 18, 2024

  • MacOS builds are failing for unrelated reason: error: 'sprintf' is deprecated.
  • linux-x86 / test - Test (tier1) failing while uploading test artifacts:
Error: Failed to CreateArtifact: Failed to make request after 5 attempts: Request timeout: /twirp/github.actions.results.api.v1.ArtifactService/CreateArtifact

@mlbridge
Copy link

mlbridge bot commented Sep 18, 2024

Webrevs

@krk
Copy link
Contributor Author

krk commented Sep 19, 2024

cc @coleenp @fisk

Copy link
Contributor

@coleenp coleenp left a comment

Choose a reason for hiding this comment

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

This looks like a good backport.

@openjdk
Copy link

openjdk bot commented Sep 19, 2024

⚠️ @krk This change is now ready for you to apply for maintainer approval. This can be done directly in each associated issue or by using the /approval command.

@krk
Copy link
Contributor Author

krk commented Sep 20, 2024

/approval request The fix is required to allow JVM TI tools, especially profilers, run safely with class unloading enabled. Low risk: a small localized change that only affects liveness of jmethodIDs.

@openjdk
Copy link

openjdk bot commented Sep 20, 2024

@krk
8268364: The approval request has been created successfully.

@openjdk openjdk bot added the approval label Sep 20, 2024
@krk
Copy link
Contributor Author

krk commented Oct 2, 2024

/approval request All checks passing. The fix is required to allow JVM TI tools, especially profilers, to run safely with class unloading enabled. Low risk: a small localized change that only affects liveness of jmethodIDs.

@openjdk
Copy link

openjdk bot commented Oct 2, 2024

@krk
8268364: The approval request has been updated successfully.

@shipilev
Copy link
Member

@GoeLin, @jerboaa -- do you see any blockers for approving this?

@jerboaa
Copy link
Contributor

jerboaa commented Oct 29, 2024

@shipilev JDK 11u is done and only very select fixes will be allowed in going forward. For this one, I'll let @theRealAph handle approval. On the surface it seems OK, but it's another change to a done release which only seems to affect corner cases (profilers when classes get unloaded).

FWIW, SAP stopped work on JDK 11u (11.0.25 was the last one) so you can not expect answers from them for 11u.

@bridgekeeper
Copy link

bridgekeeper bot commented Nov 26, 2024

@krk This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@openjdk openjdk bot added ready Pull request is ready to be integrated and removed approval labels Nov 26, 2024
@jerboaa
Copy link
Contributor

jerboaa commented Dec 4, 2024

@krk @shipilev Andrew Haley has approved this PR. Do you plan to integrate it?

@krk
Copy link
Contributor Author

krk commented Dec 4, 2024

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Dec 4, 2024
@openjdk
Copy link

openjdk bot commented Dec 4, 2024

@krk
Your change (at version 032138d) is now ready to be sponsored by a Committer.

@shipilev
Copy link
Member

shipilev commented Dec 4, 2024

/sponsor

@openjdk
Copy link

openjdk bot commented Dec 4, 2024

Going to push as commit 50da3f6.
Since your change was applied there have been 33 commits pushed to the master branch:

  • 1c80800: 8340552: Harden TzdbZoneRulesCompiler against missing zone names
  • 874b25e: 8339637: (tz) Update Timezone Data to 2024b
  • 2155f8d: 8339803: Acknowledge case insensitive unambiguous keywords in tzdata files
  • c99638d: 8335801: [11u] Backport of 8210988 to 11u removes gcc warnings
  • 513a67a: 8303920: Avoid calling out to python in DataDescriptorSignatureMissing test
  • cf53387: 8342629: [11u] Properly message out that shenandoah is disabled
  • 249144c: 8225045: javax/swing/JInternalFrame/8146321/JInternalFrameIconTest.java fails on linux-x64
  • 04e6f37: 8247706: Unintentional use of new Date(year...) with absolute year
  • add9000: 8232367: Update Reactive Streams to 1.0.3 -- tests only
  • 827528c: 8339470: [17u] More defensive fix for 8163921
  • ... and 23 more: https://git.openjdk.org/jdk11u-dev/compare/2232d1f7b497d782edb6fa5f41ec9fd2a90ca33d...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Dec 4, 2024
@openjdk openjdk bot closed this Dec 4, 2024
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review sponsor Pull request is ready to be sponsored labels Dec 4, 2024
@openjdk
Copy link

openjdk bot commented Dec 4, 2024

@shipilev @krk Pushed as commit 50da3f6.

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

@gnu-andrew
Copy link
Member

@krk @shipilev Andrew Haley has approved this PR. Do you plan to integrate it?

This really should have waited until the rampdown changes were in place. I've manually moved this one to 11.0.27.

@krk
Copy link
Contributor Author

krk commented Dec 4, 2024

Sorry for the confusion, thanks for moving it.

@gnu-andrew
Copy link
Member

Sorry for the confusion, thanks for moving it.

Thanks. I'm a little late in doing the transition myself with being away at the beginning of the week, but the right version should be used automatically once https://bugs.openjdk.org/browse/JDK-8345509 is integrated. I just thought you should be aware that this will be in the April release. The cut-off for January was Friday.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

5 participants