DynamoRIO / DynamoRIO/drmemory

Unrecoverable Error in dbghelp

Open
#1,230 9 comments 0 reactions 0 assignees View on GitHub
Bug-ToolCrash Migrated OpSys-Windows Priority-High
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 May 14, 2013 11:36:13_

It seems caused by drm replace_malloc allocation failure and tries to report error

0018e208 59244aea msvcrt_2660000!memcpy+0x198
0018e22c 592430be dbghelp!ScanMemoryForModuleRefs+0x68
0018e650 59242892 dbghelp!WriteException+0x17
0018e660 59240fd0 dbghelp!WriteSystemInfo+0x134
0018eb08 592415e5 dbghelp!SwuSearchForCall+0x3a1
0018ef88 592394c5 dbghelp!StackWalk+0x106
0018eff0 73a6c3c4 dbghelp!GetPData+0x42d
0018f23c 73a6c1fa drmemorylib!load_module(void \* proc = 0xffffffff, char \* path = 0x73d90cc0 "D:\src\chrome-int\src\out\Debug\test.exe")+0x174
[d:\src\cygwin\home\zhaoqin\workspace\drmemory\drmemory.git\dynamorio\ext\drsyms\drsyms_windows.c @ 338]
0018f254 73a6dead drmemorylib!lookup_or_load(char \* modpath = 0x73d90cc0 "D:\src\chrome-int\src\out\Debug\test.exe", char use_dbghelp = 1 '')+0x7a
[d:\src\cygwin\home\zhaoqin\workspace\drmemory\drmemory.git\dynamorio\ext\drsyms\drsyms_windows.c @ 377]
0018f26c 739d2d04 drmemorylib!drsym_get_module_debug_kind(char \* modpath = 0x73d90cc0 "D:\src\chrome-int\src\out\Debug\test.exe", drsym_debug_kind_t \* kind = 0x0018f280)+0x4d
[d:\src\cygwin\home\zhaoqin\workspace\drmemory\drmemory.git\dynamorio\ext\drsyms\drsyms_windows.c @ 1433]
0018f284 739cec48 drmemorylib!report_symbol_advice(void)+0x14
[d:\src\cygwin\home\zhaoqin\workspace\drmemory\drmemory.git\drmemory\report.c @ 2045]
0018f39c 739dfa3e drmemorylib!report_error(struct _error_toprint_t \* etp = 0x0018f3b0, struct _dr_mcontext_t \* mc = 0x0018f694, struct _packed_callstack_t \* pcs = 0x00000000)+0x28
[d:\src\cygwin\home\zhaoqin\workspace\drmemory\drmemory.git\drmemory\report.c @ 2142]
0018f3e0 739df9d5 drmemorylib!report_misc_error(unsigned int errtype = 5, struct _app_loc_t \* loc = 0x0018f428, struct _dr_mcontext_t \* mc = 0x0018f694, char \* msg = 0x73c19128 "heap allocation failed", unsigned char \* addr = 0x00000000 "", unsigned int sz = 0, char report_instruction = 0 '', struct _packed_callstack_t \* pcs = 0x00000000)+0x5e
[d:\src\cygwin\home\zhaoqin\workspace\drmemory\drmemory.git\drmemory\report.c @ 2543]
0018f408 739adaae drmemorylib!report_warning(struct _app_loc_t \* loc = 0x0018f428, struct _dr_mcontext_t \* mc = 0x0018f694, char \* msg = 0x73c19128 "heap allocation failed", unsigned char \* addr = 0x00000000 "", unsigned int sz = 0, char report_instruction = 0 '')+0x25
[d:\src\cygwin\home\zhaoqin\workspace\drmemory\drmemory.git\drmemory\report.c @ 2551]
0018f438 7396871c drmemorylib!client_handle_alloc_failure(unsigned int request_size = 0x7ae210, unsigned char \* pc = 0x73967860 "U???", struct _dr_mcontext_t \* mc = 0x0018f694)+0x2e [d:\src\cygwin\home\zhaoqin\workspace\drmemory\drmemory.git\drmemory\alloc_drmem.c @ 659]
0018f640 73967a26 drmemorylib!replace_alloc_common(struct _arena_header_t \* arena = 0x03320000, unsigned int request_size = 0x7ae210, alloc_flags_t flags = 9 (No matching enumerant), void \* drcontext = 0x1c398c00, struct _dr_mcontext_t \* mc = 0x0018f694, unsigned char \* caller = 0x73967860 "U???", unsigned int alloc_type = 4)+0xadc
[d:\src\cygwin\home\zhaoqin\workspace\drmemory\drmemory.git\common\alloc_replace.c @ 1514]
0018f7ec 0049e15d drmemorylib!replace_malloc(unsigned int size = 0x7ae210)+0x1c6
[d:\src\cygwin\home\zhaoqin\workspace\drmemory\drmemory.git\common\alloc_replace.c @ 2214]

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

Contributor guide

Open the contributing guide

Research direction

Start with common/alloc_replace.c around lines 1514 and 2214, then trace report.c around lines 2045, 2142, and 2543 and dynamorio/ext/drsyms/drsyms_windows.c around lines 338, 377, and 1433. Investigate the allocation-failure path into dbghelp and establish how to reproduce it; done means reporting a failed allocation no longer causes an unrecoverable dbghelp error.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
devtools, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.