5

My C# application crashes with this window. It's a DirectX application that uses SharpDX.

I don't even know where to start to debug this? Any tips?

enter image description here

when i enable debugging of native code, the crash looks like this:

enter image description here

and the stack is:

ntdll.dll!77d1f8b1()    
[Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll] 
ntdll.dll!77d1f8b1()    
KernelBase.dll!7658149d()   
kernel32.dll!75c51194()     
kernel32.dll!75c51194()     
ntdll.dll!77d5b459()    
ntdll.dll!77d5b42b()    
ntdll.dll!77d5b3ce()    
ntdll.dll!77d10133()    
XAudio2_7.dll!61fb6b43()    
XAudio2_7.dll!61fa7fa2()    
XAudio2_7.dll!61fa79e9()    
XAudio2_7.dll!61fa8bb8()    
XAudio2_7.dll!61fa9492()    
[External Code] 
SharpDX.XAudio2.dll!SharpDX.XAudio2.Voice.DestroyVoice() Line 916 + 0x34 bytes  C#
clamp
  • 33,000
  • 75
  • 203
  • 299
  • 2
    0xc0000005 means it's an Access Violation at a specified address (0x5fea4c9). The address was not a null pointer (0x00000000), so it was native code trying to access a piece of memory that did not belong to it, was already deleted or otherwise unaccessible. Did you check the "most common sources" that are listed? – nvoigt Aug 01 '13 at 07:49
  • Are you using pointers? – Sriram Sakthivel Aug 01 '13 at 07:56
  • @SriramSakthivel not directly, but that directx library that i use, uses pointers. – clamp Aug 01 '13 at 07:56
  • @nvoigt: thx, that common sources are the PInvoke calls? – clamp Aug 01 '13 at 07:57
  • 1
    Look at your call stack at the time of the crash, see the last method toward the top that you recognise as yours and put a breakpoint just inside. When you hit the breakpoint step through to try to identify the line of offending code and then check what you are passing into it – Adam Knights Aug 01 '13 at 07:59
  • @clamp yes, PInvoke, COM calls, anything that calls into native code. I don't know SharpDX, but if it uses DirectX, it will have to do all this. – nvoigt Aug 01 '13 at 07:59
  • @Knightsy: there is no callstack, if i press ok the application terminates, if i press continue it continues. – clamp Aug 01 '13 at 08:00
  • It smells bad, nothing to do with .NET directly. Probably a bug in SharpDX (or DirectX, but less likely). You should create a dump file and hand it to the SharpDX provider. – Simon Mourier Aug 01 '13 at 09:08
  • This exception typically occurs when unmanaged code corrupts managed Heap, as @SimonMourier said you can report to SharpDX provider – Sriram Sakthivel Aug 01 '13 at 09:12
  • @SimonMourier how do i create such a dump? – clamp Aug 01 '13 at 09:43
  • google on "create a dump file with visual studio". Also check this out: http://sharpdx.com/forum/4-general/1774-how-to-debug-a-sharpdxexception – Simon Mourier Aug 01 '13 at 10:00

1 Answers1

1

You are using a wrong version of the SharpDX.XAudio2.dll. This means that you app, for example, is x86 and it's trying to use a x64 version. You must load the proper version of the dll.

Stathis Andronikos
  • 1,259
  • 2
  • 25
  • 44