Skip to content

8283469: Don't use memset to initialize members in FileMapInfo and fix memory leak #1084

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

Closed
wants to merge 1 commit into from
Closed

Conversation

zhengyu123
Copy link
Contributor

@zhengyu123 zhengyu123 commented May 13, 2022

I would like to backport this patch to 11u, to fix a memory leak, also eliminates dangerous memset call, could potentially result in fatal crash.

The original patch does not apply cleanly:

  1. File moved
  2. A lot of context differences

Applied/updated patch manually.

I also bought down following code from JDK-8261455, given it is a P4 enhancement, I don't see it is a candidate for backport itself. But following code obviously fixes a bug that leaves file open after use.

  if (_file_open) {
    os::close(_fd);
  }

Test:

  • hotspot_cds on Linux x86_64
  • hotspot_appcds on Linux x86_64
  • GHA

Progress

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

Issue

  • JDK-8283469: Don't use memset to initialize members in FileMapInfo and fix memory leak

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 1084

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented May 13, 2022

👋 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 d6fa8b004bcd0a2fc1015055d0177428889b4c31 8283469: Don't use memset to initialize members in FileMapInfo and fix memory leak May 13, 2022
@openjdk
Copy link

openjdk bot commented May 13, 2022

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 May 13, 2022
@mlbridge
Copy link

mlbridge bot commented May 13, 2022

Webrevs

Copy link
Contributor

@TheRealMDoerr TheRealMDoerr left a comment

Choose a reason for hiding this comment

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

LGTM.

@openjdk
Copy link

openjdk bot commented May 17, 2022

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

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

8283469: Don't use memset to initialize members in FileMapInfo and fix memory leak

Reviewed-by: mdoerr

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

  • 0056b9b: 8227389: Remove unsupported xlc16 compile options on aix
  • c9d3291: 8282008: Incorrect handling of quoted arguments in ProcessBuilder
  • 316c514: 8285726: [11u, 17u] Unify fix for JDK-8284548 with version from head
  • 8b0e5ec: 8285727: [11u, 17u] Unify fix for JDK-8284920 with version from head
  • 2013819: 8268773: Improvements related to: Failed to start thread - pthread_create failed (EAGAIN)
  • 9cb3797: 8283323: libharfbuzz optimization level results in extreme build times

Please see this link for an up-to-date comparison between the source branch of this pull request and the master branch.
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 May 17, 2022
@zhengyu123
Copy link
Contributor Author

Thanks, @TheRealMDoerr

@zhengyu123
Copy link
Contributor Author

/integrate

@openjdk
Copy link

openjdk bot commented May 18, 2022

Going to push as commit 00ee3ff.
Since your change was applied there have been 13 commits pushed to the master branch:

  • 364ed1d: 8234608: [TESTBUG] Fix G1 redefineClasses tests and a memory leak
  • 281aeb9: 8264179: [TESTBUG] Some compiler tests fail when running without C2
  • d05bd5f: 8163498: Many long-running security libs tests
  • 0629ea6: 8209920: runtime/logging/RedefineClasses.java fail with OOME with ZGC
  • fef9e84: 8209150: [TESTBUG] Add logging to verify JDK-8197901 to a different test
  • 8f85dcf: 8285686: Update FreeType to 2.12.0
  • 80c9f24: 8235220: ClhsdbScanOops.java fails with sun.jvm.hotspot.types.WrongTypeException
  • 0056b9b: 8227389: Remove unsupported xlc16 compile options on aix
  • c9d3291: 8282008: Incorrect handling of quoted arguments in ProcessBuilder
  • 316c514: 8285726: [11u, 17u] Unify fix for JDK-8284548 with version from head
  • ... and 3 more: https://git.openjdk.java.net/jdk11u-dev/compare/844f03b522b5c40e5ffdd79da16890b45c3aba99...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented May 18, 2022

@zhengyu123 Pushed as commit 00ee3ff.

💡 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
backport integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

2 participants