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

8324121: SIGFPE in PhaseIdealLoop::extract_long_range_checks #18397

Closed
wants to merge 2 commits into from

Conversation

rwestrel
Copy link
Contributor

@rwestrel rwestrel commented Mar 20, 2024

Both failures occur because ABS(scale * stride_con) overflows (scale
a really large long number). I reworked the test so overflow is no
longer an issue.


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

Issue

  • JDK-8324121: SIGFPE in PhaseIdealLoop::extract_long_range_checks (Bug - P3)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 18397

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

Using diff file

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

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Mar 20, 2024

👋 Welcome back roland! 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 Mar 20, 2024

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

8324121: SIGFPE in PhaseIdealLoop::extract_long_range_checks

Reviewed-by: kvn, chagedorn

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

  • acc4a82: 8328862: Remove unused GrowableArrayFilterIterator
  • 9f920b9: 8324655: Identify integer minimum and maximum patterns created with if statements
  • c7b9dc4: 8328404: RISC-V: Fix potential crash in C2_MacroAssembler::arrays_equals
  • bc73963: 8328303: 3 JDI tests timed out with UT enabled
  • 476421e: 8328370: Convert java/awt/print/Dialog/PrintApplet.java applet test to main
  • c013fa1: 8328194: Add a test to check default rendering engine
  • f33a844: 8325536: JVM crash during CDS archive creation with -XX:+AllowArchivingWithJavaAgent
  • 4324e3b: 8328612: AdaptiveSizePolicySpaceOverheadTester::is_exceeded() print max_eden_size twice
  • c7bbf84: 8328190: Convert AWTPanelSmoothWheel.html applet test to main
  • 23ebd9c: 8328555: hidpi problems for test java/awt/Dialog/DialogAnotherThread/JaWSTest.java
  • ... and 262 more: https://git.openjdk.org/jdk/compare/784f11c35d7f8646c7354c756ac8801a3d685874...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 added the rfr Pull request is ready for review label Mar 20, 2024
@openjdk
Copy link

openjdk bot commented Mar 20, 2024

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

@openjdk openjdk bot added the hotspot-compiler hotspot-compiler-dev@openjdk.org label Mar 20, 2024
@mlbridge
Copy link

mlbridge bot commented Mar 20, 2024

Webrevs

@@ -1106,7 +1107,8 @@ int PhaseIdealLoop::extract_long_range_checks(const IdealLoopTree* loop, jlong s
jlong scale = 0;
if (loop->is_range_check_if(if_proj, this, T_LONG, phi, range, offset, scale) &&
loop->is_invariant(range) && loop->is_invariant(offset) &&
original_iters_limit / ABS(scale * stride_con) >= min_iters) {
original_iters_limit / ABS(scale) >= min_iters * ABS(stride_con)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume there is check somewhere that stride_con is not MIN_INT.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my opinion ABS() should assert that it has legal input (not MIN_INT) and output (non-negative value) in debug builds.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for reviewing this.
We can't get to this code if stride_con is MIN_INT because some other condition (that doesn't explicitly check that stride_con is not MIN_INT) causes a bail out from the transformation. I added an explicit bail out in that case in a new commit anyway to make the code more robust.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my opinion ABS() should assert that it has legal input (not MIN_INT) and output (non-negative value) in debug builds.

I agree and filed JDK-8328934 for that.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, there is still an overflow here when scale is min_jlong.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right but isn't it harmless in this particular case?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, if it's undefined behavior, we can't be sure what result the C++ compiler will give. And if we test with -ftrapv it will crash.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

@vnkozlov vnkozlov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Mar 22, 2024
Copy link
Member

@chhagedorn chhagedorn 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!

@rwestrel
Copy link
Contributor Author

@vnkozlov @chhagedorn for the reviews

@rwestrel
Copy link
Contributor Author

/integrate

@openjdk
Copy link

openjdk bot commented Mar 25, 2024

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

  • 0c1b254: 8326438: C2: assert(ld->in(1)->Opcode() == Op_LoadN) failed: Assumption invalid: input to DecodeN is not LoadN
  • 29ba4b7: 8328705: GHA: Cross-compilation jobs do not require build JDK
  • f67ec19: 8079786: [macosx] Test java/awt/Frame/DisposeParentGC/DisposeParentGC.java fails for Mac only
  • 93579c2: 8323552: AbstractMemorySegmentImpl#mismatch returns -1 when comparing distinct areas of the same instance of MemorySegment
  • b235682: 8328709: AIX os::get_summary_cpu_info support Power 10
  • 19a0151: 8328700: Unused import and variable should be deleted in regex package
  • cf9b5a7: 8328776: [AIX] remove checked_vmgetinfo, use vmgetinfo directly
  • acc4a82: 8328862: Remove unused GrowableArrayFilterIterator
  • 9f920b9: 8324655: Identify integer minimum and maximum patterns created with if statements
  • c7b9dc4: 8328404: RISC-V: Fix potential crash in C2_MacroAssembler::arrays_equals
  • ... and 269 more: https://git.openjdk.org/jdk/compare/784f11c35d7f8646c7354c756ac8801a3d685874...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Mar 25, 2024

@rwestrel Pushed as commit cb2a671.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot-compiler hotspot-compiler-dev@openjdk.org integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

5 participants