DynamoRIO / DynamoRIO/drmemory
APP CRASH running graphical program on OSX
- Dominant language
- C
- Stars
- 2.7k
- Forks
- 290
- PR merge metrics
- No merged PRs in 30d
Description
Running a medium-sized graphical program on OSX using the drmem allocator reports a lot of unaddrs and invalid heap args and then crashes with a bus error.
drmemory -light -no_replace_malloc works.
full mode though deadlocks b/c we don't have private loader (https://github.com/DynamoRIO/dynamorio/issues/1596):
here's the deadlock:
```
(lldb) bt
- thread #1: tid = 0x6674a, 0x95f94082 libsystem_kernel.dylib`syscall_thread_switch + 10, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
- frame #0: 0x95f94082 libsystem_kernel.dylib`syscall_thread_switch + 10
- frame #1: 0x98f196b0 libsystem_platform.dylib`_OSSpinLockLockSlow + 58
- frame #2: 0x97445013 libsystem_malloc.dylib`szone_malloc_should_clear + 102
- frame #3: 0x9743abaa libsystem_malloc.dylib`szone_calloc + 59
- frame #4: 0x974478ce libsystem_malloc.dylib`malloc_zone_calloc + 82
- frame #5: 0x97447f9a libsystem_malloc.dylib`calloc + 60
- frame #6: 0x003194a1 libdrmemorylib.dylib`_dwarf_alloc(ret_dbg=, mode=, error=) + 33 at libdwarf_init.c:306
- frame #7: 0x003170a4 libdrmemorylib.dylib`dwarf_macho_init(map_base=0x1041d000, mode=, errhand=, errarg=, ret_dbg=, error=0x00439cc8) + 132 at dwarf_init.c:50
- frame #8: 0x0030d976 libdrmemorylib.dylib`drsym_obj_dwarf_init(mod_in=, dbg=) + 102 at drsyms_macho.c:427
- frame #9: 0x00308413 libdrmemorylib.dylib`load_module(modpath=0x0043a370) + 771 at drsyms_unix_common.c:190
- frame #10: 0x003083d1 libdrmemorylib.dylib`load_module(modpath=0x0039f600) + 705 at drsyms_unix_common.c:151
- frame #11: 0x00307f19 libdrmemorylib.dylib`drsym_get_module_debug_kind [inlined] lookup_or_load(modpath=0x0039f600) + 32 at drsyms_unix_frontend.c:76
- frame #12: 0x00307ef9 libdrmemorylib.dylib`drsym_get_module_debug_kind(modpath=0x0039f600, kind=) + 73 at drsyms_unix_frontend.c:335
- frame #13: 0x002f3e03 libdrmemorylib.dylib`report_error [inlined] report_symbol_advice + 18 at report.c:2576
- frame #14: 0x002f3df1 libdrmemorylib.dylib`report_error(pcs=, etp=, mc=) + 65 at report.c:2721
- frame #15: 0x002f3d89 libdrmemorylib.dylib`report_unaddressable_access(loc=0x0043aac8, addr=, sz=, write='\x01', container_start=0x7a7fff98, container_end=0x7a7fff9c, mc=) + 441 at report.c:3115
- frame #16: 0x002afd83 libdrmemorylib.dylib`handle_mem_ref_internal(flags=, loc=0x0043aac8, addr=, sz=2537838743, mc=0x0043a9d6, opnum=, comb=) + 3875 at readwrite.c:5132
- frame #17: 0x002a7a97 libdrmemorylib.dylib`check_mem_opnd(opc=56, flags=, loc=0x00000000, opnd=opnd_t at 0x0043aa14, sz=, mc=0x002a747e, opnum=, comb=) + 1575 at readwrite.c:5305
- frame #18: 0x002aaabd libdrmemorylib.dylib`slow_path_with_mc(drcontext=0x0043acd0, pc=0x97445896, decode_pc=, mc=) + 9437 at readwrite.c:3883
- frame #19: 0x002abe74 libdrmemorylib.dylib`slow_path(pc=0x97445896, decode_pc=0x97445896) + 100 at readwrite.c:3957
- frame #20: 0x004e8043
- frame #21: 0x9743ab6a libsystem_malloc.dylib`szone_malloc + 24
- frame #22: 0x9744755b libsystem_malloc.dylib`malloc_zone_malloc + 75
- frame #23: 0x95495356 libobjc.A.dylib`_malloc_internal + 26
- frame #24: 0x9549529c libobjc.A.dylib`recursive_mutex_init + 39
- frame #25: 0x9549526f libobjc.A.dylib`lock_init + 49
- frame #26: 0x954a8600 libobjc.A.dylib`_objc_init() + 45
- frame #27: 0x8fe5745b dyld`ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) + 283
- frame #28: 0x8fe575c4 dyld`ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) + 64
- frame #29: 0x8fe5392c dyld`ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, ImageLoader::InitializerTimingList&) + 294
- frame #30: 0x8fe538bb dyld`ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, ImageLoader::InitializerTimingList&) + 181
- frame #31: 0x8fe538bb dyld`ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, ImageLoader::InitializerTimingList&) + 181
- frame #32: 0x8fe538bb dyld`ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, ImageLoader::InitializerTimingList&) + 181
- frame #33: 0x8fe538bb dyld`ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, ImageLoader::InitializerTimingList&) + 181
- frame #34: 0x8fe538bb dyld`ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, ImageLoader::InitializerTimingList&) + 181
- frame #35: 0x8fe538bb dyld`ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, ImageLoader::InitializerTimingList&) + 181
- frame #36: 0x8fe538bb dyld`ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, ImageLoader::InitializerTimingList&) + 181
- frame #37: 0x8fe537bc dyld`ImageLoader::runInitializers(ImageLoader::LinkContext const&, ImageLoader::InitializerTimingList&) + 62
- frame #38: 0x8fe4605e dyld`dyld::initializeMainExecutable() + 193
- frame #39: 0x8fe49828 dyld`dyld::_main(macho_header const_, unsigned long, int, char const__, char const__, char const__, unsigned long_) + 2603
- frame #40: 0x8fe45264 dyld`dyldbootstrap::start(macho_header const_, int, char const__, long, macho_header const_, unsigned long*) + 430
- frame #41: 0x8fe45077 dyld`_dyld_start + 71
```
Contributor guide
Assessment
This issue has not been assessed yet.