#2558: re-throwing an asynchronous exception throws it synchronously
---------------------------------+------------------------------------------
Reporter: simonmar | Owner: simonmar
Type: bug | Status: new
Priority: normal | Milestone: 6.12 branch
Component: Compiler | Version: 6.8.3
Severity: normal | Resolution:
Keywords: | Difficulty: Unknown
Testcase: | Os: Unknown/Multiple
Architecture: Unknown/Multiple |
---------------------------------+------------------------------------------
Comment (by simonmar):
Replying to [comment:4 igloo]:
> So if an exception handler (for an asynchronous exception) divides by
zero, that would be an asynchronous exception, right? Is that what we
want?
Yes, I believe that's what we want. If the exception handler throws a
divide-by-zero, and it did so as a result of an asynchronous exception
(say `ThreadKilled`), then we don't want to update any thunks with the
divide-by-zero exception, we want to revert them as for an asynchronous
exception.
> As an alternative, should we actually be throwing
> {{{
> data SomeExceptionSync = SomeExceptionSync Bool -- synchronous?
> SomeException
> }}}
> with `catch` etc ignoring the `Bool`, but `bracket` etc handling it
appropriately? This would also mean that tail-calling out of an exception
handler would work.
Tail-calling out of an exception handler also has the problem that it
leaves the thread in the blocked (i.e. `Control.Exception.block`ed) state.
IMO we should be using and recommending `try` rather than `catch` for
handling exceptions as per the description in this bug.
I haven't put any more thought into the suggestions in this thread yet...
will do later.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2558#comment:7>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs