[GHC] #7229: Detecting if a process was killed by a signal is impossible

GHC ghc-devs at haskell.org
Sat Nov 9 11:29:47 UTC 2013


#7229: Detecting if a process was killed by a signal is impossible
--------------------------------------+------------------------------------
        Reporter:  benmachine         |            Owner:
            Type:  bug                |           Status:  new
        Priority:  high               |        Milestone:  7.8.1
       Component:  libraries/process  |          Version:
      Resolution:                     |         Keywords:
Operating System:  Unknown/Multiple   |     Architecture:  Unknown/Multiple
 Type of failure:  None/Unknown       |       Difficulty:  Unknown
       Test Case:                     |       Blocked By:
        Blocking:                     |  Related Tickets:
--------------------------------------+------------------------------------

Comment (by hvr):

 Ok, in summary I see the following possibilities for the return value of
 the existing `waitForProcess` call on POSIX systems:

  1. Use the reserved `ExitFailure 0` value to denote `WIFEXITED(s) ==
 FALSE`; code should use the new API functions from comment:9 if it's
 interested in getting better exit-status information

  2. Use the Perl/Python encoding convention for the argument of
 `ExitFailure`, i.e.
     {{{#!hs
     if coredump then 0x8000 else 0 .|. exit-status `shift` 8 .|. signum
     }}}
     causes impedance mismatch with the Haskell2010's `exitWith`

  3. Use Bash-encoding for the argument of `ExitFailure`
     causes impedance mismatch with Haskell2010's `exitWith`


 I'm somewhat inclined to go with 1.; 2. would be tolerable if `exitWith`
 in base is adapted to interpret the exit code in the same way

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


More information about the ghc-tickets mailing list