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

8260653: Unreachable nodes keep speculative types alive #2606

Closed
wants to merge 4 commits into from

Conversation

neliasso
Copy link

@neliasso neliasso commented Feb 17, 2021

The RunThese test fails because after first igvn.optimize() (directly after parsing) there are unreachable nodes cycles left. Later when remove_speculative_types() is called - only reachable nodes will have their speculative type removed. At the end of remove_speculative_types() there is an assert that all speculative types have been removed that will fail.

This problem will not cause crashes in production - it is only a sanity test.

I suggest adding a call to PhaseRemoveUseless before remove_speculative_types. This will cost a few extra cycles but it is the only way we can guarantee that no unreachable nodes are left.

When debugging this I experimented with adding a call to verify_graph_edges to check for dead code at the same spot. This triggers failures in a lot of test. The conclusion is that it is very common that we have dead node cycles - but they very rarely keep speculative types alive.

A big thank you to Dean Long how created the reproducer for this bug.

Please review.


Progress

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

Issue

  • JDK-8260653: Unreachable nodes keep speculative types alive

Reviewers

Download

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

@bridgekeeper
Copy link

bridgekeeper bot commented Feb 17, 2021

👋 Welcome back neliasso! 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 Feb 17, 2021

@neliasso 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 hotspot-compiler hotspot-compiler-dev@openjdk.org rfr Pull request is ready for review labels Feb 17, 2021
@mlbridge
Copy link

mlbridge bot commented Feb 17, 2021

Webrevs

@neliasso
Copy link
Author

One reasonable alternative to adding one more pass of PhaseRemoveUseless is filtering out all non-reachable nodes from NodeHash::check_no_speculative_types. The unreachable nodes only live a short while before being removed in the renumbering phase.

Copy link

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

src/hotspot/share/opto/phaseX.cpp Outdated Show resolved Hide resolved
@openjdk
Copy link

openjdk bot commented Feb 17, 2021

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

8260653: Unreachable nodes keep speculative types alive

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

  • b695c7e: 8261925: ProblemList com/sun/jdi/AfterThreadDeathTest.java on Linux
  • 97e1657: 8261846: [JVMCI] c2v_iterateFrames can get out of sync with the StackFrameStream
  • b8fd614: 8261939: os::strdup_check_oom() should be used in os::same_files() in os_windows.cpp
  • 5f30829: 8202750: Reduce the use of get_canonical_path() in CDS
  • ea5bf45: 8261621: Delegate Unicode history from JLS to j.l.Character
  • d5a4d22: 8261843: incorrect info in docs/building.html
  • bf75a3a: 8261851: update ReflectionCallerCacheTest.java test to use ForceGC from test library
  • 05301f5: 8257497: Update keytool to create AKID from the SKID of the issuing certificate as specified by RFC 5280
  • cb84539: 8261553: Efficient mask generation using BMI2 BZHI instruction
  • a065879: 8261791: (sctp) handleSendFailed in SctpChannelImpl.c potential leaks
  • ... and 5 more: https://git.openjdk.java.net/jdk/compare/03b586b32cc1c471f2c7d60122b866bb71554a4a...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 ready Pull request is ready to be integrated label Feb 17, 2021
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.

Otherwise looks good.

src/hotspot/share/opto/phaseX.cpp Outdated Show resolved Hide resolved
@neliasso
Copy link
Author

Thanks for the reviews Vladimir and Tobias!

@neliasso
Copy link
Author

/integrate

@openjdk openjdk bot closed this Feb 18, 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 Feb 18, 2021
@openjdk
Copy link

openjdk bot commented Feb 18, 2021

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

  • b695c7e: 8261925: ProblemList com/sun/jdi/AfterThreadDeathTest.java on Linux
  • 97e1657: 8261846: [JVMCI] c2v_iterateFrames can get out of sync with the StackFrameStream
  • b8fd614: 8261939: os::strdup_check_oom() should be used in os::same_files() in os_windows.cpp
  • 5f30829: 8202750: Reduce the use of get_canonical_path() in CDS
  • ea5bf45: 8261621: Delegate Unicode history from JLS to j.l.Character
  • d5a4d22: 8261843: incorrect info in docs/building.html
  • bf75a3a: 8261851: update ReflectionCallerCacheTest.java test to use ForceGC from test library
  • 05301f5: 8257497: Update keytool to create AKID from the SKID of the issuing certificate as specified by RFC 5280
  • cb84539: 8261553: Efficient mask generation using BMI2 BZHI instruction
  • a065879: 8261791: (sctp) handleSendFailed in SctpChannelImpl.c potential leaks
  • ... and 5 more: https://git.openjdk.java.net/jdk/compare/03b586b32cc1c471f2c7d60122b866bb71554a4a...master

Your commit was automatically rebased without conflicts.

Pushed as commit 3a21e1d.

💡 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
3 participants