Fix not to create unnecessary thread_params#76007
Conversation
|
4ff1b83 to
2df4a9d
Compare
|
/azp run runtime |
|
Commenter does not have sufficient privileges for PR 76007 in repo dotnet/runtime |
2df4a9d to
6609181
Compare
|
@HJLeee unfortunately the azp commands do not work without write access. You can rerun checks by closing and reopening or pushing an empty commit. Of course if you just want to rerun one pipeline it’s more efficient to do that but at the moment you have to ask someone with commit access to do it 😕 |
|
Thank you for the tip. |
|
@jkotas Please take a look. |
|
|
||
| if (id) | ||
| { | ||
| *reinterpret_cast<DWORD *>(id) = thread_params->thread_params.thread->GetThreadId (); |
There was a problem hiding this comment.
thread_params can be freed by the newly started thread by this point. The thread id should be captured e.g. before the thread is started.
| } | ||
| else if (thread_type == EP_THREAD_TYPE_SESSION || thread_type == EP_THREAD_TYPE_SAMPLING) | ||
| { | ||
| rt_coreclr_thread_params_internal_t *thread_params = new (nothrow) rt_coreclr_thread_params_internal_t (); |
There was a problem hiding this comment.
thread_params is still going to leak when the thread fails to start (CreateNewThread fails).
In case of
EP_THREAD_TYPE_SERVER, thread_param is a leak in the original code.