Skip to content
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

Uninit reads in NtCreateThreadEx #360

Closed
derekbruening opened this issue Nov 28, 2014 · 4 comments
Closed

Uninit reads in NtCreateThreadEx #360

derekbruening opened this issue Nov 28, 2014 · 4 comments

Comments

@derekbruening
Copy link
Contributor

From timurrrr@google.com on April 26, 2011 05:04:30

#include <windows.h>
#include <stdio.h>

#define CHECK(x) (x)

void CALLBACK DoneWaiting(void param, BOOLEAN timed_out) {
int *i = (int
)param;
(*i)++;
}

int main() {
int counter = 0;
HANDLE wait_object = NULL;
HANDLE object = ::CreateEvent(NULL, false, false, NULL);
printf("object = %p\n", object);
CHECK(0 != ::RegisterWaitForSingleObject(&wait_object, object,
DoneWaiting, &counter, INFINITE,
WT_EXECUTEINWAITTHREAD | WT_EXECUTEONLYONCE));
SetEvent(object);
Sleep(1000);
CHECK(0 != ::UnregisterWaitEx(wait_object, INVALID_HANDLE_VALUE));
CHECK(counter == 1);
CloseHandle(object);
return 0;
}

Error #1: UNINITIALIZED READ: reading 0x0018fd08-0x0018fd18 16 byte(s) within 0x0018fcf4-0x0018fd18
@0:00:00.694 in thread 4340
system call NtCreateThreadEx

0x777d7963 <ntdll.dll+0x57963> ntdll.dll!TpDisablePoolCallbackChecks
??:0
0x777d789f <ntdll.dll+0x5789f> ntdll.dll!TpDisablePoolCallbackChecks
??:0
0x777d1ca9 <ntdll.dll+0x51ca9> ntdll.dll!TpSetWait
??:0
0x777ed119 <ntdll.dll+0x6d119> ntdll.dll!TpAllocWait
??:0
0x777ef5c4 <ntdll.dll+0x6f5c4> ntdll.dll!RtlRegisterWait
??:0
0x755fbcdc <KERNEL32.dll+0x3bcdc> KERNEL32.dll!RegisterWaitForSingleObject
??:0
0x00401091 <threads_win.exe+0x1091> threads_win.exe!main
c:\cygwin\home\timurrrr\drmemory\stability_tests\threads_win.cpp:18
0x004013bf <threads_win.exe+0x13bf> threads_win.exe!__tmainCRTStartup
f:\dd\vctools\crt_bld\self_x86\crt\src\crt0.c:266
0x755d3677 <KERNEL32.dll+0x13677> KERNEL32.dll!BaseThreadInitThunk
??:0
0x777b9f02 <ntdll.dll+0x39f02> ntdll.dll!RtlInitializeExceptionChain
??:0
0x777b9ed5 <ntdll.dll+0x39ed5> ntdll.dll!RtlInitializeExceptionChain
??:0

Original issue: http://code.google.com/p/drmemory/issues/detail?id=360

@derekbruening
Copy link
Contributor Author

From timurrrr@google.com on April 26, 2011 07:08:46

FTR, this is Win7.
On XP, it is clean.

@derekbruening
Copy link
Contributor Author

From timurrrr@google.com on April 26, 2011 07:55:43

Labels: -OpSys-Windows OpSys-Win7

@derekbruening
Copy link
Contributor Author

From timurrrr@google.com on April 27, 2011 03:53:37

Should be fixed by http://codereview.appspot.com/4439076/

Status: Started

@derekbruening
Copy link
Contributor Author

From timurrrr@google.com on May 05, 2011 05:04:15

Status: Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant