System.AccessViolationException from unmanaged code?

前端 未结 2 726
攒了一身酷
攒了一身酷 2020-12-30 18:16

I\'m writing this library that implements some basic audio player features in C++/CLI via the Media Foundation framework that will be consumed by managed code. I can play a

2条回答
  •  暖寄归人
    2020-12-30 18:48

    Capture a crash dump, then load it into VS 2010 or WinDbg for analysis, and all shall be revealed. VS 2010 will be easier, but WinDbg might be more effective.

    Since using WinDbg is the more complicated option I'll elaborate on that (choose the 32-bit or 64-bit versions of the following according to your target platform):

    • Download and install Debugging Tools for Windows
    • Configure debugging symbols for the Microsoft Symbol Server

      .sympath srv**http://msdl.microsoft.com/download/symbols

    • Load the crash dump file into WinDbg (File->Open Crash Dump...)

    • Configure debugging symbols for your modules

      .sympath+

    • Load SOS extensions into WinDbg

      .loadby sos mscorwks; * fw 2-3.5

      or

      .loadby sos clr; * fw 4

    • Download, extract and load SOSEX extensions into WinDbg

      .load \sosex

    • Let WinDbg do the analysis

      !analyze -v

    • Use SOSEX to show the current thread stack (including both managed and unmanaged frames)

      !mk

    This will most likely answer your questions.

提交回复
热议问题