runtime: dump the full stack of a throwing goroutine
Useful for debugging of runtime bugs.
+ Do not print "stack segment boundary" unless GOTRACEBACK>1.
+ Do not traceback system goroutines unless GOTRACEBACK>1.
Perhaps we can make it finer grained -- set the flag in signal handlers only ...
12 years, 2 months ago
(2013-01-12 14:29:37 UTC)
#3
Perhaps we can make it finer grained -- set the flag in signal handlers only on
SIGSEGV/SIGBUS. And I do not think it is useful for deadlocks, deadlock is the
only case that calls throw on user error.
What do you think?
I agree that user errors (a deadlock) shouldn't result in tons of scary-looking error spew. ...
12 years, 2 months ago
(2013-01-12 16:55:59 UTC)
#4
I agree that user errors (a deadlock) shouldn't result in tons of
scary-looking error spew.
On Sat, Jan 12, 2013 at 6:29 AM, <dvyukov@google.com> wrote:
> Perhaps we can make it finer grained -- set the flag in signal handlers
> only on SIGSEGV/SIGBUS. And I do not think it is useful for deadlocks,
> deadlock is the only case that calls throw on user error.
> What do you think?
>
>
>
https://codereview.appspot.**com/7098050/<https://codereview.appspot.com/7098...
>
On Sat, Jan 12, 2013 at 10:29 PM, <dvyukov@google.com> wrote: > Perhaps we can make ...
12 years, 2 months ago
(2013-01-12 16:59:18 UTC)
#5
On Sat, Jan 12, 2013 at 10:29 PM, <dvyukov@google.com> wrote:
> Perhaps we can make it finer grained -- set the flag in signal handlers
> only on SIGSEGV/SIGBUS. And I do not think it is useful for deadlocks,
> deadlock is the only case that calls throw on user error.
> What do you think?
>
I think we can restrict it to only internally generated panics (runtime
throws
and deadly signals that might be due to faults in runtime/toolchain (e.g.
SIGILL, SIGABRT, and perhaps SIGSEGV/SIGBUS).
yes, i agree runtime stack frames in deadlocks is not necessary, and if
they want, they can always use GOTRACEBACK=2 directly.
UNIX signals don't necessarily map one-to-one and onto Plan 9 notes from the kernel; are ...
12 years, 2 months ago
(2013-01-13 05:12:43 UTC)
#6
UNIX signals don't necessarily map one-to-one and onto Plan 9
notes from the kernel; are other options available perhaps?
On 12 January 2013 08:58, minux <minux.ma@gmail.com> wrote:
>
> On Sat, Jan 12, 2013 at 10:29 PM, <dvyukov@google.com> wrote:
>>
>> Perhaps we can make it finer grained -- set the flag in signal handlers
>> only on SIGSEGV/SIGBUS. And I do not think it is useful for deadlocks,
>> deadlock is the only case that calls throw on user error.
>> What do you think?
>
> I think we can restrict it to only internally generated panics (runtime
> throws
> and deadly signals that might be due to faults in runtime/toolchain (e.g.
> SIGILL, SIGABRT, and perhaps SIGSEGV/SIGBUS).
>
> yes, i agree runtime stack frames in deadlocks is not necessary, and if
> they want, they can always use GOTRACEBACK=2 directly.
On 2013/01/13 05:12:43, akumar_mail.nanosouffle.net wrote: > UNIX signals don't necessarily map one-to-one and onto Plan ...
12 years, 2 months ago
(2013-01-13 14:14:36 UTC)
#7
On 2013/01/13 05:12:43, akumar_mail.nanosouffle.net wrote:
> UNIX signals don't necessarily map one-to-one and onto Plan 9
> notes from the kernel; are other options available perhaps?
I am thinking about setting the flag in thread_linux/plan9/mac.c, so the
platform-specific code can decided for what signals dump full stack.
> On 12 January 2013 08:58, minux <mailto:minux.ma@gmail.com> wrote:
> >
> > On Sat, Jan 12, 2013 at 10:29 PM, <mailto:dvyukov@google.com> wrote:
> >>
> >> Perhaps we can make it finer grained -- set the flag in signal handlers
> >> only on SIGSEGV/SIGBUS. And I do not think it is useful for deadlocks,
> >> deadlock is the only case that calls throw on user error.
> >> What do you think?
> >
> > I think we can restrict it to only internally generated panics (runtime
> > throws
> > and deadly signals that might be due to faults in runtime/toolchain (e.g.
> > SIGILL, SIGABRT, and perhaps SIGSEGV/SIGBUS).
> >
> > yes, i agree runtime stack frames in deadlocks is not necessary, and if
> > they want, they can always use GOTRACEBACK=2 directly.
On 2013/01/12 16:55:59, bradfitz wrote: > I agree that user errors (a deadlock) shouldn't result ...
12 years, 2 months ago
(2013-01-13 14:16:24 UTC)
#8
On 2013/01/12 16:55:59, bradfitz wrote:
> I agree that user errors (a deadlock) shouldn't result in tons of
> scary-looking error spew.
OK, I will exclude deadlocks and nil derefs. But then we still need to set
GOTRACEBACK=2 in run.bash, because a lot of runtime bugs (GC, the issue with
lock-free stack on 386) result in nil derefs.
> On Sat, Jan 12, 2013 at 6:29 AM, <mailto:dvyukov@google.com> wrote:
>
> > Perhaps we can make it finer grained -- set the flag in signal handlers
> > only on SIGSEGV/SIGBUS. And I do not think it is useful for deadlocks,
> > deadlock is the only case that calls throw on user error.
> > What do you think?
> >
> >
> >
>
https://codereview.appspot.**com/7098050/%3Chttps://codereview.appspot.com/70...>
> >
I wonder if the throwing variable should be per-M. It is likely that only the ...
12 years, 1 month ago
(2013-01-22 22:20:36 UTC)
#11
I wonder if the throwing variable should be per-M.
It is likely that only the M that received the signal/is throwing matters, and
then only when dumping that M's goroutine.
On 2013/01/22 22:20:36, rsc wrote: > I wonder if the throwing variable should be per-M. ...
12 years, 1 month ago
(2013-01-23 07:13:19 UTC)
#12
On 2013/01/22 22:20:36, rsc wrote:
> I wonder if the throwing variable should be per-M.
> It is likely that only the M that received the signal/is throwing matters, and
> then only when dumping that M's goroutine.
Agree.
You do not want to set GOTRACEBACK=2 on bots. But at the same time it would be
useful to see full stacks for nil derefs (previously they were caused by GC bugs
and non-atomic 64-bit atomics). But it's most likely unacceptable for end user
to see the following on nil deref in user code:
goroutine 1 [running]:
runtime.panic(0x4173d0, 0xc20000f200)
/usr/local/google/home/dvyukov/go2/src/pkg/runtime/panic.c:245 +0xb1
runtime.panicstring(0x449bf3, 0x40bb3c)
/usr/local/google/home/dvyukov/go2/src/pkg/runtime/panic.c:474 +0xa3
runtime.sigpanic()
/usr/local/google/home/dvyukov/go2/src/pkg/runtime/thread_linux.c:199 +0x168
main.main()
/tmp/test.go:5 +0x11
runtime.main()
/usr/local/google/home/dvyukov/go2/src/pkg/runtime/proc.c:248 +0x92
runtime.goexit()
/usr/local/google/home/dvyukov/go2/src/pkg/runtime/proc.c:277
So what is your plan?
Issue 7098050: code review 7098050: runtime: dump full stacks on throw and signals
(Closed)
Created 12 years, 2 months ago by dvyukov
Modified 12 years, 1 month ago
Reviewers:
Base URL:
Comments: 0