http://llvm.org/bugs/show_bug.cgi?id=22025
Bug ID: 22025
Summary: [ASan/Win] Creating a suspended thread leads to a
deadlock
Product: compiler-rt
Version: unspecified
Hardware: PC
OS: Windows NT
Status: NEW
Severity: normal
Priority: P
Component: compiler-rt
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Classification: Unclassified
Example code:
--------------------
#include <windows.h>
DWORD WINAPI thread_proc(void *) {
volatile char stack_buffer[42];
for (int i = 0; i < sizeof(stack_buffer); ++i)
stack_buffer[i] = 42;
return 0x42;
}
int main() {
DWORD exitcode;
HANDLE thr = CreateThread(NULL, 0, thread_proc, NULL, CREATE_SUSPENDED,
NULL);
ResumeThread(thr);
if (thr == 0)
return 1;
if (WAIT_OBJECT_0 != WaitForSingleObject(thr, INFINITE))
return 2;
GetExitCodeThread(thr, &exitcode);
if (exitcode != 0x42)
return 3;
CloseHandle(thr);
}
--------------------
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs