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

8276157: C2: Compiler stack overflow during escape analysis on Linux x86_32 #6167

Closed

Conversation

shipilev
Copy link
Contributor

@shipilev shipilev commented Oct 29, 2021

See the bug for test details and analysis. I believe we just legitimately run out of stack in fastdebug builds. The fix is to increase the default stack size a bit. Linux-S390, Windows-x86/AArch64 seems to do a similar thing.

I can do a similar change in globals_bsd_x86.hpp, but that would be a blind change, as I don't have platforms to verify that change sanity. I would prefer to make a Linux-specific fix at this time.

Additional testing:

  • Failing test now passes on Linux x86_32
  • Linux x86_32 fastdebug tier1

Progress

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

Issue

  • JDK-8276157: C2: Compiler stack overflow during escape analysis on Linux x86_32

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 6167

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

Using diff file

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

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Oct 29, 2021

👋 Welcome back shade! 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 label Oct 29, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Oct 29, 2021

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

  • hotspot-runtime

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-runtime label Oct 29, 2021
@shipilev
Copy link
Contributor Author

@shipilev shipilev commented Oct 29, 2021

/label hotspot-compiler

@openjdk openjdk bot added the hotspot-compiler label Oct 29, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Oct 29, 2021

@shipilev
The hotspot-compiler label was successfully added.

@mlbridge
Copy link

@mlbridge mlbridge bot commented Oct 29, 2021

Webrevs

Copy link
Contributor

@vnkozlov vnkozlov left a comment

I consider this change as workaround. I am fine with it.

Does EA find non-escaping allocations when the test passed (with bigger stack)?

To actually fix the issue we would need to re-write recursive method ConnectionGraph::find_inst_mem() to normal method using Node_Stack or other C2's structures without recursion. Please, file RFE. May be also add check that it is not infinite recursion.

@openjdk
Copy link

@openjdk openjdk bot commented Oct 29, 2021

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

8276157: C2: Compiler stack overflow during escape analysis on Linux x86_32

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

  • 87b926e: 8275086: compiler/c2/irTests/TestPostParseCallDevirtualization.java fails when compiler1 is disabled
  • 2b02b6f: 8274942: AssertionError at jdk.compiler/com.sun.tools.javac.util.Assert.error(Assert.java:155)
  • bb92fb0: 8274930: sun/tools/jps/TestJps.java can fail with long VM arguments string
  • 6a04899: 8275840: Add test to java/nio/channels/Channels/TransferTo.java to test transfer sizes > 2GB
  • 01105d6: 8276367: ProblemList vmTestbase/nsk/jvmti/RedefineClasses/StressRedefineWithoutBytecodeCorruption/TestDescription.java
  • 8fc16f1: 8275729: Qualified method names in CodeHeap Analytics
  • fa4ce82: 8276260: (se) Remove java/nio/channels/Selector/Wakeup.java from ProblemList (win)
  • 495c828: 8276188: Clarify "default charset" descriptions in String class
  • cd778f5: 8202667: java/awt/Debug/DumpOnKey/DumpOnKey.java times out on Windows
  • b889f2a: 8276175: codestrings.validate_vm gtest still broken on ppc64 after JDK-8276046
  • ... and 103 more: https://git.openjdk.java.net/jdk/compare/f6232982b91cb2314e96ddbde3984836a810a556...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 label Oct 29, 2021
@shipilev
Copy link
Contributor Author

@shipilev shipilev commented Nov 1, 2021

Thanks! I guess I need a second (R)eviewer for this.

Does EA find non-escaping allocations when the test passed (with bigger stack)?

It is really hard to tell for this test, because it runs way too many configurations, and reducing the configurations makes the failure disappear. Digging through -XX:+PrintEscapeAnalysis output, I'd say EA does not find more NoEscape objects, after the point where old builds just crash.

To actually fix the issue we would need to re-write recursive method ConnectionGraph::find_inst_mem() to normal method using Node_Stack or other C2's structures without recursion. Please, file RFE. May be also add check that it is not infinite recursion.

Filed JDK-8276219.

@vnkozlov
Copy link
Contributor

@vnkozlov vnkozlov commented Nov 1, 2021

Thank you for filing RFE.

@vnkozlov
Copy link
Contributor

@vnkozlov vnkozlov commented Nov 1, 2021

Yes, you need second review.

Copy link
Member

@TobiHartmann TobiHartmann left a comment

Looks good to me.

@shipilev
Copy link
Contributor Author

@shipilev shipilev commented Nov 3, 2021

Thank you!

/integrate

@openjdk
Copy link

@openjdk openjdk bot commented Nov 3, 2021

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

  • 7439b59: 8276044: ciReplay: C1 does not dump a replay file when using DumpReplay as compile command option
  • 87b926e: 8275086: compiler/c2/irTests/TestPostParseCallDevirtualization.java fails when compiler1 is disabled
  • 2b02b6f: 8274942: AssertionError at jdk.compiler/com.sun.tools.javac.util.Assert.error(Assert.java:155)
  • bb92fb0: 8274930: sun/tools/jps/TestJps.java can fail with long VM arguments string
  • 6a04899: 8275840: Add test to java/nio/channels/Channels/TransferTo.java to test transfer sizes > 2GB
  • 01105d6: 8276367: ProblemList vmTestbase/nsk/jvmti/RedefineClasses/StressRedefineWithoutBytecodeCorruption/TestDescription.java
  • 8fc16f1: 8275729: Qualified method names in CodeHeap Analytics
  • fa4ce82: 8276260: (se) Remove java/nio/channels/Selector/Wakeup.java from ProblemList (win)
  • 495c828: 8276188: Clarify "default charset" descriptions in String class
  • cd778f5: 8202667: java/awt/Debug/DumpOnKey/DumpOnKey.java times out on Windows
  • ... and 104 more: https://git.openjdk.java.net/jdk/compare/f6232982b91cb2314e96ddbde3984836a810a556...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot closed this Nov 3, 2021
@openjdk openjdk bot added integrated and removed ready rfr labels Nov 3, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Nov 3, 2021

@shipilev Pushed as commit 465d350.

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

@shipilev shipilev deleted the JDK-8276157-x86_32-stackoverflow branch Nov 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot-compiler hotspot-runtime integrated
3 participants