Menu

#1966 sh fails to exit randomly on windows xp service pack 3

MSYS
assigned
None
Support
none
Unknown
False
2013-05-06
2013-05-05
No

When building mpir and also gettext-tools-pkg using emerge on windows XP service pack 3 the build stalls.

Upon investigation it appears that msys\bin\sh.exe is not exiting correctly.

This happens most often building mpir and so far only once building gettext.

Killing the correct sh process allows the build to continue apparently undamaged.

This happens at random places in the build process and does not appear to be related to mpir other than unlike other packages on emerge it doesnt use cmake. I dont know what other factors may come into play.

I would like to be able to try and replicate it on a clean build of XP but for various reason am unable to.

To replicate.

set up an emerge environment, build all the prerequisites as listed here...
http://techbase.kde.org/Getting_Started/Build/Windows/emerge

download and install sysinternals from
http://technet.microsoft.com/en-au/sysinternals/bb842062.aspx

Start procmon and give it a filter for mine I set the filter for image path to g:\kderoot I installed emerge on G:\

This will limit events to just the ones we are interested in. its also wise to set the backing to a file rather than to the page file and limit your events mine crashed when backing a large amount to the page file and also ate all my ram and much more besides

now emerge mpir

If you experience the issue which can happen at anytime the activity in procmon will cease but the build will be incomplete.

Now we need to isolate the offending sh process. its always a process that has exited its last thread but NOT exited the process itself.

In procmon open the process tree (ctl t) down near the very bottom you will see an sh process. for me it was always the last one and a child of another process. Double click it to go the the very first event for that process. Now we want to find the last event or that process. I found highlighting the process was the quickest way to do that. You can also close the process tree if you haven't already. right click and select highlight > PID. Now scroll down to the very last event for that process.

you'll see the last event is Thread Exit. but it should be Thread Exit followed by Process Exit followed by Close File

The last two event fail to occur.

Now take not of the pid and start task manager, find the process and kill it.

As soon as you do that the build continues.

Wait for the next stall rinse and repeat.

DC

Discussion

  • Anonymous

    Anonymous - 2013-05-05

    Sorry this is supposed to be in the MSYS group. I cant see how to edit it now that its posted :(

     
  • Earnie Boyd

    Earnie Boyd - 2013-05-05
    • status: unread --> assigned
    • assigned_to: Cesar Strauss
    • Group: OTHER --> MSYS
     
  • Earnie Boyd

    Earnie Boyd - 2013-05-05

    Are you sure you're not affected by Anti-Virus or other identified BLODA?

     
  • Anonymous

    Anonymous - 2013-05-06

    Hi. Firstly thanks for taking the time to respond :)

    I have already tried those things in the 'BLODA' list disabling and in some cases uninstalling has made no difference.

    What is really really odd is if I open the offending sh process in process explorer it has zero threads. Which is what I indicated above but I expected to find at least one hung thread. nothing, nada. Something in the shutdown code is causing the issue. but isnt that in the windows domain?

    Last night I completely disabled DEP (data execution protection) I started the build this morning before leaving for work.

    So we will see whether it makes a difference at all. If not I have found an old laptop with xp service pack 3. I will try again on that.

     
  • Anonymous

    Anonymous - 2013-05-06

    I am afraid disabling DEP did not help. I will move on to trying to set up a 'clean' xp environment.