Skip to content

8347718: Unexpected NullPointerException in C2 compiled code due to ReduceAllocationMerges #23312

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

Closed
wants to merge 2 commits into from

Conversation

JohnTortugo
Copy link
Contributor

@JohnTortugo JohnTortugo commented Jan 27, 2025

Please, review this patch to fix an issue in reducing allocation merges used by Cmp nodes. The attached test case, adapted from the one attached to the JBS issue, can be used to reproduce the issue. The root of the problem was not properly checking the return value of optimize_ptr_compare against different Cmp mask predicates.

I tested this on OSX(ARM64) & Linux(Intel) tier1-4.


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-8347718: Unexpected NullPointerException in C2 compiled code due to ReduceAllocationMerges (Bug - P3)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 23312

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jan 27, 2025

👋 Welcome back cslucas! 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 27, 2025

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

8347718: Unexpected NullPointerException in C2 compiled code due to ReduceAllocationMerges

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

  • a224f12: 8348205: Improve cutover time selection when building available currencies set
  • 8103256: 8348348: Remove unnecessary #ifdef STATIC_BUILD around DEF_STATIC_JNI_OnLoad from zip_util.c
  • fb066ca: 8347272: [ubsan] JvmLauncher.cpp:262:52: runtime error: applying non-zero offset 40 to null pointer
  • 5fec999: 8339668: Parallel: Adopt PartialArrayState to consolidate marking stack in Full GC
  • 2bef5b4: 8348323: Corrupted timezone string in JVM crash log
  • 3a8680e: 8347058: When automatically translating the page to pt-br, all CSS styling disappears
  • a4942a2: 8348286: [AIX] clang 17 introduces new warning Wtentative-Definitions which produces Build errors
  • 558255a: 8328919: Add BodyHandlers / BodySubscribers methods to handle excessive server input
  • 1f74caa: 8348401: [IR Framework] PrintTimes should not require verbose
  • f71541c: 8344976: Remove the jmx.invoke.getters compatibility property
  • ... and 47 more: https://git.openjdk.org/jdk/compare/356e2a8f48679ea31f1483cf60803818934fc53f...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 (@dafedafe, @vnkozlov, @TobiHartmann) 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 rfr Pull request is ready for review label Jan 27, 2025
@openjdk
Copy link

openjdk bot commented Jan 27, 2025

@JohnTortugo 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 Jan 27, 2025
@mlbridge
Copy link

mlbridge bot commented Jan 27, 2025

Webrevs

Copy link
Contributor

@dafedafe dafedafe 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 fix @JohnTortugo.

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.

Tentatively approved. Need run our testing before final approval.

@vnkozlov
Copy link
Contributor

I submitted new testing.

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.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Jan 28, 2025
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.

My testing passed.

@JohnTortugo
Copy link
Contributor Author

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Jan 28, 2025
@openjdk
Copy link

openjdk bot commented Jan 28, 2025

@JohnTortugo
Your change (at version 4205247) is now ready to be sponsored by a Committer.

@vnkozlov
Copy link
Contributor

/sponsor

@openjdk
Copy link

openjdk bot commented Jan 28, 2025

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

  • a224f12: 8348205: Improve cutover time selection when building available currencies set
  • 8103256: 8348348: Remove unnecessary #ifdef STATIC_BUILD around DEF_STATIC_JNI_OnLoad from zip_util.c
  • fb066ca: 8347272: [ubsan] JvmLauncher.cpp:262:52: runtime error: applying non-zero offset 40 to null pointer
  • 5fec999: 8339668: Parallel: Adopt PartialArrayState to consolidate marking stack in Full GC
  • 2bef5b4: 8348323: Corrupted timezone string in JVM crash log
  • 3a8680e: 8347058: When automatically translating the page to pt-br, all CSS styling disappears
  • a4942a2: 8348286: [AIX] clang 17 introduces new warning Wtentative-Definitions which produces Build errors
  • 558255a: 8328919: Add BodyHandlers / BodySubscribers methods to handle excessive server input
  • 1f74caa: 8348401: [IR Framework] PrintTimes should not require verbose
  • f71541c: 8344976: Remove the jmx.invoke.getters compatibility property
  • ... and 47 more: https://git.openjdk.org/jdk/compare/356e2a8f48679ea31f1483cf60803818934fc53f...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Jan 28, 2025

@vnkozlov @JohnTortugo Pushed as commit 9f4d3de.

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

@JohnTortugo JohnTortugo deleted the ram-npe-fix branch March 31, 2025 22:36
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