-
Notifications
You must be signed in to change notification settings - Fork 264
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
thousands of invalid heap arg errors in chrome production builds #1532
Comments
From bruen...@google.com on April 29, 2014 11:03:31 *** TODO analyze w/ more info Error 0 replace_RtlFreeHeap [d:\derek\drmemory\git\src\common\alloc_replace.c:3138]1 KERNEL32.dll!HeapFree +0x13 (0x74df14ad <KERNEL32.dll+0x114ad>)2 chrome.dll!std::_Locinfo::~_Locinfo [c:\b\depot_tools\win_toolchain\vs2013_files\vc\include\xlocinfo:96]3 chrome.dll!std::use_facet<> [c:\b\depot_tools\win_toolchain\vs2013_files\vc\include\xlocale:578]4 chrome.dll!std::basic_ios<>::init [c:\b\depot_tools\win_toolchain\vs2013_files\vc\include\ios:170]5 chrome.dll!std::basic_ostream<>::basic_ostream<> [c:\b\depot_tools\win_toolchain\vs2013_files\vc\include\ostream:55]6 chrome.dll!std::`dynamic initializer for 'cerr'' [f:\dd\vctools\crt\crtw32\stdcpp\cerr.cpp:16]# 7 chrome.dll!_cinit [f:\dd\vctools\crt\crtw32\startup\crt0dat.c:308] With addresses: 0 replace_RtlFreeHeap [d:\derek\drmemory\git\src\common\alloc_replace.c:3138](0x739a8b00 <drmemorylib.dll+0x1a8b00) modid:51 KERNEL32.dll!HeapFree (0x74df14ad <KERNEL32.dll+0x114ad>) modid:142 chrome.dll!std::_Locinfo::~_Locinfo [c:\b\depot_tools\win_toolchain\vs2013_files\vc\include\xlocinfo:96](0x659ce188 <chrome.dll+0x4e188) modid:283 chrome.dll!std::use_facet<> [c:\b\depot_tools\win_toolchain\vs2013_files\vc\include\xlocale:578](0x659d121a <chrome.dll+0x5121a) modid:284 chrome.dll!std::basic_ios<>::init [c:\b\depot_tools\win_toolchain\vs2013_files\vc\include\ios:170](0x659d0303 <chrome.dll+0x50303) modid:28Note: memory was allocated here: 0:000> Uf chrome_62d60000!std::_Locinfo:: chrome_62d60000!std::_Locinfo:: chrome_62d60000!std::_Locinfo:: chrome_62d60000!std::_Locinfo:: chrome_69990000!std::_Locinfo::~_Locinfo+0x10a [c:\b\depot_tools\win_toolchain\vs2013_files\vc\include\xlocinfo @ 96]: <goes on to do the same with +0x24, +0x1c, etc.> 0:001> dt -v chrome_65980000!std::_locinfo 0:000> U poi(642513b0)
So Locinfo::~Locinfo frees each field (here, the std::_Yarn field 0:001> x chrome_65980000!free 0:001> ln 659c7ac0 0:001> Uf 659c7ac0 chrome_65980000!operator delete[]+0xd [c:\b\build\slave\win\build\src\base\allocator\generic_allocators.cc @ 32]: chrome_65980000!operator delete[]+0x13 [c:\b\build\slave\win\build\src\base\allocator\generic_allocators.cc @ 32]: |
From bruen...@google.com on April 29, 2014 11:03:31 ... push dword ptr [ebp+8] chrome_65980000!operator delete[]+0x27 [c:\b\build\slave\win\build\src\base\allocator\generic_allocators.cc @ 32]: chrome_65980000!operator delete[]+0x2f [c:\b\build\slave\win\build\src\base\allocator\generic_allocators.cc @ 32]: OK, so we see that Locinfo::~Locinfo has the call to free() inlined inside it. Allocated: 3376 6692a159 e8e2d809ff call chrome_65980000!malloc (659c7a40) 0:001> U 659c7a40 The shim calls win_heap_malloc which calls HeapAlloc since I have 0:001> x chrome_65980000!allocator Called from:
Freed:
#ifdef _DEBUG #else /* _DEBUG _/
So the source code is calling the malloc() and free() shims, but the free() *** TODO how solve? just cut off after N errors of this type? I don't think we want to try and auto-detect inlining of free(), so I |
From zhao...@google.com on April 29, 2014 12:17:14 N cut-off might be the only solution if we cannot enforce the not inline build. Also, do we want a per-module filtering, i.e., if the mismatch from the same module? |
From bruen...@google.com on April 29, 2014 15:15:03 How about: do not report C vs Win mismatch errors when libc is static: How impl that? A) Add edata.check_winapi_mismatch = module_imports_from_msvc(mod) and pass B) At report time, look up whether the module should report or not. |
From derek.br...@gmail.com on April 29, 2014 18:10:26 This issue was closed by revision r1905 . Status: Fixed |
From bruen...@google.com on April 24, 2014 17:58:56
I'm running a chrome production build and thus not a component
build and I'm seeing thousands of invalid heap args being reported, both
"allocated with C freed with Win" and "allocated with Win freed with C".
I am currently investigating.
Samples:
Error
#1
: INVALID HEAP ARGUMENT: allocated with C library layer, freed with Windows API layer#0 replace_RtlFreeHeap [d:\drmemory_package\common\alloc_replace.c:3138]
#1 KERNEL32.dll!HeapFree +0x13 (0x74df14ad <KERNEL32.dll+0x114ad>)
#2 chrome.dll!std::_Locinfo::~_Locinfo [c:\b\depot_tools\win_toolchain\vs2013_files\vc\include\xlocinfo:96]
#3 chrome.dll!std::use_facet<> [c:\b\depot_tools\win_toolchain\vs2013_files\vc\include\xlocale:578]
#4 chrome.dll!std::basic_ios<>::init [c:\b\depot_tools\win_toolchain\vs2013_files\vc\include\ios:170]
#5 chrome.dll!std::basic_ostream<>::basic_ostream<> [c:\b\depot_tools\win_toolchain\vs2013_files\vc\include\ostream:55]
#6 chrome.dll!std::`dynamic initializer for 'cerr'' [f:\dd\vctools\crt\crtw32\stdcpp\cerr.cpp:16]
#7 chrome.dll!_cinit [f:\dd\vctools\crt\crtw32\startup\crt0dat.c:308]
#8 chrome.dll!_CRT_INIT [f:\dd\vctools\crt\crtw32\startup\dllcrt0.c:127]
#9 chrome.dll!__DllMainCRTStartup [f:\dd\vctools\crt\crtw32\startup\dllcrt0.c:371]
#10 chrome.dll!_DllMainCRTStartup [f:\dd\vctools\crt\crtw32\startup\dllcrt0.c:340]
#11 ntdll.dll!LdrpCallInitRoutine
Note: @0:00:58.691 in thread 7420
Error
#14073
: INVALID HEAP ARGUMENT: allocated with Windows API layer, freed with C library layer#0 replace_free [d:\drmemory_package\common\alloc_replace.c:2380]
#1 chrome.dll!base::DefaultDeleter<>::operator() [c:\b\build\slave\win\build\src\base\memory\scoped_ptr.h:137]
#2 chrome.dll!ChromeMainDelegate::~ChromeMainDelegate [c:\b\build\slave\win\build\src\chrome\app\chrome_main_delegate.cc:398]
#3 MainDllLoader::Launch [c:\b\build\slave\win\build\src\chrome\app\client_util.cc:314]
#4 wWinMain [c:\b\build\slave\win\build\src\chrome\app\chrome_exe_main_win.cc:102]
Note: @0:02:19.394 in thread 7420
Original issue: http://code.google.com/p/drmemory/issues/detail?id=1532
The text was updated successfully, but these errors were encountered: