Signal handling still buggy
Volker Stolz
stolz at I2.Informatik.RWTH-Aachen.DE
Tue Oct 10 04:33:14 EDT 2000
On Mon, Oct 09, 2000 at 05:40:29AM -0700, Simon Marlow wrote:
> Ok. Is it possible to cut down the example to maybe 2 concurrent threads,
> so we could try to fix the problem here? There aren't any obvious bugs in
> the signal handling code (at least, not obvious to me :).
I think I found the most simple version to reproduce this bug.
> module Main where
> import Posix
> import IO
> main = do
> _ <- installHandler sigUSR1 (Catch (return ())) Nothing -- will fail
> -- _ <- installHandler sigUSR1 Ignore Nothing -- will work
> loop
> loop = do
> putStr "> "
> msg <- getLine
> print msg
> loop
Sample run:
tests at monster [10:23:09]> ./sigTest
> ^Z
[2]+ Stopped ./sigTest
tests at monster [10:23:11]> kill -USR1 %2
[2]+ Stopped ./sigTest
tests at monster [10:23:17]> fg
./sigTest
test
"test"
> ^Z
[2]+ Stopped ./sigTest
tests at monster [10:23:21]> kill -USR1 %2
[2]+ Stopped ./sigTest
tests at monster [10:23:23]> fg
./sigTest
Fail: failed
Action: hGetChar
Reason: (error code: 0)
Or is this some intended Posix-feature?
--
Volker Stolz * stolz at i2.informatik.rwth-aachen.de * PGP + S/MIME
More information about the Glasgow-haskell-bugs
mailing list