DynamoRIO / DynamoRIO/drmemory

False reports on CreateWindow

Open
#17 13 comments 0 reactions 0 assignees View on GitHub
Bug-FalsePositive Migrated OpSys-Windows Priority-Medium
Dominant language
C
Stars
2.7k
Forks
290
PR merge metrics
No merged PRs in 30d

Description

_From [timurrrr@google.com](https://code.google.com/u/timurrrr@google.com/) on July 27, 2010 11:19:22_

On Windows XP ( r378 / r24 ), the following code
#

#include
#include
#include
#pragma comment(lib, "user32.lib")

#define kWndClass "Test wnd class name"

LRESULT CALLBACK WndProcThunk(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam) {
return DefWindowProc(hwnd, message, wparam, lparam);
}

int main() {
HWND hwnd = NULL;
HINSTANCE hinst = GetModuleHandle(NULL);

WNDCLASSEX wc = {0};
wc.cbSize = sizeof(wc);
wc.lpfnWndProc = WndProcThunk;
wc.hInstance = hinst;
wc.lpszClassName = kWndClass;
RegisterClassEx(&wc);

hwnd = CreateWindow(kWndClass, 0, 0, 0, 0, 0, 0, HWND_MESSAGE, 0, hinst, 0);
assert(hwnd);
DestroyWindow(hwnd);
UnregisterClass(kWndClass, GetModuleHandle(NULL));
}
#

Gives 7 error reports (attached).

Example:
Error `#4`: UNADDRESSABLE ACCESS: reading 0x0012f4c8-0x0012f4c9 1 byte(s) within 0x0012f4c8-0x0012f4cc
@0:00:03.750 in thread 2276
0x7e4184ce USER32.dll!?
??:0
0x5ad746f6 UxTheme.dll!GetThemeColor
??:0
0x5ad74693 UxTheme.dll!GetThemeColor
??:0
0x5ad7a63e UxTheme.dll!IsThemePartDefined
??:0
0x5ad7985d UxTheme.dll!IsThemeActive
??:0
0x5ad7960a UxTheme.dll!IsThemeActive
??:0
0x5ad7ad7b UxTheme.dll!Ordinal25
??:0
0x7e427f06 USER32.dll!SetProcessWindowStation
??:0
0x7e428069 USER32.dll!GetGUIThreadInfo
??:0
0x7c90e473 ntdll.dll!KiUserCallbackDispatcher
??:0
0x7e42e442 USER32.dll!GetScrollInfo
??:0
0x7e42e4dc USER32.dll!CreateWindowExA
??:0
0x004010b7 test.exe!main
Z:\dr-sandbox\issues\new\test.c:23
0x00401c70 test.exe!__tmainCRTStartup
f:\dd\vctools\crt_bld\self_x86\crt\src\crt0.c:327
0x7c817077 KERNEL32.dll!RegisterWaitForInputIdle
??:0

**Attachment:** [results.txt](http://code.google.com/p/drmemory/issues/detail?id=17)

_Original issue: http://code.google.com/p/drmemory/issues/detail?id=17_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.