dumping stack with -xc

Simon Marlow simonmar at microsoft.com
Fri Oct 21 04:49:23 EDT 2005


On 21 October 2005 08:45, John Meacham wrote:

> How do I force a stack dump with -xc?
> 
> my program is locking up in an infinite loop, but it keeps going and
> won't die itself, I was hoping it would dump stack on ctrl-c but it
> does not seem to. is there any way to force it to happen? installing a
> signal handler that fails does not work as it always reports
>         Main.main. John

Tricky; you might try setting the stack size small enough to trigger a
stack overflow (+RTS -K).  Apart from this, there's no way to get a
stack trace as far as I'm aware.  We should probably make async
exceptions generate a stack trace with -xc too, so you could use a ^C
handler that throws an async exception in the main thread.

If you compile with profiling then ^C should give you a time profile,
which should give you a clue where the infinite loop is.

Cheers,
	Simon


More information about the Glasgow-haskell-users mailing list