logo       

Re: stdout handle is finalized: msg#00042

lang.haskell.glasgow.bugs

Subject: Re: stdout handle is finalized

Daan Leijen wrote:
I have a rather large program, and
suddenly, after no changes related to
output, my program "crashes" with the message:

Fail: <stdout>: hPutStr: illegal operation (handle is finalized)

It does (probably) happen when using "ioError" and "Ex.catch"
to catch the exception -- maybe the gc makes a mistake here?

Ok, I have found the problem -- even though I think this is
still a bug in ghc. What happened:

- an exception was raised with (lazy) error message
- the catch handler used putStr to print the message
- the evaluation of the message failed because a pattern
didn't match

... so, I guess GHC raised an (pattern match) error again, but somehow
not the pattern match error, but a Handle error ?!
Ha, probably, putStr is wrapped itself in an "catch" and
the handler there doesn't inspect the raised the error
but always raises a "handle is finalized" message ???

I hope this helps,
-- Daan Leijen.


Anyone any idea for a workaround?

All the best,
Daan Leijen.

(ps. I am not on this list, so please cc)



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise