[Haskell-cafe] debugging a hanging program: where to start?

Jason Dagit dagit at codersbase.com
Wed May 12 23:26:17 EDT 2010


On Wed, May 12, 2010 at 8:15 PM, Aran Donohue <aran.donohue at gmail.com>wrote:

> Hi Cafe,
>
> I have a program that I can reliably cause to hang. It's concurrent using
> STM, so I think it could be a deadlock or related issue. I also do some IO,
> so I think it could be blocking in a system call. It only hangs when
> compiled with -threaded. I tried building with -prof, and running with -hc
> -xt to get a clue where in which function it is stopping, but the resulting
> profile didn't help much.
>

Usually it's the other way around (hangs without threaded).  So, I would
guess that you're experiencing some sort of deadlock issue.


> I've started sprinkling print statements, but I thought I'd trawl for
> better tips and techniques. Any suggestions on approaches?
>

Try threadscope:
http://research.microsoft.com/en-us/projects/threadscope/

I haven't used it myself but I've heard it's *the* tool for investigating
parallel program behavior for haskell programs.

Hope that helps,
Jason
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20100512/9de382d8/attachment.html


More information about the Haskell-Cafe mailing list