DynamoRIO / DynamoRIO/drmemory
ASSERT: common\alloc.c:5657: pt->in_heap_routine > 0 (shouldn't be called)
- Dominant language
- C
- Stars
- 2.7k
- Forks
- 290
- PR merge metrics
- No merged PRs in 30d
Description
_From [zhao...@google.com](https://code.google.com/u/106321947286816917100/) on July 30, 2012 12:02:44_
running chrome under Dr.Memory debug build and open a page with embedded youtube video:
(thread 37544): ....\drmemory.git\common\alloc.c:5657: pt->in_heap_routine > 0 (shouldn't be called)
0:001> kn 30
# ChildEBP RetAddr
00 2607a5a4 615b3cde ntdll!NtRaiseHardError+0x12
01 2607a5f4 6156c2f2 dynamorio!nt_messagebox+0xfe [d:\src\cygwin\home\zhaoqin\workspace\drmemory\drmemory.git\dynamorio\core\win32\ntdll.c @ 3477]
02 2607be14 00afd6ec dynamorio!dr_messagebox+0xf2 [d:\src\cygwin\home\zhaoqin\workspace\drmemory\drmemory.git\dynamorio\core\x86\instrument.c @ 3521]
03 2607be20 00afd733 drmemorylib!wait_for_user+0xc [d:\src\cygwin\home\zhaoqin\workspace\drmemory\drmemory.git\common\utils.c @ 98]
04 2607be6c 00a63e53 drmemorylib!drmemory_abort+0x33 [d:\src\cygwin\home\zhaoqin\workspace\drmemory\drmemory.git\common\utils.c @ 126]
05 2607bf40 00b789e1 drmemorylib!handle_alloc_post+0x573 [d:\src\cygwin\home\zhaoqin\workspace\drmemory\drmemory.git\common\alloc.c @ 5657]
06 2607bfc4 00b79575 drmemorylib!drwrap_after_callee_func+0x391 [d:\src\cygwin\home\zhaoqin\workspace\drmemory\drmemory.git\dynamorio\ext\drwrap\drwrap.c @ 1658]
07 2607bff0 6156990e drmemorylib!drwrap_event_exception+0xb5 [d:\src\cygwin\home\zhaoqin\workspace\drmemory\drmemory.git\dynamorio\ext\drwrap\drwrap.c @ 2115]
08 2607c02c 615aa082 dynamorio!instrument_exception+0x9e [d:\src\cygwin\home\zhaoqin\workspace\drmemory\drmemory.git\dynamorio\core\x86\instrument.c @ 1800]
09 2607c338 615aa49a dynamorio!client_exception_event+0x162 [d:\src\cygwin\home\zhaoqin\workspace\drmemory\drmemory.git\dynamorio\core\win32\callback.c @ 4396]
0a 2607c390 615a85bf dynamorio!check_internal_exception+0x10a [d:\src\cygwin\home\zhaoqin\workspace\drmemory\drmemory.git\dynamorio\core\win32\callback.c @ 4479]
0b 2607c7bc 251c1bff dynamorio!intercept_exception+0x123f [d:\src\cygwin\home\zhaoqin\workspace\drmemory\drmemory.git\dynamorio\core\win32\callback.c @ 4863]
WARNING: Frame IP not in any known module. Following frames may be wrong.
0c 2607cc60 69534aea 0x251c1bff
0d 2607cc84 695330be dbghelp!ImagehlpApiVersionEx+0x40aa
0e 2607d0a8 69532892 dbghelp!ImagehlpApiVersionEx+0x267e
0f 2607d0b8 69530fd0 dbghelp!ImagehlpApiVersionEx+0x1e52
10 2607d560 695315e5 dbghelp!ImagehlpApiVersionEx+0x590
11 2607d9e0 695293ed dbghelp!ImagehlpApiVersionEx+0xba5
12 2607da4c 6952956a dbghelp!SymLoadModuleEx+0x7d
13 2607da78 00b79f0a dbghelp!SymLoadModule64+0x2a
14 2607dab4 00b79da2 drmemorylib!load_module+0x10a [d:\src\cygwin\home\zhaoqin\workspace\drmemory\drmemory.git\dynamorio\ext\drsyms\drsyms_windows.c @ 282]
15 2607dacc 00b79876 drmemorylib!lookup_or_load+0x72 [d:\src\cygwin\home\zhaoqin\workspace\drmemory\drmemory.git\dynamorio\ext\drsyms\drsyms_windows.c @ 319]
16 2607db14 00b7982a drmemorylib!drsym_lookup_address_local+0x46 [d:\src\cygwin\home\zhaoqin\workspace\drmemory\drmemory.git\dynamorio\ext\drsyms\drsyms_windows.c @ 377]
17 2607db2c 00a9277c drmemorylib!drsym_lookup_address+0x2a [d:\src\cygwin\home\zhaoqin\workspace\drmemory\drmemory.git\dynamorio\ext\drsyms\drsyms_windows.c @ 856]
18 2607dcc4 00a99f42 drmemorylib!lookup_func_and_line+0x35c [d:\src\cygwin\home\zhaoqin\workspace\drmemory\drmemory.git\common\callstack.c @ 400]
19 2607de04 00a98cba drmemorylib!packed_frame_to_symbolized+0x1222 [d:\src\cygwin\home\zhaoqin\workspace\drmemory\drmemory.git\common\callstack.c @ 1483]
1a 2607e028 00adc869 drmemorylib!packed_callstack_print+0x33a [d:\src\cygwin\home\zhaoqin\workspace\drmemory\drmemory.git\common\callstack.c @ 1505]
1b 2607e0ec 00ac942c drmemorylib!report_delayed_thread+0x629 [d:\src\cygwin\home\zhaoqin\workspace\drmemory\drmemory.git\drmemory\report.c @ 2792]
1c 2607e154 00ad4f2c drmemorylib!print_timestamp_and_thread+0x3ec [d:\src\cygwin\home\zhaoqin\workspace\drmemory\drmemory.git\drmemory\report.c @ 1586]
1d 2607e834 00acd739 drmemorylib!print_error_to_buffer+0x72ac [d:\src\cygwin\home\zhaoqin\workspace\drmemory\drmemory.git\drmemory\report.c @ 2256]
1e 2607e860 00acabc7 drmemorylib!print_error_report+0x29 [d:\src\cygwin\home\zhaoqin\workspace\drmemory\drmemory.git\drmemory\report.c @ 1980]
1f 2607e98c 00ad9669 drmemorylib!report_error+0xc77 [d:\src\cygwin\home\zhaoqin\workspace\drmemory\drmemory.git\drmemory\report.c @ 2127]
20 2607e9c8 00aa675a drmemorylib!report_mismatched_heap+0x59 [d:\src\cygwin\home\zhaoqin\workspace\drmemory\drmemory.git\drmemory\report.c @ 2387]
21 2607ea78 00a5b919 drmemorylib!client_mismatched_heap+0x7a [d:\src\cygwin\home\zhaoqin\workspace\drmemory\drmemory.git\drmemory\alloc_drmem.c @ 487]
22 2607eaf8 00a5a569 drmemorylib!handle_free_check_mismatch+0x499 [d:\src\cygwin\home\zhaoqin\workspace\drmemory\drmemory.git\common\alloc.c @ 4111]
23 2607ec74 00a58f84 drmemorylib!handle_alloc_pre_ex+0x1159 [d:\src\cygwin\home\zhaoqin\workspace\drmemory\drmemory.git\common\alloc.c @ 5455]
24 2607ed10 00b78013 drmemorylib!alloc_hook+0x6b4 [d:\src\cygwin\home\zhaoqin\workspace\drmemory\drmemory.git\common\alloc.c @ 5348]
25 2607eeb0 2acbc627 drmemorylib!drwrap_in_callee+0x3e3 [d:\src\cygwin\home\zhaoqin\workspace\drmemory\drmemory.git\dynamorio\ext\drwrap\drwrap.c @ 1514]
26 03a5f74c 013d9616 0x2acbc627
27 03a5f758 013d9cdb chrome!sandbox::PolicyBase::`scalar deleting destructor'+0x16
28 03a5f778 013c3d13 chrome!sandbox::PolicyBase::Release+0x5b [d:\src\cygwin\home\zhaoqin\workspace\chrome\chromium\src\sandbox\win\src\sandbox_policy_base.cc @ 130]
29 03a5f8c0 013c3e52 chrome!sandbox::BrokerServicesBase::FreeResources+0x173 [d:\src\cygwin\home\zhaoqin\workspace\chrome\chromium\src\sandbox\win\src\broker_services.cc @ 170]
2a 03a5fbb8 76e0339a chrome!sandbox::BrokerServicesBase::TargetEventsThread+0x112 [d:\src\cygwin\home\zhaoqin\workspace\chrome\chromium\src\sandbox\win\src\broker_services.cc @ 215]
2b 03a5fbc4 77999ef2 kernel32!BaseThreadInitThunk+0xe
2c 03a5fc04 77999ec5 ntdll!__RtlUserThreadStart+0x70
2d 03a5fc1c 00000000 ntdll!_RtlUserThreadStart+0x1b
It looks like Dr.Memory first see a free mismatch error in chrome!sandbox::PolicyBase::~PolicyBase discovered by handle_free_check_mismatch called from handle_alloc_pre_ex, and try to report it. When creating the call stack, it need load module "chrome.dll" from "D:\src\cygwin\home\zhaoqin\Workspace\Chrome\chromium\src\build\Debug\chrome.dll" by calling SymLoadModule64, where dbghelp cause an exception. Dr.Memory intercepts that exception, and calls drwrap_afert_callee_func and handle_alloc_post, where assert happens.
_Original issue: http://code.google.com/p/drmemory/issues/detail?id=952_
Contributor guide
Assessment
This issue has not been assessed yet.