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

8258946: Fix optimization-unstable code involving signed integer overflow #1900

Closed
wants to merge 2 commits into from

Conversation

@shqking
Copy link
Contributor

@shqking shqking commented Dec 28, 2020

Optimization-unstable code refers to code that is unexpectedly discarded
by compiler optimizations due to undefined behavior in the program.

We applied a static checker called STACK (prototype from SOSP'13 paper
[1]) to OpenJDK source code and found the following six sites of
potential unstable code involving signed integer overflow.

Removing undefined behaviors would make the code stable.

[1] https://css.csail.mit.edu/stack/


Note that we tested locally Jtreg tests ( tier1 and jdk::tier3) were passed on Linux x86-64/aarch64 machines after apply this patch.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8258946: Fix optimization-unstable code involving signed integer overflow

Reviewers

Download

$ git fetch https://git.openjdk.java.net/jdk pull/1900/head:pull/1900
$ git checkout pull/1900

…flow

Optimization-unstable code refers to code that is unexpectedly discarded
by compiler optimizations due to undefined behavior in the program.

We applied a static checker called STACK (prototype from SOSP'13 paper
[1]) to OpenJDK source code and found the following six sites of
potential unstable code involving signed integer overflow.

Removing undefined behaviors would make the code stable.

[1] https://css.csail.mit.edu/stack/
@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Dec 28, 2020

👋 Welcome back shqking! 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.

Loading

@openjdk openjdk bot added the rfr label Dec 28, 2020
@openjdk
Copy link

@openjdk openjdk bot commented Dec 28, 2020

@shqking The following label will be automatically applied to this pull request:

  • hotspot-compiler

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.

Loading

@mlbridge
Copy link

@mlbridge mlbridge bot commented Dec 28, 2020

Webrevs

Loading

Copy link
Member

@TobiHartmann TobiHartmann left a comment

Looks good to me.

Loading

@openjdk
Copy link

@openjdk openjdk bot commented Jan 4, 2021

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

8258946: Fix optimization-unstable code involving signed integer overflow

Reviewed-by: thartmann, kvn

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:

  • 5ea9607: 8258459: Decouple gc_globals.hpp from globals.hpp
  • 2499ac3: 8259069: Fields could be final
  • f0aae81: 8259020: null-check of g1 write_ref_field_pre_entry is not necessary
  • e6f9926: 8257809: JNI warnings from Toolkit JPEG image decoding
  • 9d160aa: 8257815: Replace global log2 functions with efficient implementations
  • f80c63b: 8258490: Shenandoah: Full GC does not need to remark threads and drain SATB buffers
  • 7f04d23: 8258800: Deprecate -XX:+AlwaysLockClassLoader
  • d679caa: 8196466: javax/swing/JFileChooser/8062561/bug8062561.java fails
  • a2a3f4a: 8258924: javax/swing/JSplitPane/4201995/bug4201995.java fails in GTk L&F
  • f351e15: 8258382: Fix optimization-unstable code involving pointer overflow
  • ... and 9 more: https://git.openjdk.java.net/jdk/compare/779ee1104ca7f506bd1113004a84745824a507d4...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.

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 (@TobiHartmann, @vnkozlov) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

Loading

@openjdk openjdk bot added the ready label Jan 4, 2021
Copy link
Contributor

@vnkozlov vnkozlov left a comment

Good.

Loading

Update the copyright year to 2021.

Change-Id: If1c44ff5e88accb96367bec64aa58449a97a36e5
CustomizedGitHooks: yes
@shqking
Copy link
Contributor Author

@shqking shqking commented Jan 5, 2021

Thanks for your review. @vnkozlov and @TobiHartmann

Since the new commit only updates the copyright year and the pre-submits tests were passed for the first commit (See https://github.com/shqking/jdk/actions/runs/460991763/workflow), I suppose it's ready to merge now.

/integrate

Loading

@openjdk openjdk bot added the sponsor label Jan 5, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Jan 5, 2021

@shqking
Your change (at version c3ceef6) is now ready to be sponsored by a Committer.

Loading

@nsjian
Copy link

@nsjian nsjian commented Jan 5, 2021

/sponsor

Loading

@openjdk openjdk bot closed this Jan 5, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Jan 5, 2021

@nsjian @shqking Since your change was applied there have been 19 commits pushed to the master branch:

  • 5ea9607: 8258459: Decouple gc_globals.hpp from globals.hpp
  • 2499ac3: 8259069: Fields could be final
  • f0aae81: 8259020: null-check of g1 write_ref_field_pre_entry is not necessary
  • e6f9926: 8257809: JNI warnings from Toolkit JPEG image decoding
  • 9d160aa: 8257815: Replace global log2 functions with efficient implementations
  • f80c63b: 8258490: Shenandoah: Full GC does not need to remark threads and drain SATB buffers
  • 7f04d23: 8258800: Deprecate -XX:+AlwaysLockClassLoader
  • d679caa: 8196466: javax/swing/JFileChooser/8062561/bug8062561.java fails
  • a2a3f4a: 8258924: javax/swing/JSplitPane/4201995/bug4201995.java fails in GTk L&F
  • f351e15: 8258382: Fix optimization-unstable code involving pointer overflow
  • ... and 9 more: https://git.openjdk.java.net/jdk/compare/779ee1104ca7f506bd1113004a84745824a507d4...master

Your commit was automatically rebased without conflicts.

Pushed as commit dd8996c.

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

Loading

@shqking shqking deleted the stack-ub-io branch Jan 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
4 participants