-
Notifications
You must be signed in to change notification settings - Fork 6.1k
8343984: Fix Unsafe address overflow #22027
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
Conversation
👋 Welcome back swen! A progress list of the required criteria for merging this PR into |
@wenshao 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 21 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 |
@wenshao The following labels 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 lists. If you would like to change these labels, use the /label pull request command. |
There are two other possible address overflow issues that are difficult to fix:
|
Webrevs
|
src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ByteVector.java
Show resolved
Hide resolved
src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/HeapHprofBinWriter.java
Show resolved
Hide resolved
It would be good to add some tests to ensure |
The generation of Java files works a bit differently from other places in the JDK (e.g. NIO). Now that the template has been changed, you also need to manually run the script |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. If there are no additional tests, please label the JBS issue appropriately (i.e noreg-*
)
I want to add such a test case, but I am worried that it will consume too many resources during the build process. /**
* @test
* @bug 8343984
* @summary Test that the append capacity is close to Integer.MaxValue
* @run main/othervm -Xms6g -Xmx6g HugeAppend
*/
public final class HugeAppend {
public static void main(String[] args) {
StringBuilder buf = new StringBuilder();
int loop4 = Integer.MAX_VALUE / 4;
for (int i = 0; i < loop4; i++) {
buf.append(true);
}
buf.setLength(0);
int loop5 = Integer.MAX_VALUE / 5;
for (int i = 0; i < loop5; i++) {
buf.append(false);
}
}
} |
Yeah. I think it is reasonable to leave out such tests. |
macos-aarch64 build error, I have been encountering this problem for the past two days. How do I solve it?
|
I made a mistake, I ran the wrong jtreg, edited it, please ignore it |
@AlanBateman @minborg |
Looks good, can you bump the copyright header on UnixUserDefinedFileAttributeView too? |
I think this patch can go ahead: the change to internal unsafe will affect many other components and all use sites will get bytecode updates. The more comprehensive change will need more throughout investigation and testing, while the fixes here are straightforward and easy to verify. |
Co-authored-by: Andrey Turbanov <turbanoff@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great with the additional fixes.
/integrate |
Going to push as commit 0dab920.
Your commit was automatically rebased without conflicts. |
In the JDK code, there are some places that may cause Unsafe offset overflow. The probability of occurrence is low, but if it occurs, it will cause JVM crash.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/22027/head:pull/22027
$ git checkout pull/22027
Update a local copy of the PR:
$ git checkout pull/22027
$ git pull https://git.openjdk.org/jdk.git pull/22027/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 22027
View PR using the GUI difftool:
$ git pr show -t 22027
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/22027.diff
Using Webrev
Link to Webrev Comment