-
Notifications
You must be signed in to change notification settings - Fork 721
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
Fix "storing the address of local variable" in trcmain.c #20172
base: master
Are you sure you want to change the base?
Conversation
This commit stops storing the address of a local variable, to fix a build error with runtime/rastrace/trcmain.c. Fixes: eclipse-openj9#20171 Signed-off-by: KONNO Kazuhiro <konno@jp.ibm.com>
Jenkins test sanity amac jdk11 |
memset(tempThr, 0, sizeof(UtThreadData)); | ||
initHeader(&(tempThr->header), UT_THREAD_DATA_NAME, sizeof(UtThreadData)); |
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 update the documentation in rastrace_external.h
. It currently says
* @param[out] thr A UtThreadData pointer. *thr can point to NULL, initialize trace will initialize it.
That is not true: if NULL == *thr
, this will fail.
@@ -333,6 +334,7 @@ J9VMDllMain(J9JavaVM *vm, IDATA stage, void *reserved) | |||
* Find UTE thread slot inside VM thread structure | |||
*/ | |||
tempThr = UT_THREAD_FROM_VM_THREAD(vm->mainThread); | |||
*tempThr = &thrData; |
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.
I think some comments (or assertions) would be helpful:
- before line 337
*tempThr
is expected to beNULL
- after the call to
initializeTrace()
*tempThr
is again expected to beNULL
(eliminating the reference tothrData
) - the call to
threadStart()
should allocate storage to which*tempThr
will then point
This commit stops storing the address of a local variable, to fix a build error with runtime/rastrace/trcmain.c.
Fixes: #20171