DynamoRIO / DynamoRIO/dynamorio

CRASH private sspicli.dll from newer dbghelp.dll at process exit

Open
#963 1 comment 0 reactions 0 assignees View on GitHub
Bug-DRCrash Migrated Priority-High
Dominant language
C
Stars
3.2k
Forks
629
Avg merge
2d 15h
Merged PRs (30d)
31

Description

_From [bruen...@google.com](https://code.google.com/u/109494838902877177630/) on October 30, 2012 14:33:31_

for drmem issue #1068 I changed drmem to use VS dbghelp.dll. at exit time of -replace_malloc
tests/malloc.exe:

28:

xref issue #383 # ChildEBP RetAddr
00 1d69d2b8 65a35b4e ntdll!NtRaiseHardError+0x12
01 1d69d308 659ff6dd dynamorio!nt_messagebox+0xfe [d:\derek\dr\git\src\core\win32\ntdll.c @ 3403]
02 1d69d330 658753c4 dynamorio!debugbox+0x4d [d:\derek\dr\git\src\core\win32\os.c @ 3723]
03 1d69db4c 65871f9d dynamorio!notify+0x1e4 [d:\derek\dr\git\src\core\utils.c @ 1899]
04 1d69dbb4 6587391b dynamorio!deadlock_avoidance_lock+0x34d [d:\derek\dr\git\src\core\utils.c @ 594]
05 1d69dbcc 6590df77 dynamorio!read_lock+0x1db [d:\derek\dr\git\src\core\utils.c @ 1181]
06 1d69dc10 65a2bdea dynamorio!check_in_last_thread_vm_area+0x1e7 [d:\derek\dr\git\src\core\vmareas.c @ 7976]
07 1d69dc5c 65a29e1f dynamorio!check_internal_exception+0x1fa [d:\derek\dr\git\src\core\win32\callback.c @ 4693]
08 1d69e088 1d6d1bec dynamorio!intercept_exception+0x123f [d:\derek\dr\git\src\core\win32\callback.c @ 5050]
=>
0:000> kn
**\* Stack trace for last set context - .thread/.cxr resets it
# ChildEBP RetAddr
00 1d69e6a4 77d74697 ntdll!RtlSafeRemoveEntryList+0x10
01 1d69e6e4 77d8dae0 ntdll!RtlDeleteCriticalSection+0x8e
02 1d69e6f4 7543ae23 ntdll!RtlDeleteResource+0xf
03 1d69e70c 7543a2ec SspiCli!SecUnloadPackages+0x8e
04 1d69e718 7543a3aa SspiCli!ProcDetach+0x55
05 1d69e728 7543a3ee SspiCli!_DllMain+0x36
06 1d69e748 65a63a0f SspiCli!DllMain+0x3b
07 1d69e76c 65946309 dynamorio!privload_call_entry+0x14f [d:\derek\dr\git\src\core\win32\loader.c @ 1230]
08 1d69e78c 65a62893 dynamorio!privload_unload+0x279 [d:\derek\dr\git\src\core\loader_shared.c @ 523]
09 1d69e7b0 65946315 dynamorio!privload_unload_imports+0x173 [d:\derek\dr\git\src\core\win32\loader.c @ 822]
0a 1d69e7cc 659452d4 dynamorio!privload_unload+0x285 [d:\derek\dr\git\src\core\loader_shared.c @ 525]
0b 1d69e7d8 657c06ad dynamorio!loader_exit+0x24 [d:\derek\dr\git\src\core\loader_shared.c @ 155]
0c 1d69e800 657c0d46 dynamorio!dynamo_shared_exit+0x23d [d:\derek\dr\git\src\core\dynamo.c @ 964]
0d 1d69e828 657c0b9b dynamorio!dynamo_process_exit_cleanup+0x196 [d:\derek\dr\git\src\core\dynamo.c @ 1222]
0e 1d69e838 659ce5f2 dynamorio!dynamo_process_exit+0x12b [d:\derek\dr\git\src\core\dynamo.c @ 1281]
0f 1d69e848 1d63a940 dynamorio!cleanup_and_terminate+0x4b [D:\derek\dr\git\build_x86_dbg\core\CMakeFiles\dynamorio.dir\x86\x86.asm.obj.s @ 1269]
0:000> U eip-10 L10
ntdll!RtlSafeRemoveEntryList:
77d745c0 8bff mov edi,edi
77d745c2 55 push ebp
77d745c3 8bec mov ebp,esp
77d745c5 8b5508 mov edx,[ebp+0x8]
77d745c8 8b4204 mov eax,[edx+0x4]
77d745cb 8b0a mov ecx,[edx]
77d745cd 56 push esi
77d745ce 8b30 mov esi,[eax]
77d745d0 3b7104 cmp esi,[ecx+0x4]
0:000> r
Last set context:
eax=00f66878 ebx=00000001 ecx=012500b8 edx=01210bf8 esi=01210bf8 edi=754503a0
eip=77d745d0 esp=1d69e6a0 ebp=1d69e6a4 iopl=0 nv up ei pl nz na po nc
cs=0023 ss=002b ds=002b es=002b fs=0053 gs=002b efl=00010206
ntdll!RtlSafeRemoveEntryList+0x10:
77d745d0 3b7104 cmp esi,[ecx+0x4] ds:002b:012500bc=????????
0:000> dd 012500b8
012500b8 ???????? ???????? ???????? ????????

% grep -i sspi malloc.exe.9904.00000000/malloc.exe.0.8164.html
privload_process_imports: RPCRT4.dll imports from SspiCli.dll
privload_process_imports: SECHOST.dll imports from RPCRT4.dll
privload_map_name: mapped API-set dll API-MS-WIN-Service-Core-L1-1-0.dll to sechost.dll
privload_process_imports: ADVAPI32.dll imports from API-MS-WIN-Service-Core-L1-1-0.dll
privload_process_imports: dbghelp.dll imports from ADVAPI32.dll

looking at my HEAD builds, sspicli isn't even loaded b/c the old dbghelp
didn't import from advapi32.dll.
ok it did but delay-load w/ just a few Reg routines. also delay-load from rpcrt4.
c:/Program\ Files\ (x86)/Debugging\ Tools\ for\ Windows/dbghelp.dll
does regular import from both advapi32 and rpcrt4.

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.