#111 MSYS executables slow to start

closed
Earnie Boyd
MSYS (18)
5
2008-09-29
2008-08-27
Matthew L Daniel
No

I found one other reference to the problem I am experiencing:
http://sourceforge.net/forum/forum.php?thread_id=1944785&forum_id=338575

I am experiencing this, too, but it's not just rxvt.exe. It is every MSYS binary.

It seems (on my system) to be somehow related to starting up the MSYS subsystem.

Observe (from a command prompt):
1. cd \msys\1.0\bin
2. .\date.exe
# this takes 7 seconds to start up
3. .\date.exe
# if executed _immediately_ after step 2, it starts immediately
4. wait a few seconds
5. .\date.exe
# now it takes the 7 seconds to start up again

I can repeat that process for .\tar.exe, .\sh.exe, .\rxvt.exe, ... the list goes on.

However, from within .\sh.exe I can execute the same binaries with lightning speed.

The delay don't seem to be time-based, as I can open two command prompts and in each one execute .\sh.exe almost simultaneously, and each one will take their respective 7 seconds to start.

Any advice will be appreciated.

Discussion

  • Earnie Boyd
    Earnie Boyd
    2008-08-27

    Logged In: YES
    user_id=15438
    Originator: NO

    First off, you've typed the commands in your post as if you're in command.com or cmd.exe; instead of sh.exe.

    Secondly, you tell us nothing about your system or the versions of MSYS you use.

    Thirdly, you don't tell us where you have MSYS installed, is it on a network share?

    If you have a network share mapped that isn't available, it will take as long as the network access timeout for each such mapped share for MSYS to start. However, once started, as long as msys-1.0.dll is in memory it should not take long unless you're short on memory or virtual memory.

     
  • Earnie Boyd
    Earnie Boyd
    2008-08-27

    • status: open --> pending
     
    • status: pending --> open
     
  • Logged In: YES
    user_id=88251
    Originator: YES

    I apologize for the lack of environment information.

    I am in WinXP 2002 SP3, Intel Core 2 Duo (T7200) @ 2GHz, 4GB RAM

    c:\msys\1.0\bin\msys-1.0.dll reports its File version as 1000.11.0.0, APIVersion 0.46, Build Date 2007-01-12 12:05, Product Version: 1.0.11-MSYS-1_0_11

    $ uname -a
    MINGW32_NT-5.1 ATESIS 1.0.11(0.46/3/2) 2007-01-12 12:05 i686 Msys

    I have no network drives, but my machine is a member of a domain to which I am not connected (I am a road warrior). Msys is installed locally in "c:\msys\1.0". My msys /etc/fstab only contains "c:/mingw /mingw", which does exist.

    You are correct that I typed all the commands from CMD.exe, since that's the source of my woes. As I mentioned, once I'm in a running msys environment, all the msys commands execute as expected.

    But merely having a running msys environment does not impact the startup times for other msys environments, implying it's not influenced by the dll in memory. Take for example c:\msys\1.0\bin\sh.exe -c "/bin/sleep 30" in one cmd.exe window and c:\msys\1.0\bin\sh.exe -c "/bin/date" in another cmd.exe window (in that order), the sh.exe which invokes /bin/date still takes 7 seconds to start up.

    Please let me know how I can help further.

     
  • Earnie Boyd
    Earnie Boyd
    2008-08-28

    Logged In: YES
    user_id=15438
    Originator: NO

    Don't know what to tell you. I have the same exact version of MSYS and running the command as you have from windows just returns back immediately. I have a HP Compaq nc6120 with

    OS Name Microsoft Windows XP Professional
    Version 5.1.2600 Service Pack 2 Build 2600
    Processor x86 Family 6 Model 13 Stepping 6 GenuineIntel ~1400 Mhz
    Total Physical Memory 2,048.00 MB
    c:\mnt\home\boyde>c:\opt\mingw-orig\bin\sh.exe -c "uname -a"
    MINGW32_NT-5.1 OH6000GBOYDE 1.0.11(0.46/3/2) 2007-01-12 12:05 i686 Msys

    So it has to be in *your* environment. The below is a paste of my testing proving that it doesn't take 7 seconds.

    c:\mnt\home\boyde>c:\opt\mingw-orig\bin\sh.exe -c "/bin/date"
    Thu Aug 28 07:47:57 EDT 2008

    c:\mnt\home\boyde>c:\opt\mingw-orig\bin\sh.exe -c "/bin/date"
    Thu Aug 28 07:47:58 EDT 2008

    c:\mnt\home\boyde>c:\opt\mingw-orig\bin\sh.exe -c "/bin/date"
    Thu Aug 28 07:47:59 EDT 2008

    c:\mnt\home\boyde>c:\opt\mingw-orig\bin\sh.exe -c "/bin/date"
    Thu Aug 28 07:48:01 EDT 2008

     
  • Earnie Boyd
    Earnie Boyd
    2008-08-28

    • assigned_to: nobody --> earnie
    • labels: --> MSYS
    • milestone: --> Waiting_user_response
    • status: open --> pending
     
  • Logged In: YES
    user_id=88251
    Originator: YES

    I can appreciate that. My follow-up question is about how can I help myself?

    The only profiling tools I am aware of require re-compilation, and I don't especially want to go down that path (but I will, if you think it'll help and we've exhausted the other options).

    Are there any tools like "strace" for msys?

    I have access to the Visual Studio stuff, if it contains some magic debugging tools. I'm not proficient with it, but I will study if I know what I'm looking for.

    Thanks for your help with this!

     
    • status: pending --> open
     
  • Earnie Boyd
    Earnie Boyd
    2008-08-28

    • status: open --> pending
     
  • Earnie Boyd
    Earnie Boyd
    2008-08-28

    Logged In: YES
    user_id=15438
    Originator: NO

    First try the following experiment:

    set PATH=
    c:\msys\1.0\bin\sh.exe -c "/bin/date"

    To see if it makes a difference in the start time. MSYS does process the environment.

    As for strace, you need to have a debugging version of MSYS to execute it. There are instructions in the ``old'' wiki for building MSYS if you're that interested. I'm sure Cesar could use the help. Post your questions to mingw-users@lists.sourceforge.net for a broader audience.

     
  • Logged In: YES
    user_id=88251
    Originator: YES

    The bad news is I already tried clearing my PATH and unsetting the Active Directory domain related variables (like %LOGONSERVER% and friends). No help.

    I will spend some time digging around the old wiki and see how far I can get toward building the debugging version of MSYS. The objective is to get strace on /bin/ls or /bin/date (since their syscalls should be pretty finite), but if during the course of building a new MSYS DLL this problem goes away, then that's sort of a win, too.

    Thanks again for your time on this.

     
    • status: pending --> open
     
  • Earnie Boyd
    Earnie Boyd
    2008-08-29

    Logged In: YES
    user_id=15438
    Originator: NO

    Good luck on the build. If you have issues with that, then ask on the mingw-users list.

     
  • Earnie Boyd
    Earnie Boyd
    2008-08-29

    • status: open --> pending
     
  • This Tracker item was closed automatically by the system. It was
    previously set to a Pending status, and the original submitter
    did not respond within 30 days (the time period specified by
    the administrator of this Tracker).

     
    • status: pending --> closed