views:

360

answers:

1

Hi !

I wrote an application in C++/CLR. It uses a native lib/dll. On rare occasions, it crashes insider this native dll. I then get a stacktrace, but only up to the managed part, the inside native part is left out. Is there a way to let it display the whole stacktrace?

I made the following test: I added a line of code inside the native dll that makes it always crash. When I run it by doubleclicking the exe, I get a stacktrace of the managed part like before. If I run it from VS2008 with a debugger attached (just pressing F5), and it crashes, I see the whole stacktrace, the managed and the unmanaged parts.

Since the actuall bug happens so rarely, I'ld like to add something to my application that somehow displays the whole stacktrace without having the users to install und run it through VS. Is there a way to do that?

Thx Marc

A: 

Using Sysinternals Process Explorer (http://technet.microsoft.com/de-de/sysinternals/bb896653.aspx), you can look at the stack of any process that is currently running. Maybe this will help you ...

Jan
While this is definitely an interesting programm I wasn't aware of, when I look at the stack of a crashed programm, no matter if it's a managed or native application, I get the following stacktrace of the main thread:(see stacktrace in the next comment)which isn't helping me. :(
marc40000
wow64cpu.dll!TurboDispatchJumpAddressEnd+0x690wow64cpu.dll!TurboDispatchJumpAddressEnd+0xe3wow64.dll!Wow64SystemServiceEx+0x1cewow64.dll!Wow64LdrpInitialize+0x429ntdll.dll!RtlResetRtlTranslations+0x1b08ntdll.dll!RtlResetRtlTranslations+0xc63ntdll.dll!LdrInitializeThunk+0xentdll.dll!NtWaitForMultipleObjects+0x15kernel32.dll!WaitForMultipleObjectsEx+0x8ekernel32.dll!WaitForMultipleObjects+0x18kernel32.dll!CheckForReadOnlyResource+0x175kernel32.dll!CheckForReadOnlyResource+0x212kernel32.dll!UnhandledExceptionFilter+0x163kernel32.dll!UnhandledExceptionFilter+0xe0
marc40000
ntdll.dll!RtlKnownExceptionFilter+0xb7ntdll.dll!RtlInitializeExceptionChain+0x36
marc40000
Sorry, I had hoped you can see something in the stack trace that helps you. Maybe one of the other threads holds a clue, if you use multiple threads in your program
Jan
Yes there are multiple threads - but all their stacktraces look pretty similiar to the above. :/
marc40000
You're looking at the 64-bit stack, you want the emulated 32-bit stack where your code is running. This bug in Process Explorer is fixed in newer versions.
BCoates