[GHC] #5902: Cannot tell from an exception handler whether the exception was asynchronous
GHC
ghc-devs at haskell.org
Tue Aug 13 19:03:21 CEST 2013
#5902: Cannot tell from an exception handler whether the exception was
asynchronous
-------------------------------------+------------------------------------
Reporter: simonmar | Owner: simonmar
Type: bug | Status: new
Priority: high | Milestone: 7.8.1
Component: Compiler | Version: 7.4.1
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 exbb2):
Replying to [comment:19 simonmar]:
> > Every innocuous catch or try anywhere at any time in any library can
make a thread unintentionally uncancelable
> I'm not sure what you mean here. The issue in this ticket only arises
when using `unsafePerformIO`.
{{{
tryNTimes n
| n <= 0 = return ()
| otherwise =
forever (return ())
`catch` \(_::SomeException) -> tryNTimes (n - 1)
}}}
or
{{{
try something :: IO (Either SomeException x)
}}}
Catching SomeException is sometimes reasonable, but it's unreasonable not
to provide ability to discriminate against irrelevant asynchronous
exceptions which do not directly follow from handled code.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/5902#comment:20>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list