none
DMP stack trace shows thread crashed at ZwGetContextThread RRS feed

  • Question

  • This is a WCF service hosted in a windows service, running for months at a time
    The WCF service calls into a native MFC based dll, which does its work and returns either an unmanaged buffer or a file
    The buffer or file is returned in an unmanaged memory stream
    Its working at several locations reliably, for a number of years, where some sites run for 5 or 6 months without a server reboot
    It might be described as this;
    WCF Service
         Mixed mode shim
             Native DLL doing SQL work and packaging results in memory or zip files

    At one server, on about a one month interval it has started crashing with this state in the DMP file
    Ive looked at multiple DMP, they are very similar


    -------------------------------------------------------------

    This dump file has an exception of interest stored in it.
    The stored exception information can be accessed via .ecxr.
    (af4.15c0): CLR exception - code e0434352 (first/second chance not available)
    ntdll!ZwGetContextThread+0xa:
    00000000`77a91f8a c3              ret

    The call stack for the crashing thread;

    : Args to Child                                                           : Call Site
    : 00000000`00000000 00000000`00000001 00000000`1b820158 00000000`00000000 : ntdll!ZwGetContextThread+0xa
    : 00000000`77a99fc0 00000000`0000ffff 00000000`0000007c 00000000`00000000 : KERNELBASE!HeapDestroy+0xa
    : 00000000`0000ffff 00000000`0000007c 00000000`00000000 00000000`2635b600 : 0x6caa4d31
    : 00000000`0000007c 00000000`00000000 00000000`2635b600 00000000`1b820230 : ntdll!RtlIsDosDeviceName_U+0x5a0
    : 00000000`00000000 00000000`2635b600 00000000`1b820230 00000000`1b820230 : 0xffff
    :
    Thursday, February 5, 2015 2:36 PM

Answers

  • Solved

    Problem was .net remoting call that was not wrapped with try/catch
    In multi threaded situations, the channel could be closed out from under the current thread, resulting in a thrown exception

    The .net exception could not cross boundaries up to the mixed mode shim

    ChannelServices.UnregisterChannel(m_chan)

    Wednesday, April 22, 2015 11:30 AM

All replies

  • Thanks for the reply and the research - Interesting blog
    I don't believe my issue is coming from the flowthrottle mentioned in that blog, and searching the net I see folks who hit those limits either hang or get an exception
    My problem is an intermittent hard crash on ZwGetContextThread

    I did get from the blog to an updated version of WinDBG, which was good, and I got the symbols servers to work, so the DMP calls are now better decorated, and ZwGetContextThread switched to NtGetContextThread

    The load still claims its a CLR exception
    This dump file has an exception of interest stored in it.
    The stored exception information can be accessed via .ecxr.
    (af4.15c0): CLR exception - code e0434352 (first/second chance not available)
    ntdll!NtGetContextThread+0xa:

    Call stack for the thread that failed;

    : 00000000`00000000 00000000`00000001 00000000`1b820158 00000000`00000000 : ntdll!NtGetContextThread+0xa
    : 00000000`77a99fc0 00000000`0000ffff 00000000`0000007c 00000000`00000000 : KERNELBASE!HeapDestroy+0xa
    : 00000000`0000ffff 00000000`0000007c 00000000`00000000 00000000`2635b600 : <Unloaded_mscordacwks.dll>+0xd4d31
    : 00000000`0000007c 00000000`00000000 00000000`2635b600 00000000`1b820230 : ntdll! ?? ::FNODOBFM::`string'
    : 00000000`00000000 00000000`2635b600 00000000`1b820230 00000000`1b820230 : 0xffff
    : 00000000`2635b600 00000000`1b820230 00000000`1b820230 00000000`1bfc97f0 : 0x7c

    Friday, February 6, 2015 2:50 PM
  • You should post to C++ forum.

    Windows Phone/Windows Store

    Friday, March 6, 2015 9:38 AM
  • Solved

    Problem was .net remoting call that was not wrapped with try/catch
    In multi threaded situations, the channel could be closed out from under the current thread, resulting in a thrown exception

    The .net exception could not cross boundaries up to the mixed mode shim

    ChannelServices.UnregisterChannel(m_chan)

    Wednesday, April 22, 2015 11:30 AM