You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running Dr. Memory from ConEmu after fixing the injection bug
(DynamoRIO/dynamorio#1597), Dr. Memory crashes
during exit.
This works: -leaks_only -no_count_leaks -no_track_allocs
It's sthg in alloc teardown
(343e4.343e8): Access violation - code c0000005 (first chance)
First chance exceptions are reported before any exception handling.
This exception may be expected and handled.
eax=000343e8 ebx=239af000 ecx=00000000 edx=00f10000 esi=239ae324 edi=239ae230
eip=5c037f5b esp=239ae1e4 ebp=239ae1e4 iopl=0 nv up ei pl zr na pe nc
cs=0023 ss=002b ds=002b es=002b fs=0053 gs=002b efl=00010246
dynamorio!acquire_recursive_lock+0xb:
5c037f5b 39414c cmp dword ptr [ecx+4Ch],eax ds:002b:0000004c=????????
0:000> kn
Running Dr. Memory from ConEmu after fixing the injection bug
(DynamoRIO/dynamorio#1597), Dr. Memory crashes
during exit.
This works: -leaks_only -no_count_leaks -no_track_allocs
It's sthg in alloc teardown
(343e4.343e8): Access violation - code c0000005 (first chance)
First chance exceptions are reported before any exception handling.
This exception may be expected and handled.
eax=000343e8 ebx=239af000 ecx=00000000 edx=00f10000 esi=239ae324 edi=239ae230
eip=5c037f5b esp=239ae1e4 ebp=239ae1e4 iopl=0 nv up ei pl zr na pe nc
cs=0023 ss=002b ds=002b es=002b fs=0053 gs=002b efl=00010246
dynamorio!acquire_recursive_lock+0xb:
5c037f5b 39414c cmp dword ptr [ecx+4Ch],eax ds:002b:0000004c=????????
0:000> kn
ChildEBP RetAddr
00 239ae1e4 5c11f4cc dynamorio!acquire_recursive_lock+0xb [c:\src\dr\git\src\core\utils.c @ 993]
01 239ae1f0 739927a5 dynamorio!dr_recurlock_lock+0xc [c:\src\dr\git\src\core\lib\instrument.c @ 3373]
02 239ae230 739bb02c drmemorylib!iterator_lock+0x35 [c:\src\drmemory\git\src\common\alloc_replace.c @ 567]
03 239ae308 739c59c3 drmemorylib!alloc_iter_own_arena+0x7cc [c:\src\drmemory\git\src\common\alloc_replace.c @ 2129]
04 239ae384 73a6480f drmemorylib!rb_iter_cb+0x3e3 [c:\src\drmemory\git\src\common\heap.c @ 1020]
05 239ae3cc 73a647f4 drmemorylib!iterate_helper+0x3ef [c:\src\drmemory\git\src\common\redblack.c @ 670]
06 239ae41c 73a647f4 drmemorylib!iterate_helper+0x3d4 [c:\src\drmemory\git\src\common\redblack.c @ 668]
07 239ae46c 73a64406 drmemorylib!iterate_helper+0x3d4 [c:\src\drmemory\git\src\common\redblack.c @ 668]
08 239ae4b8 739c5597 drmemorylib!rb_iterate+0x3c6 [c:\src\drmemory\git\src\common\redblack.c @ 684]
09 239ae4dc 739ba368 drmemorylib!heap_region_iterate+0x37 [c:\src\drmemory\git\src\common\heap.c @ 1031]
0a 239ae5dc 739bcfbd drmemorylib!alloc_iterate+0x758 [c:\src\drmemory\git\src\common\alloc_replace.c @ 2171]
0b 239ae728 7395e16f drmemorylib!alloc_replace_exit+0x111d [c:\src\drmemory\git\src\common\alloc_replace.c @ 4553]
0c 239ae730 739edd94 drmemorylib!alloc_exit+0x3f [c:\src\drmemory\git\src\common\alloc.c @ 3031]
0d 239ae738 7380d3e4 drmemorylib!alloc_drmem_exit+0x14 [c:\src\drmemory\git\src\drmemory\alloc_drmem.c @ 257]
0e 239ae778 5c119833 drmemorylib!event_exit+0xf4 [c:\src\drmemory\git\src\drmemory\drmemory.c @ 411]
0f 239ae7ac 5bf839c1 dynamorio!instrument_exit+0xa3 [c:\src\dr\git\src\core\lib\instrument.c @ 692]
10 239ae7d4 5bf84076 dynamorio!dynamo_shared_exit+0x221 [c:\src\dr\git\src\core\dynamo.c @ 974]
11 239ae7fc 5bf83ecb dynamorio!dynamo_process_exit_cleanup+0x196 [c:\src\dr\git\src\core\dynamo.c @ 1238]
12 239ae80c 5c1bbc64 dynamorio!dynamo_process_exit+0x12b [c:\src\dr\git\src\core\dynamo.c @ 1297]
13 239ae81c 2395f440 dynamorio!cleanup_and_terminate+0x47 [C:\src\dr\git\build_x86_dbg\core\CMakeFiles\dynamorio.dir\arch\x86\x86.asm.obj.s @ 1666]
0:000> dv
iter_arena_start = 0x00f10000 "MZ???"
iter_arena_end = 0x00fbc000 "--- memory read error at address 0x00fbc000 ---"
flags = 2
0:000> dt arena
Local var @ 0x239ae2f8 Type _arena_header_t*
0x00f10000
+0x000 start_chunk : 0x00905a4d "--- memory read error at address 0x00905a4d ---"
+0x004 next_chunk : 0x00000003 "--- memory read error at address 0x00000003 ---"
+0x008 commit_end : 0x00000004 "--- memory read error at address 0x00000004 ---"
+0x00c reserve_end : 0x0000ffff "--- memory read error at address 0x0000ffff ---"
+0x010 free_list : 0x000000b8 _free_lists_t
+0x014 dr_lock : (null)
+0x018 lock : 0x00000040 Void
+0x01c flags : 0
+0x020 prev_free_sz : 0
+0x024 magic : 0
+0x028 alloc_set_member : (null)
+0x02c modbase : (null)
+0x030 handle : (null)
+0x034 next_arena : (null)
other heap_tree arena entries look ok:
0:000> ?? _((arena_header_t)(heap_tree->root->left->base))
struct _arena_header_t
+0x000 start_chunk : 0x011100f8 ""
+0x004 next_chunk : 0x01120380 ""
+0x008 commit_end : 0x01130000 "--- memory read error at address 0x01130000 ---"
+0x00c reserve_end : 0x01510000 "--- memory read error at address 0x01510000 ---"
+0x010 free_list : 0x01110038 _free_lists_t
+0x014 dr_lock : 0x239146c8 Void
+0x018 lock : 0x23914668 Void
+0x01c flags : 0xa
+0x020 prev_free_sz : 0
+0x024 magic : 0x5244
+0x028 alloc_set_member : (null)
+0x02c modbase : (null)
+0x030 handle : (null)
+0x034 next_arena : (null)
define STATUS_CONFLICTING_ADDRESSES ((NTSTATUS)0xC0000018L)
So we need to not add until post-syscall.
A second bug is that we need to remove on unmap:
NtMapViewOfSection: 0x04bb0000
mmap_walk add 0x04bb0000: alloc base is 0x04bb0000
mmap file 0x04bb0000-0x04fc0000
NtAllocateVirtualMemory: 0x04bb0000-0x04bc1000 commit in-heap
Adding unknown heap region 0x04bb0000-0x04fc0000
adding heap region 0x04bb0000-0x04fc0000 arena
NtAllocateVirtualMemory: 0x04bc1000-0x04bc2000 commit in-heap
NtUnmapViewOfSection: 0x04bb0000
The text was updated successfully, but these errors were encountered: