Skip to content
This repository was archived by the owner on Feb 2, 2023. It is now read-only.
/ jdk18u Public archive

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

Closed
wants to merge 1 commit into from

Conversation

zhengyu123
Copy link
Contributor

@zhengyu123 zhengyu123 commented Apr 11, 2022

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

The original patch does not apply cleanly, due to JDK-8261455, where it changed FileMapInfo's constructor signature to pass in full_path as a parameter. The conflict is resolved manually by initializing _full_path to nullptr

Test:

  • hotspot_cds

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/jdk18u pull/97/head:pull/97
$ git checkout pull/97

Update a local copy of the PR:
$ git checkout pull/97
$ git pull https://git.openjdk.java.net/jdk18u pull/97/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 97

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk18u/pull/97.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Apr 11, 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 Apr 11, 2022
@openjdk
Copy link

openjdk bot commented Apr 11, 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 Apr 11, 2022
@mlbridge
Copy link

mlbridge bot commented Apr 11, 2022

Webrevs

@zhengyu123
Copy link
Contributor Author

Friendly ping!

Copy link
Member

@phohensee phohensee left a comment

Choose a reason for hiding this comment

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

The check for _file_open seems to have been imported from another patch. Backport that patch first?

@zhengyu123
Copy link
Contributor Author

The check for _file_open seems to have been imported from another patch. Backport that patch first?

This comes from JDK-8261455, an enhancement CR. It is not a small patch and still has a subtask in progress, I don't think it is proper to backport it at this moment.

Should I drop the additional lines and leave the file open?

Thanks.

Copy link
Member

@phohensee phohensee left a comment

Choose a reason for hiding this comment

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

Leave the file close in, it's an obvious bug if it isn't. Lgtm.

@openjdk
Copy link

openjdk bot commented May 12, 2022

@zhengyu123 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:

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

Reviewed-by: phh

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

  • 15776b5: 8284848: C2: Compiler blackhole arguments should be treated as globally escaping
  • 431e502: 8283022: com/sun/crypto/provider/Cipher/AEAD/GCMBufferTest.java failing with -Xcomp after 8273297
  • 2c01f3a: Merge
  • 22a15d6: 8285445: cannot open file "NUL:"
  • 1579390: 8284920: Incorrect Token type causes XPath expression to return incorrect results
  • e47ee85: 8283350: (tz) Update Timezone Data to 2022a
  • 482a4a9: 8284548: Invalid XPath expression causes StringIndexOutOfBoundsException
  • 374d955: 8285454: Update the JBS version for respin of April CPU22_04
  • 5879966: 8285391: Update the release version for respin April CPU22_04 for release jdk18.0.1.1
  • 2725913: 8284023: java.sun.awt.X11GraphicsDevice.getDoubleBufferVisuals() leaks XdbeScreenVisualInfo
  • ... and 52 more: https://git.openjdk.java.net/jdk18u/compare/d417c3457996815fcff470d837d051f67e60ddf9...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 May 12, 2022
@zhengyu123
Copy link
Contributor Author

Leave the file close in, it's an obvious bug if it isn't. Lgtm.

Thanks, @phohensee

@zhengyu123
Copy link
Contributor Author

/integrate

@openjdk
Copy link

openjdk bot commented May 16, 2022

Going to push as commit 642208c.
Since your change was applied there have been 69 commits pushed to the master branch:

  • 2e9dda4: 8285921: serviceability/dcmd/jvmti/AttachFailed/AttachReturnError.java fails on Alpine
  • 3d54587: 8286283: assert(func2 == 0 && func3 == 0) failed: not unary
  • aac6bd5: 8286013: Incorrect test configurations for compiler/stable/TestStableShort.java
  • 9d0d8ea: 8285828: runtime/execstack/TestCheckJDK.java fails with zipped debug symbols
  • b5bf90d: 8284992: Fix misleading Vector API doc for LSHR operator
  • 0b9bee7: 8286198: [linux] Fix process-memory information
  • 3b7473c: 8282219: jdk/java/lang/ProcessBuilder/Basic.java fails on AIX
  • 15776b5: 8284848: C2: Compiler blackhole arguments should be treated as globally escaping
  • 431e502: 8283022: com/sun/crypto/provider/Cipher/AEAD/GCMBufferTest.java failing with -Xcomp after 8273297
  • 2c01f3a: Merge
  • ... and 59 more: https://git.openjdk.java.net/jdk18u/compare/d417c3457996815fcff470d837d051f67e60ddf9...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented May 16, 2022

@zhengyu123 Pushed as commit 642208c.

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

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

Successfully merging this pull request may close these issues.

2 participants