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

8336912: G1: Undefined behavior for G1ConfidencePercent=0 #20371

Conversation

tschatzl
Copy link
Contributor

@tschatzl tschatzl commented Jul 29, 2024

Hello,

please review this change to workaround an unintentional division by zero found by ubsan.

The global option G1ConfidencePercent allowed zero as confidence for predictions which this change simply disallows: not sure what the response of the VM would be if the user told it that it should have absolutely no confidence (i.e. confidence is zero) in the predictions (not "very low" confidence).

Testing: after this change, the ubsan failure goes away.

Thanks,
Thomas


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change requires CSR request JDK-8337340 to be approved

Issues

  • JDK-8336912: G1: Undefined behavior for G1ConfidencePercent=0 (Bug - P4)
  • JDK-8337340: G1: Disallow a value of zero for G1ConfidencePercent (CSR)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/20371/head:pull/20371
$ git checkout pull/20371

Update a local copy of the PR:
$ git checkout pull/20371
$ git pull https://git.openjdk.org/jdk.git pull/20371/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 20371

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/20371.diff

Webrev

Link to Webrev Comment

Hello,

  please review this change to workaround an unintentional division by zero found by ubsan.

The global option `G1ConfidencePercent` allowed zero as confidence for predictions which this change simply disallows: not sure what the response of the VM could be if the user told it that it should have absolutely no confidence in the predictions (not "very low" confidence).

Testing: after this change, the ubsan failure goes away.

Thanks,
  Thomas
@bridgekeeper
Copy link

bridgekeeper bot commented Jul 29, 2024

👋 Welcome back tschatzl! 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 Jul 29, 2024

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

8336912: G1: Undefined behavior for G1ConfidencePercent=0

Reviewed-by: ayang, sangheki

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

  • a91f9ba: 8301403: Eliminate memory allocations in JVMFlag::printFlags during signal handling
  • 2c9fd90: 8336315: tools/jpackage/windows/WinChildProcessTest.java Failed: Check is calculator process is alive
  • 1cb27f7: 8334230: Optimize C2 classes layout
  • 4148613: 8335907: JFR: Make SettingControls more robust
  • 79bdd81: 8336763: Parallel: Merge PCMarkAndPushClosure and PCIterateMarkAndPushClosure
  • 8162832: 8333354: ubsan: frame.inline.hpp:91:25: and src/hotspot/share/runtime/frame.inline.hpp:88:29: runtime error: member call on null pointer of type 'const struct SmallRegisterMap'
  • 0325ab8: 8335610: DiagnosticFramework: CmdLine::is_executable() correction
  • 7ac5311: 8331126: [s390x] secondary_super_cache does not scale well
  • 156f0b4: 8337213: Shenandoah: Add verification for class mirrors
  • 9e6e0a8: 8336343: Add more known sysroot library locations for ALSA
  • ... and 84 more: https://git.openjdk.org/jdk/compare/92de2b2d5f21af38380b437af51e49c7ac142258...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 8336912 8336912: G1: Undefined behavior for G1ConfidencePercent=0 Jul 29, 2024
@openjdk
Copy link

openjdk bot commented Jul 29, 2024

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

  • hotspot-gc

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.

@openjdk openjdk bot added hotspot-gc hotspot-gc-dev@openjdk.org csr Pull request needs approved CSR before integration labels Jul 29, 2024
@tschatzl tschatzl marked this pull request as ready for review July 29, 2024 11:05
@openjdk openjdk bot added the rfr Pull request is ready for review label Jul 29, 2024
@mlbridge
Copy link

mlbridge bot commented Jul 29, 2024

Webrevs

Copy link
Member

@sangheon sangheon 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.

@openjdk openjdk bot added ready Pull request is ready to be integrated and removed csr Pull request needs approved CSR before integration labels Jul 30, 2024
@tschatzl
Copy link
Contributor Author

Thanks @albertnetymk @sangheon for your reviews
/integrate

@openjdk
Copy link

openjdk bot commented Jul 31, 2024

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

  • e63d016: 8337031: Improvements to CompilationMemoryStatistic
  • 1c6fef8: 8337515: JVM_DumpAllStacks is dead code
  • 5b7bb40: 8325002: Exceptions::fthrow needs to ensure it truncates to a valid utf8 string
  • d39e7af: 8320561: Inconsistency in monitorinflation logging
  • 6c3ba5a: 8337415: Remove inappropriate Atomic access in FreeListAllocator
  • f5c9e8f: 8334492: DiagnosticCommands (jcmd) should accept %p in output filenames and substitute PID
  • 93c19ac: 8337219: AccessFlags factories do not require necessary arguments
  • 6154a21: 8336032: Enforce immutability of Lists used by ClassFile API
  • a91f9ba: 8301403: Eliminate memory allocations in JVMFlag::printFlags during signal handling
  • 2c9fd90: 8336315: tools/jpackage/windows/WinChildProcessTest.java Failed: Check is calculator process is alive
  • ... and 92 more: https://git.openjdk.org/jdk/compare/92de2b2d5f21af38380b437af51e49c7ac142258...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Jul 31, 2024

@tschatzl Pushed as commit de0b504.

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

@tschatzl tschatzl deleted the submit/8336912-G1ConfidencePercent-bounds branch October 2, 2024 10:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot-gc hotspot-gc-dev@openjdk.org integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

3 participants