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

8264649: runtime/InternalApi/ThreadCpuTimesDeadlock.java crash in fastdebug C2 with -XX:-UseTLAB #3336

Closed
wants to merge 2 commits into from

Conversation

huishi-hs
Copy link

@huishi-hs huishi-hs commented Apr 3, 2021

Please help review this fix. Detailed analysis in https://bugs.openjdk.java.net/browse/JDK-8264649

Tier1/2 release /fastdebug passed


Progress

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

Issue

  • JDK-8264649: runtime/InternalApi/ThreadCpuTimesDeadlock.java crash in fastdebug C2 with -XX:-UseTLAB

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 3336

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented Apr 3, 2021

👋 Welcome back hshi! 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 Apr 3, 2021
@openjdk
Copy link

openjdk bot commented Apr 3, 2021

@huishi-hs The following label will be automatically applied to this pull request:

  • hotspot

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 hotspot-dev@openjdk.org label Apr 3, 2021
@mlbridge
Copy link

mlbridge bot commented Apr 3, 2021

Webrevs

@huishi-hs
Copy link
Author

/label add hotspot-compiler

@openjdk openjdk bot added the hotspot-compiler hotspot-compiler-dev@openjdk.org label Apr 3, 2021
@openjdk
Copy link

openjdk bot commented Apr 3, 2021

@huishi-hs
The hotspot-compiler label was successfully added.

/*
* @test
* @bug 8264649
* @summary OSR compiled metthod crash when UseTLAB is off
Copy link
Member

Choose a reason for hiding this comment

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

Typo metthod.

Copy link
Author

Choose a reason for hiding this comment

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

Fixed.

@@ -1481,6 +1481,9 @@ void PhaseIterGVN::subsume_node( Node *old, Node *nn ) {
temp->init_req(0,nn); // Add a use to nn to prevent him from dying
Copy link
Member

Choose a reason for hiding this comment

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

Just wondering, why do we even need this? Without that code, remove_dead_node(old) would kill nn as well if it becomes dead.

Copy link
Author

@huishi-hs huishi-hs Apr 7, 2021

Choose a reason for hiding this comment

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

Thanks for your review!

Checking code history, this code is quite old. From comments around, it doesn't want nn removed directly in PhaseIterGVN::subsume_node and leaves optimization to next GVN iteration.

In my understanding, it might save callers to insert codes checking if "nn" is removed/dead at every subsume_node/replace_node callsite, simplifies implementation.

8153779 hotspot/src/share/vm/opto/phaseX.cpp (J. Duke 2007-12-01 00:00:00 +0000 1479) // Smash all inputs to 'old', isolating him completely
2a0815a hotspot/src/share/vm/opto/phaseX.cpp (Tobias Hartmann 2014-06-02 08:07:29 +0200 1480) Node *temp = new Node(1);
8153779 hotspot/src/share/vm/opto/phaseX.cpp (J. Duke 2007-12-01 00:00:00 +0000 1481) temp->init_req(0,nn); // Add a use to nn to prevent him from dying
8153779 hotspot/src/share/vm/opto/phaseX.cpp (J. Duke 2007-12-01 00:00:00 +0000 1482) remove_dead_node( old );
8153779 hotspot/src/share/vm/opto/phaseX.cpp (J. Duke 2007-12-01 00:00:00 +0000 1483) temp->del_req(0); // Yank bogus edge

Copy link
Contributor

Choose a reason for hiding this comment

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

Note nn could be new node created during parsing which does not have users yet. that is why we need to keep it

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.

Thanks for the details. Your fix looks reasonable to me.

@openjdk
Copy link

openjdk bot commented Apr 9, 2021

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

8264649: runtime/InternalApi/ThreadCpuTimesDeadlock.java crash in fastdebug C2 with -XX:-UseTLAB

Reviewed-by: thartmann, kvn

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

  • 76bd313: 8264872: Dependencies: Migrate to PerfData counters
  • 07c8ff4: 8264871: Dependencies: Miscellaneous cleanups in dependencies.cpp
  • 863feab: 8005295: Use mandated information for printing of repeating annotations
  • f26cd2a: 8264997: Remove SystemDictionary::cache_get
  • 9ebc497: 8264765: BreakIterator sees bogus sentence boundary in parenthesized “i.e.” phrase
  • ec31b3a: 8264727: Shenandoah: Remove extraneous whitespace from phase timings report
  • cc54de7: 8264400: (fs) WindowsFileStore equality depends on how the FileStore was constructed
  • 6de0bb2: 8232861: (fc) FileChannel.force fails on WebDAV file systems (macOS)
  • 1ca4abe: 8262881: port JVM/DI tests from JDK-4413752 to JVM/TI
  • 06e6b1f: 8259242: Remove ProtectionDomainSet_lock
  • ... and 89 more: https://git.openjdk.java.net/jdk/compare/66d9961cbd83dbfca20b0af3c20693438d4aff3f...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.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@TobiHartmann, @vnkozlov) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Apr 9, 2021
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.

I agree with change.

@huishi-hs
Copy link
Author

Thanks! @TobiHartmann @vnkozlov

@huishi-hs
Copy link
Author

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Apr 9, 2021
@openjdk
Copy link

openjdk bot commented Apr 9, 2021

@huishi-hs
Your change (at version 2f6b68d) is now ready to be sponsored by a Committer.

@DamonFool
Copy link
Member

/sponsor

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

openjdk bot commented Apr 10, 2021

@DamonFool @huishi-hs Since your change was applied there have been 99 commits pushed to the master branch:

  • 76bd313: 8264872: Dependencies: Migrate to PerfData counters
  • 07c8ff4: 8264871: Dependencies: Miscellaneous cleanups in dependencies.cpp
  • 863feab: 8005295: Use mandated information for printing of repeating annotations
  • f26cd2a: 8264997: Remove SystemDictionary::cache_get
  • 9ebc497: 8264765: BreakIterator sees bogus sentence boundary in parenthesized “i.e.” phrase
  • ec31b3a: 8264727: Shenandoah: Remove extraneous whitespace from phase timings report
  • cc54de7: 8264400: (fs) WindowsFileStore equality depends on how the FileStore was constructed
  • 6de0bb2: 8232861: (fc) FileChannel.force fails on WebDAV file systems (macOS)
  • 1ca4abe: 8262881: port JVM/DI tests from JDK-4413752 to JVM/TI
  • 06e6b1f: 8259242: Remove ProtectionDomainSet_lock
  • ... and 89 more: https://git.openjdk.java.net/jdk/compare/66d9961cbd83dbfca20b0af3c20693438d4aff3f...master

Your commit was automatically rebased without conflicts.

Pushed as commit 42f4d70.

💡 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 hotspot-dev@openjdk.org hotspot-compiler hotspot-compiler-dev@openjdk.org integrated Pull request has been integrated
4 participants