[GHC] #2508: exception handling: exitWith ExitSuccess results in
abnormal termination with Control.OldException
GHC
trac at galois.com
Sun Aug 10 07:28:41 EDT 2008
#2508: exception handling: exitWith ExitSuccess results in abnormal termination
with Control.OldException
-----------------------+----------------------------------------------------
Reporter: int-e | Owner:
Type: bug | Status: new
Priority: normal | Component: libraries/base
Version: 6.9 | Severity: normal
Keywords: | Testcase:
Architecture: x86 | Os: Linux
-----------------------+----------------------------------------------------
Consider this program.
{{{
import System.Exit
import Control.OldException
main = exitWith ExitSuccess `finally` return ()
}}}
It should not produce any output and return 0 as its exit code. Instead we
get:
{{{
# runhaskell test.hs
exit: ExitSuccess
# echo $?
1
}}}
The problem is that {{{finally}}} catches the exception and rethrows it.
In the process, the {{{OldException}}} module maps exceptions to ''old''
exceptions, but never maps them back when they're thrown.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2508>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the Glasgow-haskell-bugs
mailing list