bash misbehavior

Christopher Faylor
Tue Sep 28 21:25:00 GMT 2004

On Tue, Sep 28, 2004 at 04:27:05PM -0400, Pierre A. Humblet wrote:
>Christopher Faylor wrote:
>> On Mon, Sep 27, 2004 at 09:33:08PM -0400, Pierre A. Humblet wrote:
>> >The following command produces an unexpected
>> >result with standard Cygwin and bash
>> >
>> >~: echo 1 | `echo cat` &
>> >[1] 180019
>> >~: 1
>> >Use "logout" to leave the shell.
>> >[1]+  Done                    echo 1 | `echo cat`
>> >
>> >If ignoreeof is off, bash goes away.
>> >
>> >It looks like fhandler_termios::bg_check returns an error,
>> >not sure what's going on. I have a trace available.
>> Are you sure that bash is doing the right thing?  
>Not sure, but it's doing on Cygwin what it is doing elsewhere.

bash was expecting a certain behavior regarding pids elsewhere, too.
That doesn't mean it's cygwin's problem.

I could even use the argument that "it works fine on zsh".

I'm not saying that you are not right but this argument is a no-op.

>So if it isn't right, there must be a Cygwin related explanation.
>It is not pid reuse in this case.

I'm not convinced.  I know (and have known) that cygwin's behavior
regarding pgid's is not perfect since it doesn't keep track of them
after the process disappears but I can't convince myself from looking at
the strace that bash is not doing something wrong there.

Probably somehow making cygwin remember pgids until the last process
which is using the pgid dies would rectify this problem but I don't know
of any easy way to do that.


More information about the Cygwin-developers mailing list