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

8263971: C2 crashes with SIGFPE with -XX:+StressGCM and -XX:+StressIGVN #3190

Closed
wants to merge 5 commits into from

Conversation

rwestrel
Copy link
Contributor

@rwestrel rwestrel commented Mar 25, 2021

For the inner for loop of the test case:

1- the control input of the DivI node in the loop body is cleared
because the range of values for i23, the loop's iv, is known to
never be null.

2- pre/main/post loops are added

3- the main loop is unrolled enough that it's fully unrolled but
actually never entered

4- because the main loop is no longer a looop, DiVI nodes from the
main loop can float and are scheduled in the pre loop.

5- the main loop is never executed (the values of the iv for the main
loop after unrolling fall outside the (3, 68] range of values of the
initial loop), one of the main loop DivI nodes divides by 0 and
because it doesn't stay in the main loop, the crash occurs.

The calls to PhaseIdealLoop::cast_incr_before_loop() in
PhaseIdealLoop::insert_pre_post_loops() should guarantee that nodes
that uses the loop iv stay control dependent on the test that guards
the main loop. For that it inserts a CastII node with the
_carry_dependency flag set. With 8256730, that CastII for the main
loop is pushed through the iv AddI of the pre loop. In the process, it
looses the _carry_dependency flag which causes the CastII node to be
optimized out and the DivI nodes to float.

With the proposed fix, CastII nodes created by the logic from 8256730
have the _carry_dependency flag set if the CastII node that's
transform has it.


Progress

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

Issue

  • JDK-8263971: C2 crashes with SIGFPE with -XX:+StressGCM and -XX:+StressIGVN

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/3190/head:pull/3190
$ git checkout pull/3190

Update a local copy of the PR:
$ git checkout pull/3190
$ git pull https://git.openjdk.java.net/jdk pull/3190/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 3190

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/3190.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Mar 25, 2021

👋 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 openjdk bot added the rfr Pull request is ready for review label Mar 25, 2021
@openjdk
Copy link

openjdk bot commented Mar 25, 2021

@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 25, 2021
@mlbridge
Copy link

mlbridge bot commented Mar 25, 2021

Webrevs

* @bug 8263971
* @summary C2 crashes with SIGFPE with -XX:+StressGCM and -XX:+StressIGVN
*
* @run main/othervm -Xcomp -XX:-TieredCompilation -XX:CompileOnly=TestLostDependencyOnZeroTripGuard -XX:+StressGCM -XX:StressSeed=886771365 TestLostDependencyOnZeroTripGuard
Copy link
Member

Choose a reason for hiding this comment

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

-XX:+UnlockDiagnosticVMOptions -XX:+IgnoreUnrecognizedVMOptions should be added for the test, right?

Copy link
Member

Choose a reason for hiding this comment

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

-XX:+UnlockDiagnosticVMOptions should be enough.

Copy link
Contributor Author

@rwestrel rwestrel Mar 25, 2021

Choose a reason for hiding this comment

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

Thanks for looking at this

-XX:+UnlockDiagnosticVMOptions -XX:+IgnoreUnrecognizedVMOptions should be added for the test, right?

I added -XX:+UnlockDiagnosticVMOptions so the test can be run with a release build.

Copy link
Member

Choose a reason for hiding this comment

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

I don't think -XX:+UnlockDiagnosticVMOptions is enough since StressGCM is a C2-only flag.

What will happen if there is no c2 compiler?
Thanks.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think -XX:+UnlockDiagnosticVMOptions is enough since StressGCM is a C2-only flag.

What will happen if there is no c2 compiler?

Right. Command line option added.

Copy link
Member

Choose a reason for hiding this comment

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

I don't think -XX:+UnlockDiagnosticVMOptions is enough since StressGCM is a C2-only flag.
What will happen if there is no c2 compiler?

Right. Command line option added.

Thanks for your update.

Copy link
Member

Choose a reason for hiding this comment

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

What will happen if there is no c2 compiler?

Ah, yes, good point! I was only thinking about product builds.

There are actually more compiler tests that have -XX:+IgnoreUnrecognizedVMOptions missing as for example: Vec_mulAddS2I that uses C2-specific flags. I'll file a bug to clean that up separately.

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.

Otherwise, looks good to me!

* @bug 8263971
* @summary C2 crashes with SIGFPE with -XX:+StressGCM and -XX:+StressIGVN
*
* @run main/othervm -Xcomp -XX:-TieredCompilation -XX:CompileOnly=TestLostDependencyOnZeroTripGuard -XX:+StressGCM -XX:StressSeed=886771365 TestLostDependencyOnZeroTripGuard
Copy link
Member

Choose a reason for hiding this comment

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

-XX:+UnlockDiagnosticVMOptions should be enough.

@openjdk
Copy link

openjdk bot commented Mar 25, 2021

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

8263971: C2 crashes with SIGFPE with -XX:+StressGCM and -XX:+StressIGVN

Reviewed-by: chagedorn, thartmann

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

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 ready Pull request is ready to be integrated label Mar 25, 2021
@openjdk
Copy link

openjdk bot commented Mar 25, 2021

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

8263971: C2 crashes with SIGFPE with -XX:+StressGCM and -XX:+StressIGVN

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

  • a1e717f: 8264146: Make Mutex point to rather than embed _name
  • f69afba: 8263300: add HtmlId for the block containing a class's description.
  • d82464f: 8263528: Make static page ids safe from collision with language elements
  • d602ae0: 8263884: Clean up os::is_allocatable() across Posix platforms
  • a9d287a: 8260388: Listing (sub)packages at package level of API documentation
  • 8120064: 8263781: C2: Cannot hoist independent load above arraycopy
  • 9689863: 8262295: C2: Out-of-Bounds Array Load from Clone Source
  • a678a38: 8263743: redundant lock in SSLSocketImpl
  • 3fcb499: 8263768: JFormattedTextField.AbstractFormatter.getDocumentFilter()/getNavigationFilter() spec doesn't mention what the default impls return and what does it mean
  • 4155533: 8258753: StartTlsResponse.close() hangs due to synchronization issues
  • ... and 15 more: https://git.openjdk.java.net/jdk/compare/bc91596ca108ed366c35027cb01417d93543a1e0...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.

@rwestrel
Copy link
Contributor Author

Otherwise, looks good to me!

Thanks for the review.

Copy link
Member

@TobiHartmann TobiHartmann 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 to me.

* @summary C2 crashes with SIGFPE with -XX:+StressGCM and -XX:+StressIGVN
*
* @run main/othervm -Xcomp -XX:-TieredCompilation -XX:CompileOnly=TestLostDependencyOnZeroTripGuard -XX:+UnlockDiagnosticVMOptions
* -XX:+IgnoreUnrecognizedVMOptions -XX:+StressGCM -XX:StressSeed=886771365 TestLostDependencyOnZeroTripGuard
Copy link
Member

Choose a reason for hiding this comment

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

Is it worth adding another @run with no fixed seed? Just to give this a chance to still trigger the bug if the implementation changes in the future such that the fixed seed does not work anymore.

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 the review. Would you drop -XX:+StressGCM as well or keep it?

Copy link
Member

Choose a reason for hiding this comment

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

I would keep it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in updated change.

@rwestrel
Copy link
Contributor Author

/integrate

@openjdk openjdk bot closed this Mar 30, 2021
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Mar 30, 2021
@openjdk
Copy link

openjdk bot commented Mar 30, 2021

@rwestrel Since your change was applied there have been 77 commits pushed to the master branch:

Your commit was automatically rebased without conflicts.

Pushed as commit 8100a20.

💡 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.

4 participants