Skip to content

8371949: Upcall exception handler crashes with bad oop#31151

Open
shipilev wants to merge 1 commit into
openjdk:masterfrom
shipilev:JDK-8371949-upcall-handler
Open

8371949: Upcall exception handler crashes with bad oop#31151
shipilev wants to merge 1 commit into
openjdk:masterfrom
shipilev:JDK-8371949-upcall-handler

Conversation

@shipilev
Copy link
Copy Markdown
Member

@shipilev shipilev commented May 13, 2026

I have a local reproducer for JDK-8360595, and I only now understood why it crashed badly, without producing a proper error. Because with checked oops, oop is really a wrapper class, not a pointer. We are actually passing unwrapped oopDesc* from Java/stub code. All of our other entry points declare oopDesc*, this one should do the same.

I also extended the platform filter for the test, so reproducer can work on my x86 machines, and it now crashes more reliably:

$  CONF=linux-x86_64-server-fastdebug make images test TEST=java/foreign/TestUpcallStress.java TEST_VM_OPTS="-XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC -XX:-ExitOnOutOfMemoryError"
...
[12:37:47.635] test TestUpcallStress.testUpcallsStress(663, "f1_V_SD_DID", VOID, [STRUCT, DOUBLE], [DOUBLE, INT, DOUBLE]): success [25ms]
Uncaught exception:
java.lang.OutOfMemoryError: Java heap space
<<no stack trace available>>

Additional testing:

  • Linux x86_64 server fastdebug, reproducer no longer cryptically


Progress

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

Issue

  • JDK-8371949: Upcall exception handler crashes with bad oop (Bug - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 31151

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link
Copy Markdown

bridgekeeper Bot commented May 13, 2026

👋 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
Copy link
Copy Markdown

openjdk Bot commented May 13, 2026

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

8371949: Upcall exception handler crashes with bad oop

Reviewed-by: jvernee, dholmes

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 9 new commits pushed to the master 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.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk Bot added hotspot hotspot-dev@openjdk.org core-libs core-libs-dev@openjdk.org labels May 13, 2026
@openjdk
Copy link
Copy Markdown

openjdk Bot commented May 13, 2026

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

  • core-libs
  • hotspot

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command.

@openjdk
Copy link
Copy Markdown

openjdk Bot commented May 13, 2026

The total number of required reviews for this PR has been set to 2 based on the presence of this label: hotspot. This can be overridden with the /reviewers command.

@openjdk openjdk Bot added the rfr Pull request is ready for review label May 13, 2026
@mlbridge
Copy link
Copy Markdown

mlbridge Bot commented May 13, 2026

Webrevs

@dholmes-ora
Copy link
Copy Markdown
Member

We pass oop parameters to lots of C++ methods. ??

@shipilev
Copy link
Copy Markdown
Member Author

shipilev commented May 13, 2026

We pass oop parameters to lots of C++ methods. ??

"Pass" is too strong of the word. The actual problem is declaring oop in C++ method signature that is called from Java/stubs. oop is a wrapper, so you need to declare oopDesc*. This is what we do everywhere else.

Copy link
Copy Markdown
Member

@JornVernee JornVernee 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 finding and fixing the issue. I've started a CI job to check if the test passes there on the new platforms as well. (From what I remember it had some stability issues on certain platforms)

Copy link
Copy Markdown
Member

@JornVernee JornVernee left a comment

Choose a reason for hiding this comment

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

All good from my end.

@dholmes-ora
Copy link
Copy Markdown
Member

The actual problem is declaring oop in C++ method signature that is called from Java/stubs. oop is a wrapper, so you need to declare oopDesc*. This is what we do everywhere else.

Interesting limitation that I was not aware of. Not sure how to spot the places where this is necessary.

@openjdk openjdk Bot added the ready Pull request is ready to be integrated label May 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core-libs core-libs-dev@openjdk.org hotspot hotspot-dev@openjdk.org 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