启动时应用程序崩溃,无异常引发

时间:2013-03-20 15:08:29

标签: debugging windbg

我正在尝试跟踪从生产启动时导致我的应用程序启动时崩溃的原因。从Visual Studio中的调试启动时,此C#/。NET Windows应用程序启动没有任何问题,结果如预期。同一应用程序的早期版本也已在其他客户端计算机上部署并运行 从Windows Error Reporting and CLR integration中的解释中读取,似乎我的问题来自于汇编ExcelInterop中的方法。

Error Bucket , type 0      
Event Name : CLR20r3
Answer : Non available
CAB ID : 0

Problem signature : 
P1 : afiv2.exe          ' my application
P2 : 0.19.4826.21736
P3 : 51489aa0
P4 : ExcelInterop       ' my library
P5 : 1.0.0.0
P6 : 514878d9
P7 : 13             ' MethodDescr ???
P8 : 56
P9 : PSZQOADHX1U5ZAHBHOHGHLDGIY4QIXHX
P10 : 

尝试找到我使用windbg.exe菜单启动应用程序的错误 - >文件 - >打开可执行文件(我第一次使用windbg),但控制台显示符号搜索路径无效。 根据{{​​3}},我使用以下命令序列恢复了符号路径:

!sym noisy    
.symfix
.reload -f

第一次试用加载SOS导致“无法找到模块mscorwks”错误,Debugging .net using SOS解决了这部分问题:

sxe ld:mscorlib
g
.loadby sos mscorwks
!token2ee ExcelInterop 06000013

我预计最后一个命令将确定与事件报告中的数字相关联的methodDesc,但没有返回任何内容。

我现在感到陷入了一种迷宫。还有什么办法可以找到导致崩溃的原因?


windbg会话详情

<pre>
Microsoft (R) Windows Debugger Version 6.11.0001.404 AMD64
Copyright (c) Microsoft Corporation. All rights reserved.

CommandLine: C:\Users\spel\AppData\Local\Apps\2.0\49619QZC.EY2\B8TZ2OKL.D49\afiv..tion_0000000000000000_0000.0016_22cd035f134c19e0\AFIv2.exe
Symbol search path is: *** Invalid ***
****************************************************************************
* Symbol loading may be unreliable without a symbol search path.           *
* Use .symfix to have the debugger choose a symbol path.                   *
* After setting your symbol path, use .reload to refresh symbol locations. *
****************************************************************************
Executable search path is: 
ModLoad: 00000000`00290000 00000000`0048e000   AFIv2.exe
ModLoad: 00000000`76f00000 00000000`770a9000   ntdll.dll
ModLoad: 000007fe`f89e0000 000007fe`f8a4f000   C:\Windows\SYSTEM32\MSCOREE.DLL
ModLoad: 00000000`76820000 00000000`7693f000   C:\Windows\system32\KERNEL32.dll
ModLoad: 000007fe`fd450000 000007fe`fd4bb000   C:\Windows\system32\KERNELBASE.dll
(121c.1494): Break instruction exception - code 80000003 (first chance)
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for ntdll.dll - 
ntdll!CsrSetPriorityClass+0x40:
00000000`76facb60 cc              int     3
0:000> .path
           ^ Syntax error in '.path'
0:000> .winpath
              ^ Syntax error in '.winpath'
0:000> .sympath
Symbol search path is: <empty>
Expanded Symbol search path is: <empty>
0:000> !sym noisy
noisy mode - symbol prompts on
0:000> .symfix
DBGHELP: Symbol Search Path: cache*C:\ProgramData\dbg\sym;SRV*http://msdl.microsoft.com/download/symbols
0:000> .reload -f
Reloading current modules
.
SYMSRV:  C:\ProgramData\dbg\sym\AFIv2.pdb\7C97CCD8E9CD4E26B6039C225A56890B15\AFIv2.pdb not found
SYMSRV:  C:\ProgramData\dbg\sym\AFIv2.pdb\7C97CCD8E9CD4E26B6039C225A56890B15\AFIv2.pdb not found
SYMSRV:  http://msdl.microsoft.com/download/symbols/AFIv2.pdb/7C97CCD8E9CD4E26B6039C225A56890B15/AFIv2.pdb not found
DBGHELP: C:\Users\spel\AppData\Local\Apps\2.0\49619QZC.EY2\B8TZ2OKL.D49\afiv..tion_0000000000000000_0000.0016_22cd035f134c19e0\AFIv2.pdb - file not found
DBGHELP: C:\Users\spel\Documents\GCRH complet\trunk\AFI_CS\IHM\obj\Debug\AFIv2.pdb cached to C:\ProgramData\dbg\sym\AFIv2.pdb\7C97CCD8E9CD4E26B6039C225A56890B15\AFIv2.pdb
*** WARNING: Unable to verify checksum for AFIv2.exe
DBGHELP: AFIv2 - private symbols & lines 
         C:\ProgramData\dbg\sym\AFIv2.pdb\7C97CCD8E9CD4E26B6039C225A56890B15\AFIv2.pdb
.
SYMSRV:  C:\ProgramData\dbg\sym\kernel32.pdb\C4312728BA1F4691955E99B2E026FAFC2\kernel32.pdb not found
SYMSRV:  kernel32.pdb from http://msdl.microsoft.com/download/symbols: 668117 bytes - copied         
DBGHELP: C:\ProgramData\dbg\sym\kernel32.pdb\C4312728BA1F4691955E99B2E026FAFC2\kernel32.pdb already cached
DBGHELP: KERNEL32 - public symbols  
         C:\ProgramData\dbg\sym\kernel32.pdb\C4312728BA1F4691955E99B2E026FAFC2\kernel32.pdb
.
DBGHELP: ntdll - public symbols  
         C:\ProgramData\dbg\sym\ntdll.pdb\15EB43E23B12409C84E3CC7635BAF5A32\ntdll.pdb
.
SYMSRV:  C:\ProgramData\dbg\sym\mscoree.pdb\FB53EF9DD104439E9903F0B34128E0392\mscoree.pdb not found
SYMSRV:  mscoree.pdb from http://msdl.microsoft.com/download/symbols: 294166 bytes - copied         
DBGHELP: C:\ProgramData\dbg\sym\mscoree.pdb\FB53EF9DD104439E9903F0B34128E0392\mscoree.pdb already cached
DBGHELP: MSCOREE - public symbols  
         C:\ProgramData\dbg\sym\mscoree.pdb\FB53EF9DD104439E9903F0B34128E0392\mscoree.pdb
.
SYMSRV:  C:\ProgramData\dbg\sym\kernelbase.pdb\91C72371DD43448192B7B46F5ED10AA02\kernelbase.pdb not found
SYMSRV:  kernelbase.pdb from http://msdl.microsoft.com/download/symbols: 231949 bytes - copied         
DBGHELP: C:\ProgramData\dbg\sym\kernelbase.pdb\91C72371DD43448192B7B46F5ED10AA02\kernelbase.pdb already cached
DBGHELP: KERNELBASE - public symbols  
         C:\ProgramData\dbg\sym\kernelbase.pdb\91C72371DD43448192B7B46F5ED10AA02\kernelbase.pdb

0:000> .loadby sos mscorwks
Unable to find module 'mscorwks'
0:000> sxe ld:mscorlib
0:000> g
ModLoad: 000007fe`f35e0000 000007fe`f44bc000   C:\Windows\assembly\NativeImages_v2.0.50727_64\mscorlib\51a23687fdafc32b697f5a719e364651\mscorlib.ni.dll
ntdll!ZwMapViewOfSection+0xa:
00000000`76f5159a c3              ret
0:000> .loadby sos mscorwks
0:000> !token2ee afi 06000013
SYMSRV:  C:\ProgramData\dbg\sym\mscorwks.pdb\E5BD5716E1D64C1C86661A5AAF7DD9251\mscorwks.pdb not found
SYMSRV:  mscorwks.pdb from http://msdl.microsoft.com/download/symbols: 2000973 bytes - copied         
DBGHELP: C:\ProgramData\dbg\sym\mscorwks.pdb\E5BD5716E1D64C1C86661A5AAF7DD9251\mscorwks.pdb already cached
DBGHELP: mscorwks - public symbols  
         C:\ProgramData\dbg\sym\mscorwks.pdb\E5BD5716E1D64C1C86661A5AAF7DD9251\mscorwks.pdb
0:000> !token2ee ExcelInterop 06000013
</pre>

1 个答案:

答案 0 :(得分:1)

您可以设置sxe clr,这会在第一次出现异常时中断。然后执行!clrstack会给出调用堆栈。

Methoddsec 06000013可能因JIT而异,所以你可能会看到不会给你带来结果的指针。

HTH