[Haskell-cafe] thread killed

Gregory Collins greg at gregorycollins.net
Wed Apr 4 08:07:39 CEST 2012

On Wed, Apr 4, 2012 at 6:37 AM, tsuraan <tsuraan at gmail.com> wrote:

> What sorts of things can cause a thread to get an asynchronous "thread
> killed" exception?  I've been seeing rare, inexplicable "thread
> killed" messages in my Snap handlers for a long time, but they aren't
> from Snap's timeout code.  I recently upgraded to ghc 7.4.1, and that
> caused the kills to happen a lot more often, but also gave me some
> traceback capabilities.  I tracked the most common kills down to
> cryptohash's Crypto.Hash.Tiger.update function, but that's about as

That's probably not where the threadKill is being sent *from*, it's where
your thread received it.

> pure a FFI function can be, so I don't know how that would be causing
> anything weird to happen.  I also sometimes get the kills in the
> Tiger.finalize function, and I get other ones in functions that I
> haven't been able to track down yet.  Given that the thread kills
> aren't from Snap's timeout code (they happen in under a second, and I
> have snap's timeouts turned to an insanely high value), what sort of
> other things cause ThreadKilled exceptions?

It's hard to rule Snap timeouts out; try building snap-core with the
"-fdebug" flag and running your app with "DEBUG=1", you'll get a spew of
debugging output from Snap on stderr.

Gregory Collins <greg at gregorycollins.net>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20120404/7b7a0637/attachment.htm>

More information about the Haskell-Cafe mailing list