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

[False?] leak reports on MessageBox #60

Open
derekbruening opened this issue Nov 28, 2014 · 8 comments
Open

[False?] leak reports on MessageBox #60

derekbruening opened this issue Nov 28, 2014 · 8 comments

Comments

@derekbruening
Copy link
Contributor

From timurrrr@google.com on September 29, 2010 11:39:12

As of r57 , the following code:
===test.c===
#include <windows.h>

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

int main(void) {
MessageBox(NULL, "Test", "Caption", MB_OK);
return 0;
}

(compiled with "cl /Zi /MTd")
gives 63 uninits + 1 unaddr reports like:

Error #1: UNINITIALIZED READ: reading 0x0012f9e4-0x0012f9e5 1 byte(s)
@0:00:02.141 in thread 3664
0x74dcabc3 <USP10.dll+0x3abc3> USP10.dll!UspFreeMem
??:0
0x74da49cd <USP10.dll+0x149cd> USP10.dll!ScriptIsComplex
??:0
0x629c32bf <LPK.dll+0x32bf> LPK.dll!LpkGetTextExtentExPoint
??:0
0x77f175f9 <GDI32.dll+0x75f9> GDI32.dll!CreateCompatibleBitmap
??:0
0x77f16b25 <GDI32.dll+0x6b25> GDI32.dll!GetTextExtentPointW
??:0
0x7e43a462 <USER32.dll+0x2a462> USER32.dll!SoftModalMessageBox
??:0
0x7e43a2bc <USER32.dll+0x2a2bc> USER32.dll!MessageBoxIndirectA
??:0
0x7e4663fd <USER32.dll+0x563fd> USER32.dll!MessageBoxTimeoutW
??:0
0x7e4664a2 <USER32.dll+0x564a2> USER32.dll!MessageBoxTimeoutA
??:0
0x7e450877 <USER32.dll+0x40877> USER32.dll!MessageBoxExA
??:0
0x7e45082f <USER32.dll+0x4082f> USER32.dll!MessageBoxA
??:0
0x00401027 <test.exe+0x1027> test.exe!main
z:\dr-sandbox\issues\msgbox\test.c:6

...

Error #9: UNINITIALIZED READ: reading register cx
@0:00:02.798 in thread 3664
0x7c80aa24 <KERNEL32.dll+0xaa24> KERNEL32.dll!GetLocalTime
??:0
0x7c80aa8c <KERNEL32.dll+0xaa8c> KERNEL32.dll!lstrcmpW
??:0
0x74da74db <USP10.dll+0x174db> USP10.dll!ScriptApplyDigitSubstitution
??:0
0x74da75e2 <USP10.dll+0x175e2> USP10.dll!ScriptApplyDigitSubstitution
??:0
0x74da82ea <USP10.dll+0x182ea> USP10.dll!ScriptApplyDigitSubstitution
??:0
0x74da506a <USP10.dll+0x1506a> USP10.dll!ScriptApplyDigitSubstitution
??:0
0x74da581a <USP10.dll+0x1581a> USP10.dll!ScriptApplyDigitSubstitution
??:0
0x74da5a8e <USP10.dll+0x15a8e> USP10.dll!ScriptApplyDigitSubstitution
??:0
0x74da5ea3 <USP10.dll+0x15ea3> USP10.dll!ScriptApplyDigitSubstitution
??:0
0x74da5f8b <USP10.dll+0x15f8b> USP10.dll!ScriptApplyDigitSubstitution
??:0
0x74da4186 <USP10.dll+0x14186> USP10.dll!ScriptStringAnalyse
??:0
0x629c48f8 <LPK.dll+0x48f8> LPK.dll!LpkTabbedTextOut
??:0
0x629c4651 <LPK.dll+0x4651> LPK.dll!LpkTabbedTextOut
??:0
0x629c1269 <LPK.dll+0x1269> LPK.dll!LpkDrawTextEx
??:0
0x7e44e667 <USER32.dll+0x3e667> USER32.dll!DeregisterShellHookWindow
??:0
0x7e42bae3 <USER32.dll+0x1bae3> USER32.dll!DrawTextExW
??:0
0x7e42b5a1 <USER32.dll+0x1b5a1> USER32.dll!DrawTextExW
??:0
0x7e42b433 <USER32.dll+0x1b433> USER32.dll!DrawTextExW
??:0
0x7e43a566 <USER32.dll+0x2a566> USER32.dll!SoftModalMessageBox
??:0
0x7e43a2bc <USER32.dll+0x2a2bc> USER32.dll!MessageBoxIndirectA
??:0

...

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

@derekbruening
Copy link
Contributor Author

From bruen...@google.com on July 14, 2011 07:32:30

Issue 426 has been merged into this issue.

@derekbruening
Copy link
Contributor Author

From bruen...@google.com on July 14, 2011 12:39:46

1st UNINIT is issue #492

@derekbruening
Copy link
Contributor Author

From bruen...@google.com on July 15, 2011 12:32:31

all uninits are gone after issue #96 and issue #484 leaving open for leaks:

Error #1: POSSIBLE LEAK 24 direct bytes 0x00318e10-0x00318e28 + 0 indirect bytes
0x753ef493 <ole32.dll+0x3f493> ole32.dll!PrivHeapAlloc
0x753ef0ce <ole32.dll+0x3f0ce> ole32.dll!LockEntry::operator new
0x753ef10d <ole32.dll+0x3f10d> ole32.dll!EventPoolEntry::CreatePoolEntry
0x753eff7a <ole32.dll+0x3ff7a> ole32.dll!EventPoolEntry::PrimeEventPool
0x753efe5a <ole32.dll+0x3fe5a> ole32.dll!DllMain
0x753fb944 <ole32.dll+0x4b944> ole32.dll!_initterm_e
0x77359930 <ntdll.dll+0x39930> ntdll.dll!LdrpCallInitRoutine
0x7735d8a9 <ntdll.dll+0x3d8a9> ntdll.dll!LdrpRunInitializeRoutines
0x7735d76c <ntdll.dll+0x3d76c> ntdll.dll!LdrpLoadDll
0x7735c4b5 <ntdll.dll+0x3c4b5> ntdll.dll!LdrLoadDll
0x76462288 <KERNELBASE.dll+0x12288> KERNELBASE.dll!LoadLibraryExW
0x767d490c <KERNEL32.dll+0x1490c> KERNEL32.dll!LoadLibraryW

Error #2: POSSIBLE LEAK 24 direct bytes 0x00318e40-0x00318e58 + 0 indirect bytes
0x753ef0ce <ole32.dll+0x3f0ce> ole32.dll!LockEntry::operator new
0x753ef10d <ole32.dll+0x3f10d> ole32.dll!EventPoolEntry::CreatePoolEntry
0x753eff7a <ole32.dll+0x3ff7a> ole32.dll!EventPoolEntry::PrimeEventPool
0x753efe5a <ole32.dll+0x3fe5a> ole32.dll!DllMain
0x753fb944 <ole32.dll+0x4b944> ole32.dll!_initterm_e
0x77359930 <ntdll.dll+0x39930> ntdll.dll!LdrpCallInitRoutine
0x7735d8a9 <ntdll.dll+0x3d8a9> ntdll.dll!LdrpRunInitializeRoutines
0x7735d76c <ntdll.dll+0x3d76c> ntdll.dll!LdrpLoadDll
0x7735c4b5 <ntdll.dll+0x3c4b5> ntdll.dll!LdrLoadDll
0x76462288 <KERNELBASE.dll+0x12288> KERNELBASE.dll!LoadLibraryExW
0x767d490c <KERNEL32.dll+0x1490c> KERNEL32.dll!LoadLibraryW
0x74ef2691 <IMM32.dll+0x12691> IMM32.dll!GetFn

Error #3: POSSIBLE LEAK 80 direct bytes 0x00311830-0x00311880 + 688 indirect bytes
0x763d5e29 <GDI32.dll+0x15e29> GDI32.dll!plfCreateLOCALFONT
0x763d5bb0 <GDI32.dll+0x15bb0> GDI32.dll!CreateFontIndirectExW
0x763d5c63 <GDI32.dll+0x15c63> GDI32.dll!CreateFontIndirectW
0x7524cf63 <USP10.dll+0xcf63> USP10.dll!CacheFontLinkingData
0x7524d131 <USP10.dll+0xd131> USP10.dll!IsFontRegLinked
0x7524d48c <USP10.dll+0xd48c> USP10.dll!LoadFont
0x75249317 <USP10.dll+0x9317> USP10.dll!FindOrCreateFaceCache
0x75249630 <USP10.dll+0x9630> USP10.dll!FindOrCreateSizeCacheWithoutRealizationID
0x752499bb <USP10.dll+0x99bb> USP10.dll!FindOrCreateSizeCacheUsingRealizationID
0x7524a528 <USP10.dll+0xa528> USP10.dll!UpdateCache
0x7524a692 <USP10.dll+0xa692> USP10.dll!ScriptCheckCache
0x75247928 <USP10.dll+0x7928> USP10.dll!ScriptStringAnalyse

Error #4: LEAK 264 direct bytes 0x00319fa8-0x0031a0b0 + 0 indirect bytes
0x753f0739 <ole32.dll+0x40739> ole32.dll!LockEntry::ThreadInit
0x753f08e5 <ole32.dll+0x408e5> ole32.dll!CRWLock::ThreadInit
0x753f080b <ole32.dll+0x4080b> ole32.dll!COleTls::TLSAllocData
0x74ef2bd8 <IMM32.dll+0x12bd8> IMM32.dll!CtfImmCoInitialize
0x74ef295b <IMM32.dll+0x1295b> IMM32.dll!InternalImmLockIMC
0x74ef1e8c <IMM32.dll+0x11e8c> IMM32.dll!ImmLockIMC
0x74ef34ae <IMM32.dll+0x134ae> IMM32.dll!ImmSetActiveContext
0x76d0d9e7 <USER32.dll+0x1d9e7> USER32.dll!FocusSetIMCContext
0x76d0adf9 <USER32.dll+0x1adf9> USER32.dll!ImeSystemHandler
0x76d075b8 <USER32.dll+0x175b8> USER32.dll!ImeWndProcWorker
0x76d075ed <USER32.dll+0x175ed> USER32.dll!ImeWndProcW
0x76d062fa <USER32.dll+0x162fa> USER32.dll!InternalCallWinProc

Error #5: POSSIBLE LEAK 24 direct bytes 0x0031a0c8-0x0031a0e0 + 0 indirect bytes
0x753ef0ce <ole32.dll+0x3f0ce> ole32.dll!LockEntry::operator new
0x753ef10d <ole32.dll+0x3f10d> ole32.dll!EventPoolEntry::CreatePoolEntry
0x753f0e77 <ole32.dll+0x40e77> ole32.dll!EventPoolEntry::ThreadInit
0x753f08f4 <ole32.dll+0x408f4> ole32.dll!CRWLock::ThreadInit
0x753f080b <ole32.dll+0x4080b> ole32.dll!COleTls::TLSAllocData
0x74ef2bd8 <IMM32.dll+0x12bd8> IMM32.dll!CtfImmCoInitialize
0x74ef295b <IMM32.dll+0x1295b> IMM32.dll!InternalImmLockIMC
0x74ef1e8c <IMM32.dll+0x11e8c> IMM32.dll!ImmLockIMC
0x74ef34ae <IMM32.dll+0x134ae> IMM32.dll!ImmSetActiveContext
0x76d0d9e7 <USER32.dll+0x1d9e7> USER32.dll!FocusSetIMCContext
0x76d0adf9 <USER32.dll+0x1adf9> USER32.dll!ImeSystemHandler
0x76d075b8 <USER32.dll+0x175b8> USER32.dll!ImeWndProcWorker

Summary: False leak reports on MessageBox

@derekbruening
Copy link
Contributor Author

From timurrrr@google.com on July 21, 2011 05:35:04

I disagree, I still see a dozen of uninits and one UNADDDRs on this test as of r405 including these ones:
[XP32 with symbols]
Error #1: UNINITIALIZED READ: reading 0x00347358-0x0034735c 4 byte(s)
@0:00:01.376 in thread 3536
0x74da6576 <USP10.dll+0x16576> USP10.dll!LoadGlyphMetrics
0x74da66d7 <USP10.dll+0x166d7> USP10.dll!GetGlyphAdvanceWidths
0x74da59be <USP10.dll+0x159be> USP10.dll!FindOrCreateSizeCacheWithoutRealizationID
0x74da5a8e <USP10.dll+0x15a8e> USP10.dll!FindOrCreateSizeCacheUsingRealizationID
0x74da5ea3 <USP10.dll+0x15ea3> USP10.dll!UpdateCache
0x74da5f8b <USP10.dll+0x15f8b> USP10.dll!ScriptCheckCache
0x74da4186 <USP10.dll+0x14186> USP10.dll!ScriptStringAnalyse
0x629c48f8 <LPK.dll+0x48f8> LPK.dll!LpkStringAnalyse
0x629c4651 <LPK.dll+0x4651> LPK.dll!LpkCharsetDraw
0x629c1269 <LPK.dll+0x1269> LPK.dll!LpkDrawTextEx
0x7e44e667 <USER32.dll+0x3e667> USER32.dll!DT_DrawStr
0x7e42bae3 <USER32.dll+0x1bae3> USER32.dll!DT_GetLineBreak

...

Error #7: UNADDRESSABLE ACCESS: reading 0x00171628-0x0017162c 4 byte(s) within 0x00171628-0x0017162c
@0:00:03.237 in thread 3536
Note: prev lower malloc: 0x0016fd18-0x0016fdc0
Note: 0x00171628-0x0017162c overlaps freed memory 0x00171628-0x00171684
system call NtUserGetClassInfo WNDCLASSEXW.lpszClassName

0x76397177 <IMM32.dll+0x7177> IMM32.dll!InquireIme
0x763973f4 <IMM32.dll+0x73f4> IMM32.dll!LoadIME
0x76397680 <IMM32.dll+0x7680> IMM32.dll!LoadImeDpi
0x763977bb <IMM32.dll+0x77bb> IMM32.dll!ImmLoadIME
0x7e46b570 <USER32.dll+0x5b570> USER32.dll!CtfLoadThreadLayout
0x7e46be00 <USER32.dll+0x5be00> USER32.dll!ImeSystemHandler
0x7e46c8cf <USER32.dll+0x5c8cf> USER32.dll!ImeWndProcWorker
0x7e46c97d <USER32.dll+0x5c97d> USER32.dll!ImeWndProcW
0x7e418734 <USER32.dll+0x8734> USER32.dll!InternalCallWinProc
0x7e418816 <USER32.dll+0x8816> USER32.dll!UserCallWinProcCheckWow
0x7e428ea0 <USER32.dll+0x18ea0> USER32.dll!DispatchClientMessage


[XP32 w/o symbols]
Error #1: UNINITIALIZED READ: reading 0x00347358-0x0034735c 4 byte(s)
@0:00:01.110 in thread 5816
0x74da6576 <USP10.dll+0x16576> USP10.dll!ScriptApplyDigitSubstitution
0x74da66d7 <USP10.dll+0x166d7> USP10.dll!ScriptApplyDigitSubstitution
0x74da59be <USP10.dll+0x159be> USP10.dll!ScriptApplyDigitSubstitution
0x74da5a8e <USP10.dll+0x15a8e> USP10.dll!ScriptApplyDigitSubstitution
0x74da5ea3 <USP10.dll+0x15ea3> USP10.dll!ScriptApplyDigitSubstitution
0x74da5f8b <USP10.dll+0x15f8b> USP10.dll!ScriptApplyDigitSubstitution
0x74da4186 <USP10.dll+0x14186> USP10.dll!ScriptStringAnalyse
0x629c48f8 <LPK.dll+0x48f8> LPK.dll!LpkTabbedTextOut
0x629c4651 <LPK.dll+0x4651> LPK.dll!LpkTabbedTextOut
0x629c1269 <LPK.dll+0x1269> LPK.dll!LpkDrawTextEx
0x7e44e667 <USER32.dll+0x3e667> USER32.dll!DeregisterShellHookWindow
0x7e42bae3 <USER32.dll+0x1bae3> USER32.dll!DrawTextExW

...

Error #7: UNADDRESSABLE ACCESS: reading 0x00171628-0x0017162c 4 byte(s) within 0x00171628-0x0017162c
@0:00:02.783 in thread 5816
Note: prev lower malloc: 0x0016fd18-0x0016fdc0
Note: 0x00171628-0x0017162c overlaps freed memory 0x00171628-0x00171684
system call NtUserGetClassInfo WNDCLASSEXW.lpszClassName

0x76397177 <IMM32.dll+0x7177> IMM32.dll!ImmNotifyIME
0x763973f4 <IMM32.dll+0x73f4> IMM32.dll!ImmNotifyIME
0x76397680 <IMM32.dll+0x7680> IMM32.dll!ImmNotifyIME
0x763977bb <IMM32.dll+0x77bb> IMM32.dll!ImmLoadIME
0x7e46b570 <USER32.dll+0x5b570> USER32.dll!IMPSetIMEA
0x7e46be00 <USER32.dll+0x5be00> USER32.dll!IMPSetIMEA
0x7e46c8cf <USER32.dll+0x5c8cf> USER32.dll!IMPSetIMEA
0x7e46c97d <USER32.dll+0x5c97d> USER32.dll!IMPSetIMEA
0x7e418734 <USER32.dll+0x8734> USER32.dll!GetDC
0x7e418816 <USER32.dll+0x8816> USER32.dll!GetDC
0x7e428ea0 <USER32.dll+0x18ea0> USER32.dll!DefWindowProcW

Summary: False reports on MessageBox
Owner: bruen...@google.com

@derekbruening
Copy link
Contributor Author

From timurrrr@google.com on July 21, 2011 05:40:06

On W7, there are 5 leaks and one UNADDR [maybe that was a recent regression?]
[W7 with symbols]
Error #1: UNADDRESSABLE ACCESS: reading 0x04090409-0x0409040b 2 byte(s) within 0x04090409-0x0409040b
@0:00:14.751 in thread 3096
system call NtUserGetClassInfoEx WNDCLASSEXW.lpszClassName # Note the "Ex" suffix

0x75e9a0d0 <USER32.dll+0x1a0d0> USER32.dll!GetClassInfoW
0x75731c6c <IMM32.dll+0x11c6c> IMM32.dll!InquireIme
0x75731a9b <IMM32.dll+0x11a9b> IMM32.dll!LoadImeDpi
0x75731967 <IMM32.dll+0x11967> IMM32.dll!ImmLoadIME
0x75e9a2f1 <USER32.dll+0x1a2f1> USER32.dll!CtfLoadThreadLayout
0x75e9a2b3 <USER32.dll+0x1a2b3> USER32.dll!ImeSystemHandler
0x75e97b85 <USER32.dll+0x17b85> USER32.dll!ImeWndProcWorker
0x75e97bba <USER32.dll+0x17bba> USER32.dll!ImeWndProcW
0x75e96238 <USER32.dll+0x16238> USER32.dll!InternalCallWinProc
0x75e968ea <USER32.dll+0x168ea> USER32.dll!UserCallWinProcCheckWow
0x75e97177 <USER32.dll+0x17177> USER32.dll!DispatchClientMessage

[W7 w/o symbols]
Error #1: UNADDRESSABLE ACCESS: reading 0x04090409-0x0409040b 2 byte(s) within 0x04090409-0x0409040b
@0:00:07.050 in thread 3624
system call NtUserGetClassInfoEx WNDCLASSEXW.lpszClassName

0x75e9a0d0 <USER32.dll+0x1a0d0> USER32.dll!GetClassInfoW
0x75731c6c <IMM32.dll+0x11c6c> IMM32.dll!ImmLoadIME
0x75731a9b <IMM32.dll+0x11a9b> IMM32.dll!ImmLoadIME
0x75731967 <IMM32.dll+0x11967> IMM32.dll!ImmLoadIME
0x75e9a2f1 <USER32.dll+0x1a2f1> USER32.dll!GetClassInfoW
0x75e9a2b3 <USER32.dll+0x1a2b3> USER32.dll!GetClassInfoW
0x75e97b85 <USER32.dll+0x17b85> USER32.dll!GetUserObjectInformationW
0x75e97bba <USER32.dll+0x17bba> USER32.dll!GetUserObjectInformationW
0x75e96238 <USER32.dll+0x16238> USER32.dll!gapfnScSendMessage
0x75e968ea <USER32.dll+0x168ea> USER32.dll!gapfnScSendMessage
0x75e97177 <USER32.dll+0x17177> USER32.dll!GetWindowLongW

@derekbruening
Copy link
Contributor Author

From bruen...@google.com on July 21, 2011 10:17:58

xp32 is not a primary target for me, can you check the usp10.dll uninits there and see if they require per-bit and if so update the issue #493 default suppressions

I will look at WNDCLASSEXW.lpszClassName

Owner: timurrrr@google.com

@derekbruening
Copy link
Contributor Author

From bruen...@google.com on July 21, 2011 11:05:04

WNDCLASSEXW.lpszClassName is split as issue #505

@derekbruening
Copy link
Contributor Author

From timurrrr@google.com on July 22, 2011 02:16:09

OK, splitting the USP10 uninits into issue #493

Summary: [False?] leak reports on MessageBox

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