Repository navigation
8358694: VM asserts if CodeCacheSegmentSize is not a power of 2 - #25708
offamitkumar wants to merge 10 commits into
Conversation
|
👋 Welcome back amitkumar! A progress list of the required criteria for merging this PR into |
|
@offamitkumar 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 6 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. ➡️ To integrate this PR with the above commit message to the |
|
@offamitkumar The following label will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command. |
Webrevs
|
dafedafe
left a comment
There was a problem hiding this comment.
Thanks for fixing this @offamitkumar!
I was wondering if we couldn't do this right at the start when we check the flag constraints, e.g. here:
shipilev
left a comment
There was a problem hiding this comment.
There is already CodeCacheSegmentSizeConstraintFunc that verifies the flag values. Move the check there?
shipilev
left a comment
There was a problem hiding this comment.
Looks okay to me. Compiler folk should take a look as well.
|
Running Tier1-3+ tests... |
|
I might be a bit picky (sorry for that) but since the flag was triggering a crash I was wondering if we could have a small regression test to make sure the VM never crashes (possibly checking the error as well). |
|
@dafedafe can you have a look again ? I have added the testcase. |
dafedafe
left a comment
There was a problem hiding this comment.
Thanks for adding the test @offamitkumar.
|
|
||
| public class CodeCacheSegmentSizeTest { | ||
| public static void main(String[] args) throws Exception { | ||
| String codeCacheSegmentSize = (Platform.isS390x() ? "67" : "36"); // invalid value (not power of two) |
There was a problem hiding this comment.
I think we can check it with any platform (it is not a S390-only constraint). Maybe we could also do it twice, once with and once without a power-of-two size. What do you think?
There was a problem hiding this comment.
Maybe we could also do it twice, once with and once without a power-of-two size. What do you think?
That was a great suggestion. updated;
dafedafe
left a comment
There was a problem hiding this comment.
Thanks for changing the test @offamitkumar.
|
|
||
| OutputAnalyzer output = new OutputAnalyzer(pb.start()); | ||
|
|
||
| output.shouldContain("openjdk version"); // typical first line |
There was a problem hiding this comment.
The test fails here for me (the output has the string "java version", not "openjdk version").
Maybe instead of checking this string we could check that there is no error?
There was a problem hiding this comment.
This was the string for me:
amit@a3560042:~/jdk$ ./build/linux-s390x-server-fastdebug/jdk/bin/java -XX:+UnlockExperimentalVMOptions -XX:CodeCacheSegmentSize=64 -version
openjdk version "26-internal" 2026-03-17
OpenJDK Runtime Environment (fastdebug build 26-internal-adhoc.amit.jdk)
OpenJDK 64-Bit Server VM (fastdebug build 26-internal-adhoc.amit.jdk, mixed mode)
amit@a3560042:~/jdk$
But I will update it and check for error only.
| @@ -0,0 +1,79 @@ | |||
| /* | |||
| * Copyright (c) 2024 IBM Corporation. All rights reserved. | |||
There was a problem hiding this comment.
| * Copyright (c) 2024 IBM Corporation. All rights reserved. | |
| * Copyright (c) 2025 IBM Corporation. All rights reserved. |
|
@dafedafe do you have further requests :) |
dafedafe
left a comment
There was a problem hiding this comment.
Looks good to me. Thanks again @offamitkumar!
|
@offamitkumar This pull request has not yet been marked as ready for integration. |
|
Oh, sorry, I mistook Damon as reviewer. My mistake. |
|
Thanks again for the reviews. /integrate |
|
Going to push as commit 263e32b.
Your commit was automatically rebased without conflicts. |
|
@offamitkumar Pushed as commit 263e32b. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Makes sure that JVM exits gracefully when
CodeCacheSegmentSizeis not a power of 2.Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/25708/head:pull/25708$ git checkout pull/25708Update a local copy of the PR:
$ git checkout pull/25708$ git pull https://git.openjdk.org/jdk.git pull/25708/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 25708View PR using the GUI difftool:
$ git pr show -t 25708Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/25708.diff
Using Webrev
Link to Webrev Comment