Skip to content

Conversation

@Arraying
Copy link
Member

@Arraying Arraying commented Nov 20, 2025

Hi all,

This patch fixes several int overflows relating to flat array element loads/stores.
I've included some gtests that address a subset of these changes. We should test flat arrays larger than 16GB in size, which is not something we can feasibly do in our tier1 jtreg tests. I've filed JDK-8372261 as a follow-up RFE to investigate this.

Testing: tiers 1-4, LocalityCheck.java run locally 100 times.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed (1 review required, with at least 1 Committer)

Issue

  • JDK-8371604: [lworld] SIGSEGV in InlineKlass::is_payload_marked_as_null (Bug - P2)

Reviewers

Contributors

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 1752

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/valhalla/pull/1752.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Nov 20, 2025

👋 Welcome back phubner! A progress list of the required criteria for merging this PR into lworld 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 Nov 20, 2025

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

8371604: [lworld] SIGSEGV in InlineKlass::is_payload_marked_as_null

Co-authored-by: Frederic Parain <[email protected]>
Reviewed-by: coleenp

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 143 new commits pushed to the lworld branch:

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 (@coleenp) 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 changed the title 8371604 8371604: [lworld] SIGSEGV in InlineKlass::is_payload_marked_as_null Nov 20, 2025
@Arraying Arraying marked this pull request as ready for review November 20, 2025 14:42
@Arraying
Copy link
Member Author

The Skara bot seems to be malfunctioning.
/touch

@openjdk openjdk bot added the rfr Pull request is ready for review label Nov 20, 2025
@openjdk
Copy link

openjdk bot commented Nov 20, 2025

@Arraying The pull request is being re-evaluated and the inactivity timeout has been reset.

@mlbridge
Copy link

mlbridge bot commented Nov 20, 2025

Webrevs

@fparain
Copy link
Collaborator

fparain commented Nov 20, 2025

There's another occurance of this int overflow with the _offset field in DelayedFieldAccess (c1_GraphBuilder.hpp).

@Arraying
Copy link
Member Author

There's another occurance of this int overflow with the _offset field in DelayedFieldAccess (c1_GraphBuilder.hpp).

Good catch, thanks. This _offset is used in JVMCI as an int, so I'll update it there as well.

@fparain
Copy link
Collaborator

fparain commented Nov 21, 2025

Correction, the possible overflow is in DelayedLoadIndexed, not DelayedFieldAccess, thank you Paul for figuring this out.

@Arraying
Copy link
Member Author

Thanks also to Tobias and Coleen for helping troubleshoot.
/contributor add fparain

@openjdk
Copy link

openjdk bot commented Nov 21, 2025

@Arraying
Contributor Frederic Parain <[email protected]> successfully added.

Copy link
Contributor

@coleenp coleenp left a comment

Choose a reason for hiding this comment

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

This looks good. Did you have a jvmci change still?

assert(is_within_bounds(index), "index out of bounds");

address addr = (address) base();
addr += (index << Klass::layout_helper_log2_element_size(lh));
Copy link
Contributor

Choose a reason for hiding this comment

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

Because index is an int, this could go negative right?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Nov 21, 2025
@Arraying
Copy link
Member Author

This looks good. Did you have a jvmci change still?

Nope, I shouldn't need to change ciField anymore as far as I can tell, and Fred agrees. But thanks for being vigilant!

@Arraying
Copy link
Member Author

I added a regression test, it doesn't actually take very long to run (I was mostly running slowdebug so I was under the impression it was much slower than it actually is) and the memory could be constrained by jtreg. Convenient.

I still think that even with this test, JDK-8372261 applies and should be investigated further.

Copy link
Contributor

@coleenp coleenp left a comment

Choose a reason for hiding this comment

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

The test looks good! I'm glad you could add it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready Pull request is ready to be integrated rfr Pull request is ready for review

Development

Successfully merging this pull request may close these issues.

3 participants