Skip to content

Fix FFM downcall exception stack frame handling - #24660

Open
babsingh wants to merge 1 commit into
eclipse-openj9:masterfrom
babsingh:main4
Open

Fix FFM downcall exception stack frame handling#24660
babsingh wants to merge 1 commit into
eclipse-openj9:masterfrom
babsingh:main4

Conversation

@babsingh

Copy link
Copy Markdown
Contributor

When an exception is pending after an FFM downcall, avoid executing
the normal JNI return path. That path removes the special stack frame
before exception dispatch, leaving the VM to walk an invalid frame
and potentially crash.

For allocation failures before the native invocation, construct an
internal native stack frame before raising the native OutOfMemoryError
so the stack remains walkable during exception dispatch.

Related: #24654

When an exception is pending after an FFM downcall, avoid executing
the normal JNI return path. That path removes the special stack frame
before exception dispatch, leaving the VM to walk an invalid frame
and potentially crash.

For allocation failures before the native invocation, construct an
internal native stack frame before raising the native OutOfMemoryError
so the stack remains walkable during exception dispatch.

Related: eclipse-openj9#24654

Signed-off-by: Babneet Singh <sbabneet@ca.ibm.com>
@babsingh

Copy link
Copy Markdown
Contributor Author

jenkins test sanity plinux jdk27

@babsingh

Copy link
Copy Markdown
Contributor Author

jenkins test sanity amac jdk21

@babsingh

Copy link
Copy Markdown
Contributor Author

0.62 backport: #24661
0.63 backport: #24662

@tajila Requesting your review

fyi @pshipton

@babsingh
babsingh requested a review from tajila August 28, 2026 17:07
Comment thread runtime/vm/BytecodeInterpreter.hpp
@tajila

tajila commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

jenkins test sanity,extended.functional zlinux jdk27,jdk25

@babsingh

babsingh commented Aug 28, 2026

Copy link
Copy Markdown
Contributor Author

50x TestUpcallStress grinder on pLinux w/ JDK27 passed: https://openj9-jenkins.osuosl.org/job/Grinder/5381

Only a known, unrelated failure is seen in the PR builds:

@babsingh
babsingh marked this pull request as ready for review August 28, 2026 23:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants