C#的windows app程序,不定时的crash.
打开pageheap /full 后用adplus生成full dump。
用!analyze -v 分析结果如下,好像应该是heap corruption.
MODULE_NAME: heap_corruption
IMAGE_NAME: heap_corruption
DEBUG_FLR_IMAGE_TIMESTAMP: 0
STACK_COMMAND: ~11s; .ecxr ; kb
FAILURE_BUCKET_ID: heap_corruption!heap_corruption_80000003_HEAP_CORRUPTION
BUCKET_ID: APPLICATION_FAULT_HEAP_CORRUPTION_STATUS_BREAKPOINT_heap_corruption!heap_corruption
但是很奇怪的是,载入sos后用!clrstack看不到调用堆栈,报了如下信息:
OS Thread Id: 0xf4 (11)Failed to start stack walk: 80004005
也就是说改线程上并没有运行.net的code。用kb看了一下call stack,
ChildEBP RetAddr Args to Child 0cc2f9f8 7c994a15 00000008 18649000 00000000 ntdll!DbgBreakPoint0cc2fa10 7c9a9354 00000008 7c9a9594 01151000 ntdll!RtlApplicationVerifierStop+0x1600cc2fa8c 7c9aa517 01151000 00000004 18649000 ntdll!RtlpDphReportCorruptedBlock+0x920cc2fab0 7c9aa71a 01151000 01000002 00000020 ntdll!RtlpDphNormalHeapFree+0x2e0cc2fb00 7c9ad7bb 01150000 01000002 18649000 ntdll!RtlpDebugPageHeapFree+0x790cc2fb74 7c989e1c 01150000 01000002 18649000 ntdll!RtlDebugFreeHeap+0x2c0cc2fc5c 7c967553 01150000 01000002 18649000 ntdll!RtlFreeHeapSlowly+0x370cc2fd2c 7698d01c 01150000 00000000 18649000 ntdll!RtlFreeHeap+0xf90cc2fd40 770d5491 76a96034 18649000 76a96034 ole32!CRetailMalloc_Free+0x1c0cc2fd60 770d5427 00000000 76a9680c 770d5481 oleaut32!APP_DATA::FlushMemCache+0x280cc2fd6c 770d5481 76992b5c 77151078 00000000 oleaut32!ReleaseAppData+0x560cc2fd70 76992b5c 77151078 00000000 7c8097d0 oleaut32!CReleaseAppData::Release+0x50cc2fd88 770d16af 00000000 00000000 00000003 ole32!CoSetState+0x800cc2fec4 770d15a8 770d0000 00000003 00000000 oleaut32!DllMain+0x760cc2fee4 7c94118a 770d0000 00000003 00000000 oleaut32!_DllMainCRTStartup+0x520cc2ff04 7c953a23 770d1560 770d0000 00000003 ntdll!LdrpCallInitRoutine+0x140cc2ff7c 7c80c126 7c800000 7c940000 0ab5b000 ntdll!LdrShutdownThread+0xd70cc2ffb4 7c80b718 00000000 7c800000 7c940000 kernel32!ExitThread+0x3e0cc2ffec 00000000 77e36c7d 0ab5b000 00000000 kernel32!BaseThreadStart+0x3c
请教高手,出问题的线程(Thread Id: 0xf4 (11))并不是我的程序生成的,难道是.net生成的GC管理线程?
如果是.net生成的线程的,为什么会发生heapcorruption异常呢?
补充一下,还有一点比较奇怪,一般来说打开pageheap /full后如果是heap操作越界的话,会出现accessviolation异常,
而且因为程序中并没有处理,应该是2nd chance exception。但是我用adplu dump出来的都是1st chance exception。
而且这4个exception都发生在一个线程(0xf4 (11)))