none
Process hangs on exit RRS feed

  • Question

  • Hi, All

    We have the following scenario that we have not been able to resolve.

    We have a process that creates other child processes and redirects the children output.

    On a rare occasion, one of the child process hangs and does not exit. This will only happen if the parent process creates multiple child processes in parallel.

    When that happens, the child process will not exit, even if the parent process and all other child processes have exited.

    Attaching to the hung process with WinDbg shows the process is hung waiting for a loader lock during a call to the __crtCorExitProcess function.

    Here is a full stacktrace:

       0  Id: 200f8.1feb4 Suspend: 1 Teb: 7ffdf000 Unfrozen

    ChildEBP RetAddr  Args to Child             

    0012f448 77055e6c 7703fc72 00000078 00000000 ntdll!KiFastSystemCallRet

    0012f44c 7703fc72 00000078 00000000 00000000 ntdll!NtWaitForSingleObject+0xc

    0012f4b0 7703fb56 00000000 00000000 7706e70c ntdll!RtlpWaitOnCriticalSection+0x13e

    0012f4d8 7706e974 770e7340 738a88b5 00000001 ntdll!RtlEnterCriticalSection+0x150

    0012f648 7706e79e 00000001 00000001 00000000 ntdll!LdrGetDllHandleEx+0x2f7

    0012f664 753c7d9c 00000001 00000000 0012f6d4 ntdll!LdrGetDllHandle+0x18

    0012f6b8 753c7c93 0012f6d4 343d6a63 00330e78 KERNELBASE!GetModuleHandleForUnicodeString+0x22

    0012fb30 753c7d6a 00000001 00000002 755536fc KERNELBASE!BasepGetModuleHandleExW+0x181

    0012fb48 755536f2 755536fc 0012fb60 755536d2 KERNELBASE!GetModuleHandleW+0x29

    0012fb54 755536d2 00000000 0012fb98 75553372 msvcrt!__crtCorExitProcess+0x10

    0012fb60 75553371 00000000 33c9963e 011f1590 msvcrt!__crtExitProcess+0xd

    0012fb98 755536bb 00000000 00000000 00000000 msvcrt!_cinit+0xea

    *** ERROR: Symbol file could not be found.  Defaulted to export symbols for C:\Tcl\bin\tcl85.dll -

    0012fbac 100414d8 00000000 01200568 1001424f msvcrt!exit+0x11

    WARNING: Stack unwind information not available. Following frames may be wrong.

    0012fbb8 1001424f 00000000 1000c860 00000000 tcl85!Tcl_Exit+0x48

    0012fbc0 1000c860 00000000 011f8b60 00000001 tcl85!Tcl_DbCkfree+0x275f

    00000000 00000000 00000000 00000000 00000000 tcl85!Tcl_ListMathFuncs+0x3e0

     

    #  1  Id: 200f8.26514 Suspend: 1 Teb: 7ffde000 Unfrozen

    ChildEBP RetAddr  Args to Child             

    0149ff58 770ad279 72d18175 00000000 00000000 ntdll!DbgBreakPoint

    0149ff88 75f71194 00000000 0149ffd4 7706b3f5 ntdll!DbgUiRemoteBreakin+0x3c

    0149ff94 7706b3f5 00000000 72d18129 00000000 kernel32!BaseThreadInitThunk+0xe

    0149ffd4 7706b3c8 770ad23d 00000000 00000000 ntdll!__RtlUserThreadStart+0x70

    0149ffec 00000000 770ad23d 00000000 00000000 ntdll!_RtlUserThreadStart+0x1b

     

    I suspect this issue has something to do with handle inheritance but I am not sure.

    The hung process uses msvcrt version 7.0.7600.16385, and has no managed code in it.

    Any advice on this issue would be much appreciated.

     

    Thanks

    Amir

    Monday, November 15, 2010 12:10 PM

All replies

  • Hello

    Thank you posting!

    This is a quick note to let you know that we are performing research on this issue and will get back to you as soon as possible. I appreciate your patience.

    Regards,
    Yi Feng Li
    MSDN Subscriber Support in Forum
    If you have any feedback of our support, please contact
    msdnmg@microsoft.com.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Wednesday, November 17, 2010 5:17 AM
    Moderator
  • Hi

     

    Are there any news on this issue?

     

    Thanks

    Amir

    Sunday, November 21, 2010 11:35 AM
  • Hi

     

    It's been a while since I heard from you. Any news?

     

    Thanks

    Amir

    Thursday, November 25, 2010 3:26 PM
  • Hi,

    We would need a full dump of the application that you are using. Can you share the dump with us? Also how are you taking the dumps (the command)?

    What are you trying to accomplish and how do you create the child processes and redirects the output in code? Can he share the full repro code with us?

     

    Can you find the module name from the dump that is called from __crtExitProcess()? Is it stuck in hmod = GetModuleHandle("mscoree.dll")? Might be but this requires an accurate investigation after we gather the hang dumps as well as the application PDB’s. 

    My suggestion is to see about what options to check out. Here is some info for more in depth

    level into the problems through support.

    There are various support options such as advisory and per issue. Please visit the below link to

    see the various paid

    support options that are available to better meet your needs.

    http://support.microsoft.com/default.aspx?id=fh;en-us;offerprophone


    bill boyce
    Tuesday, December 7, 2010 7:23 PM
    Moderator
  • Hi

     

    I can provide either a simple repro for this issue or a full dump of the process.

     

    Let me know how I can transfer files to you.

     

    Thanks

    Amir

    Wednesday, December 8, 2010 9:10 AM
  • Hi Everybody

    Can somebody give an answer to Amir's issue? It seems quite interesting! I am sure that others like to share.

    Regards

    Chong

    Friday, December 10, 2010 12:11 AM
  • Hey Amir,

    Can you give me the exact repro steps for this issue?
    I am encountering the same problem.

    Mail me the repro steps or files to sundhar2cram@gmail.com

    Thanks

    Sundhar

    Monday, October 17, 2011 5:21 AM
  • Having same issue, is there any update?

    0:000> vertarget
    Windows 7 Version 7601 (Service Pack 1) MP (4 procs) Free x86 compatible
    Product: WinNt, suite: SingleUserTS
    kernel32.dll version: 6.1.7601.24511 (win7sp1_ldr_escrow.190729-1700)
    Machine Name:
    Debug session time: Tue Sep 17 01:05:48.000 2019 (UTC + 8:00)
    System Uptime: not available
    Process Uptime: 0 days 0:20:04.000
      Kernel time: 0 days 0:00:09.000
      User time: 0 days 0:01:42.000

    0:000> kb
     # ChildEBP RetAddr  Args to Child              
    00 0039f2a0 76feebd6 0000024c 00000000 00000000 ntdll!NtWaitForSingleObject+0x15
    01 0039f304 76feeaba 00000000 00000000 76fcfb34 ntdll!RtlpWaitOnCriticalSection+0x13e
    02 0039f32c 76fd0083 770a20c0 7708ca8c 00000001 ntdll!RtlEnterCriticalSection+0x150
    03 0039f49c 76fcfddf 00000001 00000001 00000000 ntdll!LdrGetDllHandleEx+0x2f7
    04 0039f4b8 76631bc1 00000001 00000000 0039f528 ntdll!LdrGetDllHandle+0x18
    05 0039f50c 76631dd5 0039f528 1c15cc26 00b620c8 KERNELBASE!GetModuleHandleForUnicodeString+0x22
    06 0039f984 76631ed0 00000001 00000002 00d86c84 KERNELBASE!BasepGetModuleHandleExW+0x181
    07 0039f99c 00cc9110 00d86c84 09be8308 0039fc28 KERNELBASE!GetModuleHandleW+0x29
    08 0039f9ac 00cc905b 0039f9c8 1c6597b0 00b620c8 atmgr!CStandbyController::GetSystemVersion+0x2b

    Wednesday, October 30, 2019 3:07 AM
  • Instead of tacking a "me too" onto a nine year old thread you should start a new thread to ask your question and provide some more information.

    For example, what is happening in the CStandbyController::GetSystemVersion  funcion?  Why is it calling GetModuleHandle (I'm betting that is why it is requesting the loader lock)?

    When and how is this function called during process termination?  In DllMain?  In the destructor of a global object?


    • Edited by RLWA32 Wednesday, October 30, 2019 9:39 AM
    Wednesday, October 30, 2019 9:38 AM