It appears we do have a problem with ghc messing up stdout & stderr, and
possibly stdin depending on your shell.

There's a dark corner in Unix (I checked the Open Single Unix spec, POSIX
probably agrees): it seems that when a child process sets O_NONBLOCK on a
file descriptor passed from its parent (i.e. stdin stdout or stderr), the
parent sees the change in its copy of the file descriptor.  This appears to
be the "correct" behaviour.

I've checked the source for zsh (the shell I use), and it resets stdin to
blocking mode after running each command.  It doesn't touch stdout, so that
gets left in nonblocking mode.

So, what I'll do is fix GHC to reset the handles to blocking mode on exit.
This won't be a complete fix; you'll still be able to 'kill -KILL' a
ghc-compiled program and leave the handles in non-blocking mode.

Sadly, the GHC 4.04.1 binaries on the web site will all have the problem
(but the Windows binaries won't :-).

Cheers,
        Simon

Reply via email to