8316653: Large NMethodSizeLimit triggers assert during C1 code buffer allocation#16656
8316653: Large NMethodSizeLimit triggers assert during C1 code buffer allocation#16656dlunde wants to merge 4 commits intoopenjdk:masterfrom
Conversation
|
👋 Welcome back dlunde! A progress list of the required criteria for merging this PR into |
Webrevs
|
|
@dlunde 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: 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 27 new commits pushed to the
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 (@vnkozlov, @robcasloz, @TobiHartmann) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
Co-authored-by: Roberto Castañeda Lozano <robcasloz@users.noreply.github.com>
|
/integrate |
|
/sponsor |
|
Going to push as commit c36ec2c.
Your commit was automatically rebased without conflicts. |
|
@robcasloz @dlunde Pushed as commit c36ec2c. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
This changeset fixes an overflow issue for the develop flag
-XX:NMethodSizeLimit.In summary,
java -XX:NMethodSizeLimit=2147483647triggers an assert inCodeCache::allocate:Why?
code_buffer_sizecomputesNMethodSizeLimit + NMethodSizeLimit/10as a signed integer (may overflow).BufferBlob::createfunction takescode_buffer_size()as argument and uses it (among other things, such assizeof(BufferBlob)) to compute an unsigned size.BufferBlob::operator newtreats the unsigned size as signed (may overflow).Changes:
uintand leave the flag range forNMethodSizeLimituntouched (range(0, max_jint)). This ensures no overflow.Testing
Platforms: windows-x64, linux-x64, linux-aarch64, macosx-x64, macosx-aarch64.
tier1tier2andtier3Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/16656/head:pull/16656$ git checkout pull/16656Update a local copy of the PR:
$ git checkout pull/16656$ git pull https://git.openjdk.org/jdk.git pull/16656/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 16656View PR using the GUI difftool:
$ git pr show -t 16656Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/16656.diff
Webrev
Link to Webrev Comment