In long-running builds we've seen some ASan complaints during thread creation that we suspect are due to leftover poisoning from previous threads whose stacks occupied that memory. This patch adds a hook that unpoisons the stack just before the NtTerminateThread syscall.
Details
Details
- Reviewers
rnk - Commits
- rG6d6c9150f935: Reland r342652 "[winasan] Unpoison the stack in NtTerminateThread"
rG468f53b58c62: [winasan] Unpoison the stack in NtTerminateThread
rCRT343606: Reland r342652 "[winasan] Unpoison the stack in NtTerminateThread"
rL343606: Reland r342652 "[winasan] Unpoison the stack in NtTerminateThread"
rL342652: [winasan] Unpoison the stack in NtTerminateThread
rCRT342652: [winasan] Unpoison the stack in NtTerminateThread
Diff Detail
Diff Detail
Event Timeline
Comment Actions
This appears to have caused the thread exit code to get clobbered, as shown by some Chromium test failures: https://bugs.chromium.org/p/chromium/issues/detail?id=890310
I've reverted in r343322.
Comment Actions
I think NtTerminateThread has a richer prototype:
NTEXPORT NTSTATUS NTAPI
NtTerminateThread(IN HANDLE ThreadHandle OPTIONAL, IN NTSTATUS ExitStatus)
https://github.com/DynamoRIO/dynamorio/blob/f1713ec4a9a856d1038c6095da67a5bd95b6a1c7/core/win32/ntdll_imports.c#L154
http://codewarrior.cn/ntdoc/win2k/ps/NtTerminateThread.htm
It should be fine to recommit with a better prototype.