-
Notifications
You must be signed in to change notification settings - Fork 720
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
Correctly initialize walkState values when calling walkStackFrames #18967
Conversation
After a thread's stackWalkState is used, we don't reset the fields to 0 but expects future code uses to set the parameters to the expected value before calling walkStackFrames. This change fixes walkWrapperImpl where userData1 is not properly set. Signed-off-by: Jack Lu <[email protected]>
Personal build, build failures due to network issue, sanity.functional test failure is unrelated. @keithc-ca can you please take a look at this. |
@@ -146,6 +147,8 @@ Java_java_lang_StackWalker_walkWrapperImpl(JNIEnv *env, jclass clazz, jint flags | |||
if (NULL == walkerMethodChars) { /* native out of memory exception pending */ | |||
return NULL; | |||
} | |||
/* Ensure userData1/2 used by stackFrameFilter function is set properly. */ | |||
walkState->userData1 = NULL; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please explain why this is appropriate. Should line 156 not be here instead?
walkState->userData1 = (void *)(UDATA)flags;
Same question for continuations (lines 216-220).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right, I placed the NULL to avoid conflict with getCallerClass call, but given #18868 is already merged, it should be fine to move the assignment earlier.
I will update the PR and run local testing before asking for another round of review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
local testing passed, @keithc-ca can you please take another look
Signed-off-by: Jack Lu <[email protected]>
Jenkins test sanity alinux jdk17,jdk22 |
Exclude test ( |
The most recent personal build is here. |
There was one CRIU test failure which seems unrelated to this change. |
After a thread's stackWalkState is used, we don't reset the fields to 0 but expects future code uses to set the parameters to the expected value before calling walkStackFrames.
This change fixes walkWrapperImpl where userData1 is not properly set.
Fixes: #18696
Fixes: #18961