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

8328166: Epsilon: 'EpsilonHeap::allocate_work' misuses the parameter 'size' as size in bytes #2423

Closed

Conversation

shipilev
Copy link
Member

@shipilev shipilev commented Apr 22, 2024

Semi-clean backport to handle Epsilon corner case. The uncleanliness comes from copyright header updates, I accepted the version from incoming changeset. Will mark the backport clean.

Additional testing:

  • MacOS AArch64 server fastdebug, gc/epsilon

Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • JDK-8328166 needs maintainer approval

Issue

  • JDK-8328166: Epsilon: 'EpsilonHeap::allocate_work' misuses the parameter 'size' as size in bytes (Bug - P2 - Approved)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 2423

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

Using diff file

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

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Apr 22, 2024

👋 Welcome back shade! 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 Apr 22, 2024

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

8328166: Epsilon: 'EpsilonHeap::allocate_work' misuses the parameter 'size' as size in bytes

Reviewed-by: stuefe

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

  • b13cb2f: 8263940: NPE when creating default file system when default file system provider is packaged as JAR file on class path
  • 3324133: 8318854: [macos14] Running any AWT app prints Secure coding warning
  • 10b427d: 8329570: G1: Excessive is_obj_dead_cond calls in verification
  • f70558d: 8283349: Robustness improvements to java/util/prefs/AddNodeChangeListener.jar
  • 9912666: 8302069: javax/management/remote/mandatory/notif/NotifReconnectDeadlockTest.java update
  • aa9c12b: 8315609: Open source few more swing text/html tests
  • 2d27c94: 8315071: Modify TrayIconScalingTest.java, PrintLatinCJKTest.java to use new PassFailJFrame's builder pattern usage
  • c3438a5: 8305874: Open source AWT Key, Text Event related tests
  • 94caa64: 8187759: Background not refreshed when painting over a transparent JFrame
  • fbd0088: 8306634: Open source AWT Event related tests
  • ... and 9 more: https://git.openjdk.org/jdk17u-dev/compare/5b656c86e87bfb3e227ff48ab654ea957b9bc2e0...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 changed the title Backport 90ab52e598f74ed872fe404130d57f6596430727 8328166: Epsilon: 'EpsilonHeap::allocate_work' misuses the parameter 'size' as size in bytes Apr 22, 2024
@openjdk
Copy link

openjdk bot commented Apr 22, 2024

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

@openjdk openjdk bot added the backport label Apr 22, 2024
@shipilev
Copy link
Member Author

/clean

@openjdk openjdk bot added the clean label Apr 22, 2024
@openjdk
Copy link

openjdk bot commented Apr 22, 2024

@shipilev This backport pull request is now marked as clean

@shipilev shipilev marked this pull request as ready for review April 22, 2024 08:43
@shipilev
Copy link
Member Author

/approval request Fixes a corner case bug/inefficiency in Epsilon. Applies cleanly. Testing passes. Risk is low, the patch is simple and limited to Epsilon.

@openjdk
Copy link

openjdk bot commented Apr 22, 2024

⚠️ @shipilev 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.

@openjdk openjdk bot added the rfr Pull request is ready for review label Apr 22, 2024
@openjdk
Copy link

openjdk bot commented Apr 22, 2024

@shipilev
8328166: The approval request has been created successfully.

@openjdk openjdk bot added the approval label Apr 22, 2024
@mlbridge
Copy link

mlbridge bot commented Apr 22, 2024

Webrevs

Copy link
Member

@tstuefe tstuefe left a comment

Choose a reason for hiding this comment

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

Looks good.

So this could have resulted in a crash instead of OOM when nearing a full heap, right?

@shipilev
Copy link
Member Author

So this could have resulted in a crash instead of OOM when nearing a full heap, right?

No, I don't think so? Given that we currently use size in heapwords as size in bytes, we always get to resizing code with smaller value. So I think the "worst case" is that allocation code would loop through expansion multiple times before par_allocate would finally complete, or we figure there is not enough space.

@openjdk openjdk bot added ready Pull request is ready to be integrated and removed approval labels Apr 26, 2024
@shipilev
Copy link
Member Author

/integrate

@openjdk
Copy link

openjdk bot commented Apr 26, 2024

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

  • b13cb2f: 8263940: NPE when creating default file system when default file system provider is packaged as JAR file on class path
  • 3324133: 8318854: [macos14] Running any AWT app prints Secure coding warning
  • 10b427d: 8329570: G1: Excessive is_obj_dead_cond calls in verification
  • f70558d: 8283349: Robustness improvements to java/util/prefs/AddNodeChangeListener.jar
  • 9912666: 8302069: javax/management/remote/mandatory/notif/NotifReconnectDeadlockTest.java update
  • aa9c12b: 8315609: Open source few more swing text/html tests
  • 2d27c94: 8315071: Modify TrayIconScalingTest.java, PrintLatinCJKTest.java to use new PassFailJFrame's builder pattern usage
  • c3438a5: 8305874: Open source AWT Key, Text Event related tests
  • 94caa64: 8187759: Background not refreshed when painting over a transparent JFrame
  • fbd0088: 8306634: Open source AWT Event related tests
  • ... and 9 more: https://git.openjdk.org/jdk17u-dev/compare/5b656c86e87bfb3e227ff48ab654ea957b9bc2e0...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Apr 26, 2024

@shipilev Pushed as commit bcc83cd.

💡 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 clean integrated Pull request has been integrated
2 participants