Skip to content
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

add -core_at_* runtime options #134

Open
derekbruening opened this issue Nov 28, 2014 · 6 comments
Open

add -core_at_* runtime options #134

derekbruening opened this issue Nov 28, 2014 · 6 comments

Comments

@derekbruening
Copy link
Contributor

From derek.br...@gmail.com on December 10, 2010 17:57:56

PR 427729

since our -pause_at_* options won't work well with server apps that close
stdin (plus PR 425335), and our inf-loop alternative is a one-time-only,
we should add an option to create a livedump at each error, w/ some max.

xref:

Original issue: http://code.google.com/p/drmemory/issues/detail?id=134

@derekbruening
Copy link
Contributor Author

From bruen...@google.com on August 10, 2011 08:09:51

Issue 549 has been merged into this issue.

@derekbruening
Copy link
Contributor Author

From bruen...@google.com on September 22, 2011 13:17:17

we'll want the core to be the app context: xref issue #600

@derekbruening
Copy link
Contributor Author

From bruen...@google.com on February 17, 2013 08:38:09

Labels: GoodContrib

@derekbruening
Copy link
Contributor Author

From bruen...@google.com on November 12, 2013 09:55:40

xref issue #1378

@derekbruening
Copy link
Contributor Author

From bruen...@google.com on May 05, 2014 18:10:41

For debugging strange self-interpretation bugs on the bots that I cannot reproduce even when I'm on the bot, I'm going to need to get a core dump so I'm going to implement at least some of this feature. I split minidumps off again as initially I will only support ldmps (invoking dbghelp to get minidumps within the process is not working: see issue #549 ).

Owner: bruen...@google.com

@derekbruening
Copy link
Contributor Author

From bruen...@google.com on May 05, 2014 20:46:57

*** TODO w/o app context, or at least CONTEXT local var, ldmp is kind of hard to use

ChildEBP RetAddr

00 1a76d834 6d0adb37 dynamorio!os_dump_core_live_dump+0x26a [d:\derek\dr\git\src\core\win32\os.c @ 7069]
01 1a76d84c 6d091444 dynamorio!os_dump_core+0x57 [d:\derek\dr\git\src\core\win32\os.c @ 7279]
02 1a76d858 73a134cf dynamorio!dr_create_memory_dump+0x14 [d:\derek\dr\git\src\core\x86\instrument.c @ 2265]
03 1a76d888 73a0dc79 drmemorylib!dump_core+0x2f [d:\derek\drmemory\git\src\drmemory\report.c @ 2586]
04 1a76dab4 73a0c288 drmemorylib!report_error+0x1959 [d:\derek\drmemory\git\src\drmemory\report.c @ 2794]
05 1a76dcdc 73840de4 drmemorylib!report_unaddressable_access+0xe08 [d:\derek\drmemory\git\src\drmemory\report.c @ 3017]
06 1a76e3d4 73845637 drmemorylib!handle_mem_ref_internal+0x5584 [d:\derek\drmemory\git\src\drmemory\readwrite.c @ 4882]
07 1a76e650 7381e9dd drmemorylib!check_mem_opnd+0x2ca7 [d:\derek\drmemory\git\src\drmemory\readwrite.c @ 5054]
08 1a76ed08 73830233 drmemorylib!slow_path_with_mc+0x39ed [d:\derek\drmemory\git\src\drmemory\readwrite.c @ 3486]
09 1a76eeb0 1a8d003a drmemorylib!slow_path+0x63 [d:\derek\drmemory\git\src\drmemory\readwrite.c @ 3706]
WARNING: Frame IP not in any known module. Following frames may be wrong.
0a 1a76eebc 00000000 0x1a8d003a

Sure, I can use some windbg tricks to manually create a CONTEXT and
manually copy the mcontext fields over: but that's a pain. I propose,
until we have issue #600, creating a local var CONTEXT.

Here's an example w/ an uninit:

bin/drmemory.exe -dump_at_error_mask 2 -dr d:/derek/dr/git/exports -batch -- tests/registers.exe

Dr.M Error #20: UNINITIALIZED READ: reading register eax
Dr.M # 0 mmx_test [d:\derek\drmemory\git\src\tests\registers.c:390]
Dr.M # 1 main [d:\derek\drmemory\git\src\tests\registers.c:433]
Dr.M Note: @0:00:00.651 in thread 5752
Dr.M Note: instruction: cmp %eax $0x00000078
Dr.M Note: memory dump created at D:\derek\drmemory\git\build_x86_dbg\logs\dynamorio\registers.exe.6752.00000015.ldmp

ldmp logs/dynamorio/registers.exe.6752.00000015.ldmp cygpath -w "${DYNAMORIO_HOME}/bin32/dummy.exe"

windbg on dummy.exe:

0:000> $><d:\derek\dr\git\src\tools\windbg-scripts\load_syms
0:000> ~0s; kn
eax=00000000 ebx=00000000 ecx=00000200 edx=1f16ce98 esi=00001678 edi=73ca612c
eip=6f01357a esp=1f1bdeb0 ebp=1f1be37c iopl=0 nv up ei pl nz na pe nc
cs=0023 ss=002b ds=002b es=002b fs=0053 gs=002b efl=00000206
dynamorio!os_dump_core_live_dump+0x26a:
6f01357a 83c404 add esp,4

ChildEBP RetAddr

00 1f1bdeec 6f013d08 dynamorio!os_dump_core_live_dump+0x26a [d:\derek\dr\git\src\core\win32\os.c @ 7064]
01 1f1bdf04 6f005650 dynamorio!os_dump_core_live+0x38 [d:\derek\dr\git\src\core\win32\os.c @ 7312]
02 1f1bdf14 73a1384c dynamorio!dr_create_memory_dump+0x20 [d:\derek\dr\git\src\core\x86\instrument.c @ 2268]
03 1f1be37c 73a0dc9e drmemorylib!report_core_dump+0x35c [d:\derek\drmemory\git\src\drmemory\report.c @ 2615]
04 1f1be5ac 73a26ae5 drmemorylib!report_error+0x197e [d:\derek\drmemory\git\src\drmemory\report.c @ 2796]
05 1f1be600 7384639a drmemorylib!report_undefined_read+0x65 [d:\derek\drmemory\git\src\drmemory\report.c @ 3036]
06 1f1be660 7381ef2e drmemorylib!check_register_defined+0x46a [d:\derek\drmemory\git\src\drmemory\readwrite.c @ 5082]
07 1f1bed08 73830233 drmemorylib!slow_path_with_mc+0x3f3e [d:\derek\drmemory\git\src\drmemory\readwrite.c @ 3506]
08 1f1beeb0 1f32003a drmemorylib!slow_path+0x63 [d:\derek\drmemory\git\src\drmemory\readwrite.c @ 3706]
WARNING: Frame IP not in any known module. Following frames may be wrong.
09 1f1beef0 6efbeb50 0x1f32003a
0a 1f1bef04 73a938bd dynamorio!heap_free+0x40 [d:\derek\dr\git\src\core\heap.c @ 3710]
0b 1f1bef20 00000000 drmemorylib!replace_native_xfer_target+0x3d [d:\derek\dr\git\src\ext\drwrap\drwrap.c @ 1346]
0:000> .frame 3
03 1f1be37c 73a0dc9e drmemorylib!report_core_dump+0x35c [d:\derek\drmemory\git\src\drmemory\report.c @ 2615]
0:000> dv
etp = 0x1f1be5c8
flags = 2
id = 0x14
mc = 0x1f1bed60
spec = struct _dr_memory_dump_spec_t
ldmp_path = char [260] "???"
cxt = struct _CONTEXT
0:000> .cxr @@(&cxt)
eax=00000038 ebx=7efde000 ecx=0042ff00 edx=00000000 esi=00000000 edi=00000000
eip=002d154a esp=0042fef8 ebp=0042ff10 iopl=0 nv up ei ng nz na pe nc
cs=0023 ss=002b ds=cccc es=cccc fs=cccc gs=cccc efl=00000286
registers!mmx_test+0x5a:
002d154a 83f878 cmp eax,78h
0:000> kn
*** Stack trace for last set context - .thread/.cxr resets it

ChildEBP RetAddr

00 0042ff10 002d15ae registers!mmx_test+0x5a [d:\derek\drmemory\git\src\tests\registers.c @ 390]
01 0042ff18 002d229b registers!main+0x4e [d:\derek\drmemory\git\src\tests\registers.c @ 435]
02 0042ff60 7636338a registers!__tmainCRTStartup+0x10b [f:\dd\vctools\crt_bld\self_x86\crt\src\crt0.c @ 278]
03 0042ff6c 77b59f72 kernel32!BaseThreadInitThunk+0xe
04 0042ffac 77b59f45 ntdll!__RtlUserThreadStart+0x70
05 0042ffc4 00000000 ntdll!_RtlUserThreadStart+0x1b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant