Skip to content

Conversation

@TheRealMDoerr
Copy link
Contributor

@TheRealMDoerr TheRealMDoerr commented Jan 24, 2025

Adding the missing node type check as described in the JBS issue. oopptr can be null in which case the current implementation crashes. This was only reported for JFR tests on PPC64 so far. If the expected graph pattern is not found, we bail out and skip the optimization.

make run-test TEST="jdk/jfr" JTREG="VM_OPTIONS=-XX:+UseZGC" has passed on linux PPC64le.


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-8348562: ZGC: segmentation fault due to missing node type check in barrier elision analysis (Bug - P3)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 23295

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jan 24, 2025

👋 Welcome back mdoerr! 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 Jan 24, 2025

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

8348562: ZGC: segmentation fault due to missing node type check in barrier elision analysis

Reviewed-by: rcastanedalo, rrich

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

  • 175e58b: 8332980: [IR Framework] Add option to measure IR rule processing time
  • b8c68c0: 8348207: Linux PPC64 PCH build broken after JDK-8347909
  • 70eec90: 8338303: Linux ppc64le with toolchain clang - detection failure in early JVM startup
  • a1fd5f4: 8348554: Enhance Linux kernel version checks
  • 002679a: 8347065: Add missing @SPEC tags for Java Security Standard Algorithm Names
  • 99002e4: 8318098: Update jfr tests to replace keyword jfr with vm.flagless
  • 5431668: 8348212: Need to add warn() step to JavacTaskImpl after JDK-8344148
  • 1d2eb2f: 8299504: Resolve uses and provides at run time if the service is optional and missing
  • f446cef: 8343962: [REDO] Move getChars to DecimalDigits
  • 7c0985f: 8348420: Shenandoah: Check is_reserved before using ReservedSpace instances
  • ... and 13 more: https://git.openjdk.org/jdk/compare/4a375e5b8899aa684b8a921e198203e76794f709...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 Jan 24, 2025
@openjdk
Copy link

openjdk bot commented Jan 24, 2025

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

  • hotspot-gc

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-gc hotspot-gc-dev@openjdk.org label Jan 24, 2025
@mlbridge
Copy link

mlbridge bot commented Jan 24, 2025

Webrevs

@TheRealMDoerr
Copy link
Contributor Author

/label add hotspot-compiler

@openjdk openjdk bot added the hotspot-compiler hotspot-compiler-dev@openjdk.org label Jan 24, 2025
@openjdk
Copy link

openjdk bot commented Jan 24, 2025

@TheRealMDoerr
The hotspot-compiler label was successfully added.

Copy link
Contributor

@robcasloz robcasloz 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, thanks!

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Jan 24, 2025
@reinrich
Copy link
Member

V  [libjvm.so+0xa1a3f0]  TypePtr::offset() const+0x14  (type.hpp:994)
V  [libjvm.so+0x1d35288]  get_base_and_offset(MachNode const*, long&)+0xb0  (zBarrierSetC2.cpp:557)
V  [libjvm.so+0x1d35818]  is_allocation(Node const*)+0x108  (zBarrierSetC2.cpp:629)

is_allocation is looking for a memory reference where base is Op_ThreadLocal. @TheRealMDoerr would you mind reproducing the crash with a little bit of tracing that dumps base just before the crash? S.th. like base->dump(3) ; base->dump(-3); I guess it is pretty unlikely but I'd like to make sure that we don't miss an actual allocation because the pattern is a little bit different on ppc.

@robcasloz
Copy link
Contributor

I guess it is pretty unlikely but I'd like to make sure that we don't miss an actual allocation because the pattern is a little bit different on ppc.

Hi Richard, note that compiler/gcbarriers/TestG1BarrierGeneration.java passes on PPC64 after applying JDK-8346280 (under review), implying that is_allocation is successful on PPC64 at least for the most common allocation scenarios.
I also tried running the optimization tests in compiler/gcbarriers/TestZGCBarrierElision.java (currently only enabled for x64 and aarch64) on PPC64, and test cases that rely on is_allocation finding an allocation (such as testAllocateThenStore) pass. There are some failures, but I suspect they are due to other factors (e.g. ADL instruction naming mismatches). If you want to study the effectiveness of the barrier elision optimization on PPC64, I suggest to address these failures and enable compiler/gcbarriers/TestZGCBarrierElision.java for PPC64 as well.

@reinrich
Copy link
Member

I guess it is pretty unlikely but I'd like to make sure that we don't miss an actual allocation because the pattern is a little bit different on ppc.

Hi Richard, note that compiler/gcbarriers/TestG1BarrierGeneration.java passes on PPC64 after applying JDK-8346280 (under review), implying that is_allocation is successful on PPC64 at least for the most common allocation scenarios. I also tried running the optimization tests in compiler/gcbarriers/TestZGCBarrierElision.java (currently only enabled for x64 and aarch64) on PPC64, and test cases that rely on is_allocation finding an allocation (such as testAllocateThenStore) pass. There are some failures, but I suspect they are due to other factors (e.g. ADL instruction naming mismatches). If you want to study the effectiveness of the barrier elision optimization on PPC64, I suggest to address these failures and enable compiler/gcbarriers/TestZGCBarrierElision.java for PPC64 as well.

Thanks for the explanation, Roberto. I wasn't aware that the code is trying to elide barriers and therefore missing one isn't that severe. Martin said he'll file an RFE to analyze the effectiveness on PPC64. I'm ok with that.

Copy link
Member

@reinrich reinrich left a comment

Choose a reason for hiding this comment

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

Looks reasonable.
Thanks for fixing!
Richard.

@TheRealMDoerr
Copy link
Contributor Author

Thanks for the reviews! I've filed JDK-8348656. It probably makes sense to take a closer look when somebody has time for such enhancements.
/integrate

@openjdk
Copy link

openjdk bot commented Jan 27, 2025

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

  • 175e58b: 8332980: [IR Framework] Add option to measure IR rule processing time
  • b8c68c0: 8348207: Linux PPC64 PCH build broken after JDK-8347909
  • 70eec90: 8338303: Linux ppc64le with toolchain clang - detection failure in early JVM startup
  • a1fd5f4: 8348554: Enhance Linux kernel version checks
  • 002679a: 8347065: Add missing @SPEC tags for Java Security Standard Algorithm Names
  • 99002e4: 8318098: Update jfr tests to replace keyword jfr with vm.flagless
  • 5431668: 8348212: Need to add warn() step to JavacTaskImpl after JDK-8344148
  • 1d2eb2f: 8299504: Resolve uses and provides at run time if the service is optional and missing
  • f446cef: 8343962: [REDO] Move getChars to DecimalDigits
  • 7c0985f: 8348420: Shenandoah: Check is_reserved before using ReservedSpace instances
  • ... and 13 more: https://git.openjdk.org/jdk/compare/4a375e5b8899aa684b8a921e198203e76794f709...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Jan 27, 2025

@TheRealMDoerr Pushed as commit afcc2b0.

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

@TheRealMDoerr TheRealMDoerr deleted the 8348562_ZGC_C2_barrier_node_type_check branch January 27, 2025 10:12
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 hotspot-gc hotspot-gc-dev@openjdk.org integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

3 participants