Menu

#2154 MSYS - 24 seconds to create a process

MSYS
unread
nobody
None
Bug
none
Unknown
False
2014-08-20
2014-01-02
No

ello to all, I think that I have found a bug on MSYS.

This issue happens ONLY when launching ANY MSYS binary as a "NTAUTORITY\SYSTEM" user.

It happens with : ls.exe, sh.exe, env.exe ....

To test it, open a cmd.exe as: "psexec -i -s -d cmd.exe". Then, execute any msys binary, and the process takes at least 24 SECONDS to be opened.

Monitoring the process with process monitor shows the problem. See the attached image. It seems the the problem is in the last cscapi.dll call and before the samcli.dll call.

Creating also a process dump with procdump (sysinternals utility) you can get an EXCEPTION(0xc0000008).

"In sh_131229_121226.dmp the assembly instruction at 0x776012c7 which does not correspond to any known native module in the process
has caused an unknown exception (0xc0000008) on thread 0.

Type of Analysis Performed Combined Crash/Hang Analysis
Machine Name K-PC
Operating System Windows 7Service Pack 1
Number Of Processors 2
Process ID 3536
Process Image C:\MinGWdevelopment\msys\1.0\bin\sh.exe
System Up-Time 00:00:00
Process Up-Time 00:00:00
Processor Type X86
Process Bitness 32-Bit

Top 5 Threads by CPU time
Note - Times include both user mode and kernel mode for each thread
Thread ID: 0 Total CPU Time: 00:00:00.015 Entry Point for Thread: sh+1000
Thread ID: 1 Total CPU Time: 00:00:00.000 Entry Point for Thread: msys_1_0!getpass+3750

Thread report

Thread 0 - System ID 3120

Entry point sh+1000
Create time 29/12/2013 12:12:26
Time spent in user mode 0 Days 00:00:00.000
Time spent in kernel mode 0 Days 00:00:00.015

This thread is not fully resolved and may or may not be a problem. Further analysis of these threads may be required.

Function

ntdll!ZwClose+12
kernel32!BaseRegCloseKeyInternal+41
kernel32!RegCloseKey+7d
msys_1_0!regsub+5fa
msys_1_0!getpass+3ef8
msys_1_0!select+5319
msys_1_0!_assert+3035
msys_1_0!dll_crt0+125
sh+6f62f
sh+103e
kernel32!BaseThreadInitThunk+e
ntdll!__RtlUserThreadStart+70
ntdll!_RtlUserThreadStart+1b

Thread 1 - System ID 3464

Entry point msys_1_0!getpass+3750
Create time 29/12/2013 12:12:26
Time spent in user mode 0 Days 00:00:00.000
Time spent in kernel mode 0 Days 00:00:00.000

Function

ntdll!RtlUserThreadStart

############################################################################3

Sorry for my ignorance, but I'm not a programmer.

Could you help me?

I use msys 1.0.18 and I tested and verified the problem with: W7 and W2008 R2.

Thanks a lot.

1 Attachments

Discussion

  • BGINFO for X and for Windows!

    Hello,

    I can validate that the problem also happens with Windows XP.

    If you need more information or realize some tests, let me know.

    Thanks a lot for your time.

    Regards.

     
  • BGINFO for X and for Windows!

    Hello,

    The following url has also problems when executing msysgit as a service (non interactive user):
    http://sourceforge.net/mailarchive/message.php?msg_id=31374034

    Perhaps there is something related, that can help both.

    Thanks a lot for your time.

     
  • BGINFO for X and for Windows!

    Hi again,

    I can confirm that MSYS2 has no problem launching sh.exe as a non-interactive user.
    I hope this information can help to find the bug.

    Thanks a lot .

     
  • BGINFO for X and for Windows!

    Hello,

    I can add more information: this only happens when networking is "connected".

    There are some "clues" here:

    1) http://superuser.com/questions/560814/slow-msysgit-performance-on-mapped-network-drive

    This site says:"The problem is that SMB (Server Message Block, a.k.a. Samba, a.k.a. Windows File Sharing) is a very "chatty" protocol" "Multiply the latency of the number of round trips, and add in the transfer time of the files, to come up with some number that should be around 25 seconds."

    This is "exactly" the time needed to start a MSYS process as SYSTEM. So it seems that MSYS uses SMB when executed as SYSTEM.

    2) http://www.qnx.com/support/knowledgebase.html?id=50130000000PZaO

    This site says: "There is a bug msys tools that are shipped with 6.4.1 and earlier versions, where it will periodically check the network for authentication and this can often be a lengthy wait (up to 1 minute or more).

    It seems that in the past this passed even when launched as a regular user.

    3) http://stackoverflow.com/questions/2835775/msysgit-bash-is-horrendously-slow-in-windows-7

    This sites points to the network problem: "Alas 'Run as Administrator' didn't work for me - but as Kevin L found, disconnecting the network adapter, launching git bash, then reconnecting worked fine. So I wrapped this up in a batch script and put a shortcut to it in my Start menu, flagged to run as admin:"

    I hope this information can be useful.

    Thanks a lot for your time.

    Regards.

     
MongoDB Logo MongoDB