Skip to content

(0.55) Avoid crash in fillInStackTrace when threadObject is null - #22405

Merged
pshipton merged 1 commit into
eclipse-openj9:v0.55.0-releasefrom
babsingh:v0.55.0-release
Aug 8, 2025
Merged

(0.55) Avoid crash in fillInStackTrace when threadObject is null#22405
pshipton merged 1 commit into
eclipse-openj9:v0.55.0-releasefrom
babsingh:v0.55.0-release

Conversation

@babsingh

@babsingh babsingh commented Aug 8, 2025

Copy link
Copy Markdown
Contributor

Add a null check for _currentThread->threadObject in
inlThrowableFillInStackTrace to prevent a crash during early JVM
startup.

When J9_EXTENDED_RUNTIME2_SHOW_CARRIER_FRAMES is enabled,
continuation stack walking is triggered to collect carrier frames. This requires
a valid threadObject, which may be uninitialized during early exceptions
(e.g., during Unsafe.registerNatives). Without the check, a null
dereference can occur when calling IS_JAVA_LANG_VIRTUALTHREAD.

This fix ensures stack walking is only attempted when threadObject is
set, preventing segmentation faults during JVM initialization.

Related: #21734

Backport of #22382

Add a null check for _currentThread->threadObject in
inlThrowableFillInStackTrace to prevent a crash during early JVM
startup.

When J9_EXTENDED_RUNTIME2_SHOW_CARRIER_FRAMES is enabled, continuation
stack walking is triggered to collect carrier frames. This requires a
valid threadObject, which may be uninitialized during early exceptions
(e.g., during Unsafe.registerNatives). Without the check, a null
dereference can occur when calling IS_JAVA_LANG_VIRTUALTHREAD.

This fix ensures stack walking is only attempted when threadObject is
set, preventing segmentation faults during JVM initialization.

Related: eclipse-openj9#21734

Signed-off-by: Babneet Singh <sbabneet@ca.ibm.com>
@pshipton
pshipton merged commit 90d4f18 into eclipse-openj9:v0.55.0-release Aug 8, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants