none
Crash on Exit with StubRareDisableTHROW ?? RRS feed

  • Question

  • I have an application that is crashing on exit. I will explain the details.

    The application is mostly native, with a bit of managed code. It's compiled with /clr. I would say about 95% of the code is native.

    • It only crashes on Windows XP 32 bit. It crashes on both SP 2 and SP 3.
    • We have a custom tool our company uses to collect Crash Error Reports, that we can use for post mortem debugging.
    • It is a large application that can target DirectX, or Open GL, or a proprietary Graphics driver. The crash I'm seeing happens when we use our proprietary graphics driver.
    • It crashes on exit.

    Here is a very typical callstack:

    Module Function Offset
    kernel32 RaiseException 0x53
    mscorwks COMPlusThrowBoot 0x4A
    mscorwks StubRareDisableTHROWWorker 0x26
    mscorwks StubRareDisableTHROW 0x9
    msvcr90 _cinit 0xF5
    msvcr90 _cexit 0xB
    msvcr90 __p__tzname 0x106
    msvcr90 _CRTDLL_INIT 0x1E
    ntdll LdrpCallInitRoutine 0x14
    ntdll LdrShutdownProcess 0x14F
    kernel32 _ExitProcess 0x42
    kernel32 ExitProcess 0x14
    mscorwks SafeExitProcess 0x157
    mscorwks DisableRuntime 0xDC
    d3dx9_39 _NA_ 0x1D0000
    mscoree _CorExeMain 0x2C
    kernel32 BaseProcessStart 0x23

    Note the extremely high offset value for d3dx9_39.dll.

    All the modules above are from Microsoft. We are running into this quite commonly, and don't want to ship the application with this crash on exit problem.

    I've got a vaque understanding that it has to do something with accessing the CLR after it's already shut down. But I'm not sure.

    Any help would be greatly appreciated.

    Thanks!

    Chris J.

     

    • Edited by Chris P Johnson Monday, January 26, 2009 5:58 PM spelling fixes.
    Monday, January 26, 2009 5:27 PM

Answers

  • It goes wrong long before that.  The CRT is initializing again while it is shutting down.  The CLR correctly drops the bomb, it can't be restarted after it was shutdown.  There's no hint in the stack trace to explain why the CRT is doing this.  But that's the kind of Heisenbug you'd get with unmanaged code.
    Hans Passant.
    • Marked as answer by Zhi-Xin Ye Monday, February 2, 2009 9:25 AM
    Tuesday, January 27, 2009 2:45 AM
    Moderator

All replies

  • It goes wrong long before that.  The CRT is initializing again while it is shutting down.  The CLR correctly drops the bomb, it can't be restarted after it was shutdown.  There's no hint in the stack trace to explain why the CRT is doing this.  But that's the kind of Heisenbug you'd get with unmanaged code.
    Hans Passant.
    • Marked as answer by Zhi-Xin Ye Monday, February 2, 2009 9:25 AM
    Tuesday, January 27, 2009 2:45 AM
    Moderator
  • That's interesting. The CRT is initializing on shutdown?
    What can cause that? 

    Chris J.
    Tuesday, January 27, 2009 11:44 AM
  • Focus on the stack trace getting into _cinit().  No idea really, this is not a good forum to ask questions about the C/C++ runtime.
    Hans Passant.
    Tuesday, January 27, 2009 12:18 PM
    Moderator
  • Got it, I wonder if the mods can move this to the other forum?
    Thanks!
    Tuesday, January 27, 2009 2:59 PM