Skip to content

8361536: [s390x] Saving return_pc at wrong offset #26209

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

offamitkumar
Copy link
Member

@offamitkumar offamitkumar commented Jul 9, 2025

Fixes the bug where return pc was stored at a wrong offset, which causes issue with java abi.

Issue appeared in #26004, see the comment: #26004 (comment).


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-8361536: [s390x] Saving return_pc at wrong offset (Enhancement - P3)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 26209

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jul 9, 2025

👋 Welcome back amitkumar! 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 Jul 9, 2025

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk openjdk bot changed the title 8361536 8361536: [s390x] Saving return_pc at wrong offset Jul 9, 2025
@openjdk
Copy link

openjdk bot commented Jul 9, 2025

@offamitkumar 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 Jul 9, 2025
Copy link
Contributor

@RealLucy RealLucy left a comment

Choose a reason for hiding this comment

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

LGTM.
Thanks for fixing.

@offamitkumar
Copy link
Member Author

Fast debug build was fine, but release build crashed with this error:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x000003fffd16b19e, pid=281849, tid=281855
#
# JRE version: OpenJDK Runtime Environment (26.0) (build 26-internal-adhoc.amit.jdk)
# Java VM: OpenJDK 64-Bit Server VM (26-internal-adhoc.amit.jdk, mixed mode, tiered, compressed oops, compressed class ptrs, g1 gc, linux-s390x)
# Problematic frame:
# V  [libjvm.so+0x66b19e]  HandleMark::~HandleMark()+0x1e
#
# Core dump will be written. Default location: Core dumps may be processed with "/usr/share/apport/apport -p%p -s%s -c%c -d%d -P%P -u%u -g%g -F%F -- %E" (or dumping to /home/amit/jdk/core.281849)
#
# If you would like to submit a bug report, please visit:
#   https://bugreport.java.com/bugreport/crash.jsp
#

stack trace:

Stack: [0x000003fffc900000,0x000003fffca00000],  sp=0x000003fffc9fca40,  free space=1010k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x66b19e]  HandleMark::~HandleMark()+0x1e  (handles.inline.hpp:88)
V  [libjvm.so+0xc1a038]  Threads::create_vm(JavaVMInitArgs*, bool*)+0x528  (threads.cpp:905)
V  [libjvm.so+0x799e9a]  JNI_CreateJavaVM+0x7a  (jni.cpp:3589)
C  [libjli.so+0x40e0]  JavaMain+0xa0  (java.c:1506)
C  [libjli.so+0x8170]  ThreadJavaMain+0x20  (java_md.c:646)

This commit (e945e04) seems to be faulty.

Copy link
Contributor

@TheRealMDoerr TheRealMDoerr left a comment

Choose a reason for hiding this comment

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

We're not really saving space. We just use less of the caller allocated stack space which is still as large as before.
But the change looks good and should make the stack walking code happy, because it can find the return_pc where it is expected, now.

@offamitkumar offamitkumar marked this pull request as ready for review July 10, 2025 03:12
@openjdk openjdk bot added the rfr Pull request is ready for review label Jul 10, 2025
@mlbridge
Copy link

mlbridge bot commented Jul 10, 2025

Webrevs

@offamitkumar
Copy link
Member Author

@TheRealMDoerr I need reapproval. Can you provide one ? Thanks.

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 rfr Pull request is ready for review
Development

Successfully merging this pull request may close these issues.

3 participants