[GHC] #12903: SIGINT is not handled in forked process

GHC ghc-devs at haskell.org
Wed Nov 30 13:57:10 UTC 2016


#12903: SIGINT is not handled in forked process
-------------------------------------+-------------------------------------
           Reporter:  qnikst         |             Owner:
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Runtime        |           Version:  8.0.1
  System                             |
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 If haskell program is forked in a toplevel hander that sends UserInterrupt
 in the main thread doesn't work, because Thread 1 doesn't exists in forked
 program, so that action is noop.

 Minimal example:

 {{{#!hs
 import Control.Concurrent
 import Control.Exception
 import System.Posix

 main = do
   pid <- forkProcess $ do
            handle (\UserInterrupt{} -> putStrLn "caught")
                   $ threadDelay 2000000
   signalProcess sigINT pid
   threadDelay 2000000
 }}}

 Expected result: "caught" printed to stdout.
 Actual result: nothing is printed.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12903>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list