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

Memory leaks below LoadLibrary #463

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

Memory leaks below LoadLibrary #463

derekbruening opened this issue Nov 28, 2014 · 0 comments

Comments

@derekbruening
Copy link
Contributor

From timurrrr@google.com on June 21, 2011 08:49:43

According to MSDN, http://msdn.microsoft.com/en-us/library/ms684175(v=vs.85).aspx "The system maintains a per-process reference count on all loaded modules. Calling LoadLibrary increments the reference count. Calling the FreeLibrary or FreeLibraryAndExitThread function decrements the reference count. The system unloads a module when its reference count reaches zero or when the process terminates (regardless of the reference count)."

If I got it right, there shouldn't be memory leaks below LoadLibrary (or they are benign).

However, Dr. Memory prints out memory leaks below LoadLibrary, e.g. on the issue #462 code:
Error #4: LEAK 128 direct bytes 0x007329b0-0x00732a30 + 0 indirect bytes
0x0062ade8 <msvcrt.dll+0xade8> msvcrt.dll!towlower
0x0062ae43 <msvcrt.dll+0xae43> msvcrt.dll!towlower
0x00632015 <msvcrt.dll+0x12015> msvcrt.dll!initterm_e
0x00631fc8 <msvcrt.dll+0x11fc8> msvcrt.dll!initterm_e
0x00631a94 <msvcrt.dll+0x11a94> msvcrt.dll!_crtLCMapStringA
0x0062a48c <msvcrt.dll+0xa48c> msvcrt.dll!lock
0x77449960 <ntdll.dll+0x39960> ntdll.dll!RtlQueryEnvironmentVariable
0x7744d8c9 <ntdll.dll+0x3d8c9> ntdll.dll!LdrResSearchResource
0x7744d78c <ntdll.dll+0x3d78c> ntdll.dll!LdrResSearchResource
0x7744c4e5 <ntdll.dll+0x3c4e5> ntdll.dll!LdrLoadDll
0x75161d2a <KERNELBASE.dll+0x11d2a> KERNELBASE.dll!LoadLibraryExW
0x75161d7a <KERNELBASE.dll+0x11d7a> KERNELBASE.dll!LoadLibraryExA
0x76da4bf7 <KERNEL32.dll+0x14bf7> KERNEL32.dll!LoadLibraryA
0x0040102b <test.exe+0x102b> test.exe!main
c:\sandbox\uuid_create\test.cpp:7

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

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