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

8269594: assert(_handle_mark_nesting > 1) failed: memory leak: allocating handle outside HandleMark #90

Closed
wants to merge 1 commit into from

Conversation

zhengyu123
Copy link
Contributor

@zhengyu123 zhengyu123 commented Jul 1, 2021

I would like to backport this patch to openjdk11u for parity with Oracle 11.0.13.

This is a low risk patch that fixes potential memory leak. The jdk17 patch applies cleanly.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8269594: assert(_handle_mark_nesting > 1) failed: memory leak: allocating handle outside HandleMark

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk11u-dev pull/90/head:pull/90
$ git checkout pull/90

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 90

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk11u-dev/pull/90.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Jul 1, 2021

👋 Welcome back zgu! 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 changed the title Backport 4b4bef4e1e06c8efbfeb2c28e0658ce91ee9ad66 8269594: assert(_handle_mark_nesting > 1) failed: memory leak: allocating handle outside HandleMark Jul 1, 2021
@openjdk
Copy link

openjdk bot commented Jul 1, 2021

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

@openjdk
Copy link

openjdk bot commented Jul 1, 2021

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

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

8269594: assert(_handle_mark_nesting > 1) failed: memory leak: allocating handle outside HandleMark

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 no new commits pushed to the master branch. If another commit should be pushed before you perform the /integrate command, your PR will be automatically rebased. If you prefer to avoid any potential 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 ready Pull request is ready to be integrated rfr Pull request is ready for review labels Jul 1, 2021
@mlbridge
Copy link

mlbridge bot commented Jul 1, 2021

Webrevs

@zhengyu123
Copy link
Contributor Author

/integrate

@openjdk
Copy link

openjdk bot commented Jul 2, 2021

Going to push as commit 73e987c.

@openjdk openjdk bot closed this Jul 2, 2021
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Jul 2, 2021
@openjdk
Copy link

openjdk bot commented Jul 2, 2021

@zhengyu123 Pushed as commit 73e987c.

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

@RealCLanger
Copy link
Contributor

This backport breaks the build on all platforms:

.../jdk11u-dev/src/hotspot/share/runtime/safepoint.cpp:1195:19: error: 'self' was not declared in this scope
HandleMark hm(self);
^~~~

Did you do any testing?

@RealCLanger
Copy link
Contributor

I think this would be the fix:

diff --git a/src/hotspot/share/runtime/safepoint.cpp b/src/hotspot/share/runtime/safepoint.cpp
index 51e1c9e5bcf..4133a7aa6ac 100644
--- a/src/hotspot/share/runtime/safepoint.cpp
+++ b/src/hotspot/share/runtime/safepoint.cpp
@@ -1192,7 +1192,7 @@ void ThreadSafepointState::handle_polling_page_exception() {
   if( nm->is_at_poll_return(real_return_addr) ) {
     // See if return type is an oop.
     bool return_oop = nm->method()->is_returning_oop();
-    HandleMark hm(self);
+    HandleMark hm(thread());
     Handle return_value;
     if (return_oop) {
       // The oop result has been saved on the stack together with all

@zhengyu123
Copy link
Contributor Author

@RealCLanger I thought I did a build. Obviously, I did not. Sorry.
Filed JDK-8269847

@RealCLanger
Copy link
Contributor

@RealCLanger I thought I did a build. Obviously, I did not. Sorry.
Filed JDK-8269847

Thanks. We need Github Actions to catch those. But seems @shipilev is working on it: #37 😄

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

Successfully merging this pull request may close these issues.

2 participants