Intermittent failures with ctrl-c

Tom Honermann thonermann@coverity.com
Wed Jan 16 20:19:00 GMT 2013


On 01/16/2013 01:59 PM, Christopher Faylor wrote:
> On Wed, Jan 16, 2013 at 01:51:11PM -0500, Tom Honermann wrote:
>> Can you elaborate on what resources you are referring to?  I fail to
>> see how the Cygwin binaries run via the .bat file could conflict with
>> mintty (or the top level bash process) since the intervening cmd.exe
>> execution would have blocked inheritance of Cygwin related resources,
>> primarily since fork() isn't used to create these child processes.
>
> Here is a very basic issue: If you are going to be submitting a bug
> report you should be making things as simple and as clear as possible.

I'm trying.  What you are suggesting implies that all testing of 
snapshots either be done with a cmd.exe prompt (and copying enough of 
another Cygwin installation into the snapshot), or updating the host 
Cygwin installation.  My host installation is used for production 
purposes and I don't have spare machines available for other testing. 
I'm not messing with it.

I am aware of the snapshot guidance: 
http://cygwin.com/faq-nochunks.html#faq.setup.snapshots

> The fact that there are two cygwin DLLs in play here adds additional
> confusion and complication.  If we now have to enter into a theoretical
> discussion about what should be allowed, we have needlessly strayed from
> the initial problem.
>
> Given the number of historical problems we have had with mixing two
> versions of Cygwin and given that our consistent guidance is to
> only have one on your computer, there is no reason to get into a
> discussion about what is allowed.  Just use one version.  You
> can easily switch back and forth using windows tools.

I previously mentioned that problems can be duplicated without mintty. 
Here are detailed steps for how to reproduce without mintty.

1) Install the latest snapshot

2) Copy bash.exe, false.exe, and their dependent DLLs from a Cygwin 
install into the usr/bin directory of the snapshot.  For me this 
consisted of:
   bash.exe
   cygintl-8.dll
   cygiconv-2.dll
   cygreadline7.dll
   cygncurses-10.dll
   cygncursesw-10.dll
   cyggcc_s-1.dll
   false.exe

3) Shutdown all other Cygwin processes.

4) Create 'test.bat' in the usr/bin directory of the snapshot with the 
following contents:

@echo off
setlocal

set PATH=%CD%;%PATH%

:loop
echo test...
bash -c false
if not errorlevel 1 (
     echo exiting...
     exit /B 1
)
goto loop

5 Start a cmd.exe prompt.

6) Change directories to the usr/bin directory of the snapshot.

7) Start task manager or some other process monitoring tool and keep it 
running.  Run ./test.bat from the cmd.exe prompt and interrupt it with 
ctrl-c.  Repeat until you see a new bash.exe or false.exe process 
persisting following the interrupt.

It took me 20 or so tries re-running test.bat and interrupting it before 
I was able to produce a hanging/abandoned process.

I don't know how to make things any simpler or clearer than this.

Tom.


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple



More information about the Cygwin mailing list