Printing a stack trace for a hung program

526 views
Skip to first unread message

Kevin Ballard

unread,
Dec 16, 2009, 5:51:33 PM12/16/09
to golang-nuts
I have a Go program that's stuck in an infinite loop some where. Is there any way to force the program to print a stack trace, like it does when it encounters an error? I tried throwing several signals at it, but they only made the program terminate without printing a stack trace.

-Kevin Ballard

--
Kevin Ballard
http://kevin.sb.org
kbal...@gmail.com

Ian Lance Taylor

unread,
Dec 16, 2009, 6:49:42 PM12/16/09
to Kevin Ballard, golang-nuts
Kevin Ballard <kbal...@gmail.com> writes:

> I have a Go program that's stuck in an infinite loop some where. Is there
> any way to force the program to print a stack trace, like it does when it
> encounters an error? I tried throwing several signals at it, but they only
> made the program terminate without printing a stack trace.

You should be able to get a stack trace by sending a SIGSEGV signal
(signal 11).

Ian

Reply all
Reply to author
Forward
0 new messages