代码之家  ›  专栏  ›  技术社区  ›  GregC Benjamin Baumann

如何获取间歇崩溃devenv.com的调用堆栈?

  •  0
  • GregC Benjamin Baumann  · 技术社区  · 16 年前

    我有一个夜间构建DOS批处理脚本,它调用devenv.exe来构建解决方案文件。我间歇性地观察到devenv.com崩溃。我得到一个dw20.exe“分享你的痛苦”对话框。

    1)如果按下调试按钮,则不会出现通常的“选择调试器”窗口。相反,它什么也不做。

    2)如果我启动一个Visual Studio并尝试附加到devenv.com,它会说应用程序似乎死锁或等待操作完成。(我想是因为它是由dw20.exe调试的)

    你建议我怎么做才能得到一个像样的呼叫堆栈?

    编辑

    我成功地把windbg连接起来了。执行k命令。下面的内容是否有意义,可以传递给编译器团队?是否有方法查看当前异常?

    (e90.fb8): Break instruction exception - code 80000003 (!!! second chance !!!)
    eax=0012ccb8 ebx=04ed2750 ecx=0111bdc4 edx=5a57f004 esi=00000000 edi=14ed1000
    eip=77e4bef7 esp=0012ccb4 ebp=0012cd08 iopl=0         nv up ei pl zr na pe nc
    cs=001b  ss=0023  ds=0023  es=0023  fs=003b  gs=0000             efl=00000246
    *** ERROR: Symbol file could not be found.  Defaulted to export symbols for C:\WINDOWS\system32\kernel32.dll - 
    kernel32!RaiseException+0x3c:
    77e4bef7 5e              pop     esi
    Missing image name, possible paged-out or corrupt data.
    Missing image name, possible paged-out or corrupt data.
    Missing image name, possible paged-out or corrupt data.
    Missing image name, possible paged-out or corrupt data.
    0:000> k
    ChildEBP RetAddr  
    WARNING: Stack unwind information not available. Following frames may be wrong.
    0012cd08 5a760cf1 kernel32!RaiseException+0x3c
    0012cd58 5a766105 cslangsvc!InMemoryCompile+0x4c6c1
    0012cd7c 5a767375 cslangsvc!InMemoryCompile+0x51ad5
    0012cd84 5a767637 cslangsvc!InMemoryCompile+0x52d45
    00000000 00000000 cslangsvc!InMemoryCompile+0x53007
    

    我正在努力 !analyze -v 工作。

    0:000> !analyze -v
    *******************************************************************************
    *                                                                             *
    *                        Exception Analysis                                   *
    *                                                                             *
    *******************************************************************************
    
    ***** OS symbols are WRONG. Please fix symbols to do analysis.
    
    *************************************************************************
    ***                                                                   ***
    ***                                                                   ***
    ***    Your debugger is not using the correct symbols                 ***
    ***                                                                   ***
    ***    In order for this command to work properly, your symbol path   ***
    ***    must point to .pdb files that have full type information.      ***
    ***                                                                   ***
    ***    Certain .pdb files (such as the public OS symbols) do not      ***
    ***    contain the required information.  Contact the group that      ***
    ***    provided you with these symbols if you need this command to    ***
    ***    work.                                                          ***
    ***                                                                   ***
    ***    Type referenced: ntdll!_PEB                                    ***
    ***                                                                   ***
    *************************************************************************
    c0000005 Exception in ext.analyze debugger extension.
    PC: 014d7875  VA: 00000000  R/W: 0  Parameter: 0001003f
    

    编辑2

    我发现windbg有这些出色的SOS扩展。显然我可以用它们调试C编译器…

    0:000> !PrintException
    There is no current managed exception on this thread
    0:000> !clrstack
    OS Thread Id: 0x9fc (0)
    ESP       EIP     
    0012ee08 77e4bef7 [ComPlusMethodFrameGeneric: 0012ee08] Microsoft.Build.Tasks.Hosting.ICscHostObject.Compile()
    0012ee18 6be671ab Microsoft.Build.Tasks.Csc.CallHostObjectToExecute()
    0012ee48 6c0aed17 Microsoft.Build.Utilities.ToolTask.Execute()
    0012ee7c 6bcbb348 Microsoft.Build.BuildEngine.TaskEngine.ExecuteTask(ExecutionMode, System.Collections.Hashtable, Microsoft.Build.BuildEngine.BuildPropertyGroup, Boolean ByRef)
    0012ef24 6bcadf87 Microsoft.Build.BuildEngine.Target.ExecuteAllTasks(Microsoft.Build.BuildEngine.DependencyAnalysisResult, System.Collections.Hashtable, System.Collections.Hashtable, Microsoft.Build.BuildEngine.ItemBucket, System.Collections.ArrayList, Microsoft.Build.BuildEngine.BuildPropertyGroup)
    0012efa0 6bcac7c0 Microsoft.Build.BuildEngine.Target.ExecuteAllTasks()
    0012efec 6bcad05b Microsoft.Build.BuildEngine.Target.Build(System.Collections.IDictionary)
    0012f070 6bcacfa6 Microsoft.Build.BuildEngine.Target.Build(System.Collections.IDictionary)
    0012f0f4 6bcacfa6 Microsoft.Build.BuildEngine.Target.Build(System.Collections.IDictionary)
    0012f178 6bcacfa6 Microsoft.Build.BuildEngine.Target.Build(System.Collections.IDictionary)
    0012f1fc 6bc9b20d Microsoft.Build.BuildEngine.Project.DoBuild(System.String[], System.Collections.IDictionary, Boolean)
    0012f250 6bca2134 Microsoft.Build.BuildEngine.Engine.BuildProject(Microsoft.Build.BuildEngine.Project, System.String[], System.Collections.IDictionary, Microsoft.Build.BuildEngine.BuildSettings, Boolean)
    0012f2ac 6bc9af03 Microsoft.Build.BuildEngine.Project.Build(System.String[], System.Collections.IDictionary)
    0012f2c0 04711a36 Microsoft.VisualStudio.Build.ComInteropWrapper.ProjectShim.BuildTarget(System.String, System.Collections.IDictionary)
    0012f4f4 79f68cde [GCFrame: 0012f4f4] 
    0012f650 79f68cde [ComMethodFrame: 0012f650] 
    

    我仍在寻找一种检查异常内容的方法。!printException未找到任何异常。

    3 回复  |  直到 12 年前
        1
  •  1
  •   Michael Burr    16 年前

    您可以尝试安装 Debugging Tools for Windows 然后使用 -iae 选项(用于NTSD/CDB)或 -I 选项(对于windbg)使该包中的一个调试程序是jit/aedebug调试程序。

        2
  •  0
  •   GregC Benjamin Baumann    16 年前

    我终于为错误编译器找到了异常类型和调用堆栈。我保存了一个完整的转储文件(.dump/ma c:\mycsdump.dmp),然后像在vs2005中打开任何其他项目文件一样打开转储文件。按下运行按钮在调用堆栈窗口中生成以下内容:

    kernel32.dll!_RaiseException@16()  + 0x3c bytes 
    

    CSLangVS.DLL!allochost::throwoAutofMemoryException()+0x10字节
    CSLangVS.DLL!pageHeap::allocpages()+0xc1fd8字节
    CSLangVS.DLL!symtbl::growtable()+0x5b字节 CSLangVS.DLL!bsymmgr::addchild()+0x3b字节 CSLangVS.DLL!bsymmgr::createGlobalsym()+0x2ba字节 CSLangVS.DLL!bsymmgr::createMethod()+0xC字节
    CSLangVS.DLL!importer::importMethod()+0x1d9字节
    CSLangVS.DLL!导入程序::defineImportedType()+0x3b2字节 CSLangVS.DLL!clsdrec::PrepareAgregate()+0x8d字节 CSLangVS.DLL!编译器::forceAggstates()+0x8e字节
    CSLangVS.DLL!编译器::forceAggstates()+0x127字节 CSLangVS.DLL!编译器::ensurerepresse()+0x2e字节 CSLangVS.DLL!clsdec::checkfortypeerrors()+0x23字节
    CSLangVS.DLL!clsdec::checkfortypeerrors()+0x2ba字节
    CSLangVS.DLL!clsdec::checkfortypeerrors()+0x80字节
    CSLangVS.DLL!clsdrec::checkfortypeerrors()+0x8a字节
    CSLangVS.DLL!clsdrec::checkfortypeerrors()+0x8a字节
    CSLangVS.DLL!clsdrec::checkfortypeerrors()+0x8a字节
    CSLangVS.DLL!编译器::checkfortypeerrors()+0x100字节 CSLangVS.DLL!编译器::compileAll()+0x546字节 CSLangVS.DLL!编译器::compile()+0x7c字节 CSLangVS.DLL!CController::RunCompiler()+0x177字节 CSLangVS.DLL!ccontroller::compile()+0x16字节
    CSLangVS.DLL!ccsharprojectsite::buildProjectCore()+0x5a字节
    CSLangVS.DLL!cprojectsite::buildProject()+0x11字节
    DSPL!ccSharpBuildCompiler::DomainBuild()+0x88字节
    DSPL!ccscmsbuildHostObject::compile()+0x4e字节
    MySkWK.DLL!_ clrtocomworker@8()+0x171字节

        3
  •  0
  •   GregC Benjamin Baumann    16 年前

    这有点冗长,所以我会把它作为答复发出去。它来自Microsoft Connect网站,以响应我的问题。读者可能会发现它相关:

    日期:2009年5月7日星期四19:14:52-0700

    来自Microsoft Connect的问候!

    此通知是为您在Microsoft Connect站点提交的反馈项“夜间生成问题”(Bucket 365749762)生成的。

    感谢您报告在Visual Studio 2005中遇到的此问题,感谢您提供的转储文件!

    看起来问题出在cslangsvc.dll(进程内C编译器)中,devenv正在调用它来执行构建。

    我们对解决这个问题的建议是 尝试使用msbuild来代替夜间构建,因为这比自动化devenv/build更可靠。具体来说,您可能会避免这个特定的问题,因为msbuild将使用csc.exe进行编译,而不是使用cslangsvc.dll。

    我们不太可能再有一个VS2005版本来修复CSlangsvc问题,所以我正在解决这个bug无法修复的问题,但是如果您在使用msbuild时仍然看到问题,请重新激活它。

    再次感谢您提供有关此问题的所有信息!

    阿莱克斯·特纳 程序管理器 Visual C编译器