Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(112)

Issue 4907048: code review 4907048: runtime: simplify stack traces (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
15 years, 2 months ago by rsc
Modified:
15 years, 1 month ago
Reviewers:
CC:
golang-dev, zhai, niemeyer, r
Visibility:
Public.

Description

runtime: simplify stack traces Make the stack traces more readable for new Go programmers while preserving their utility for old hands. - Change status number [4] to string. - Elide frames in runtime package (internal details). - Swap file:line and arguments. - Drop 'created by' for main goroutine. - Show goroutines in order of allocation: implies main goroutine first if nothing else. There is no option to get the extra frames back. Uncomment 'return 1' at the bottom of symtab.c. $ 6.out throw: all goroutines are asleep - deadlock! goroutine 1 [chan send]: main.main() /Users/rsc/g/go/src/pkg/runtime/x.go:22 +0x8a goroutine 2 [select (no cases)]: main.sel() /Users/rsc/g/go/src/pkg/runtime/x.go:11 +0x18 created by main.main /Users/rsc/g/go/src/pkg/runtime/x.go:19 +0x23 goroutine 3 [chan receive]: main.recv(0xf8400010a0, 0x0) /Users/rsc/g/go/src/pkg/runtime/x.go:15 +0x2e created by main.main /Users/rsc/g/go/src/pkg/runtime/x.go:20 +0x50 goroutine 4 [chan receive (nil chan)]: main.recv(0x0, 0x0) /Users/rsc/g/go/src/pkg/runtime/x.go:15 +0x2e created by main.main /Users/rsc/g/go/src/pkg/runtime/x.go:21 +0x66 $ $ 6.out index panic: runtime error: index out of range goroutine 1 [running]: main.main() /Users/rsc/g/go/src/pkg/runtime/x.go:25 +0xb9 $ $ 6.out nil panic: runtime error: invalid memory address or nil pointer dereference [signal 0xb code=0x1 addr=0x0 pc=0x22ca] goroutine 1 [running]: main.main() /Users/rsc/g/go/src/pkg/runtime/x.go:28 +0x211 $ $ 6.out panic panic: panic goroutine 1 [running]: main.main() /Users/rsc/g/go/src/pkg/runtime/x.go:30 +0x101 $

Patch Set 1 #

Patch Set 2 : diff -r 5fa083fa94b9 https://go.googlecode.com/hg #

Patch Set 3 : diff -r 5fa083fa94b9 https://go.googlecode.com/hg #

Patch Set 4 : diff -r 2cdc911fc24c https://go.googlecode.com/hg/ #

Patch Set 5 : diff -r cf8cf05ce26d https://go.googlecode.com/hg/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+163 lines, -65 lines) Patch
M src/pkg/runtime/amd64/traceback.c View 1 2 chunks +29 lines, -24 lines 0 comments Download
M src/pkg/runtime/arm/traceback.c View 1 2 chunks +27 lines, -24 lines 0 comments Download
M src/pkg/runtime/chan.c View 1 8 chunks +8 lines, -0 lines 0 comments Download
M src/pkg/runtime/mgc0.c View 1 1 chunk +1 line, -0 lines 0 comments Download
M src/pkg/runtime/proc.c View 1 3 chunks +43 lines, -5 lines 0 comments Download
M src/pkg/runtime/runtime.h View 1 2 3 4 chunks +4 lines, -0 lines 0 comments Download
M src/pkg/runtime/runtime.c View 1 2 3 4 2 chunks +13 lines, -4 lines 0 comments Download
M src/pkg/runtime/sema.goc View 1 1 chunk +1 line, -0 lines 0 comments Download
M src/pkg/runtime/symtab.c View 1 2 3 1 chunk +37 lines, -0 lines 0 comments Download
M test/golden.out View 1 2 3 3 chunks +0 lines, -8 lines 0 comments Download

Messages

Total messages: 12
rsc
Hello golang-dev (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://go.googlecode.com/hg/
15 years, 2 months ago (2011-08-18 16:18:27 UTC) #1
zhai
On Fri, Aug 19, 2011 at 12:18 AM, <rsc@golang.org> wrote: > Description: > runtime: simplify ...
15 years, 2 months ago (2011-08-18 16:32:51 UTC) #2
rsc
> Ohh, I miss the prev precise stack traces. Why? Can you give an example ...
15 years, 2 months ago (2011-08-18 16:36:29 UTC) #3
zhai
On Fri, Aug 19, 2011 at 12:36 AM, Russ Cox <rsc@golang.org> wrote: > > Ohh, ...
15 years, 2 months ago (2011-08-18 16:46:42 UTC) #4
rsc
> - Elide frames in runtime package (internal details). > - Drop 'created by' for ...
15 years, 2 months ago (2011-08-18 16:56:01 UTC) #5
niemeyer
I've been following the thread and the debate about more easily identifying goroutine boundaries. I ...
15 years, 2 months ago (2011-08-18 16:57:25 UTC) #6
rsc
I'd rather not bikeshed this. There are already blank lines. Russ
15 years, 2 months ago (2011-08-18 17:00:38 UTC) #7
niemeyer
> I'd rather not bikeshed this. There are already blank lines. Suggesting a different idea ...
15 years, 2 months ago (2011-08-18 17:36:12 UTC) #8
rsc
>> I'd rather not bikeshed this. There are already blank lines. > > Suggesting a ...
15 years, 2 months ago (2011-08-18 17:40:17 UTC) #9
r
LGTM it would be nice to clean up runtime/debug.Stack too but that can wait
15 years, 2 months ago (2011-08-19 04:24:15 UTC) #10
rsc
*** Submitted as http://code.google.com/p/go/source/detail?r=8322c54b00f9 *** runtime: simplify stack traces Make the stack traces more readable ...
15 years, 1 month ago (2011-08-23 03:26:43 UTC) #11
rsc
15 years, 1 month ago (2011-08-23 14:44:50 UTC) #12
My fix for runtime.Callers slipped into this CL unintentionally.
http://codereview.appspot.com/4907048/diff2/7001:17002/src/pkg/runtime/runtime.c
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b