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

Issue 10169045: code review 10169045: runtime: adjust traceback / garbage collector boundary (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 9 months ago by rsc
Modified:
11 years, 9 months ago
CC:
golang-dev, dave_cheney.net, dvyukov
Visibility:
Public.

Description

runtime: adjust traceback / garbage collector boundary The garbage collection routine addframeroots is duplicating logic in the traceback routine that calls it, sometimes correctly, sometimes incorrectly, sometimes incompletely. Pass necessary information to addframeroots instead of deriving it anew. Should make addframeroots significantly more robust. It's certainly smaller. Also try to standardize on uintptr for saved pc, sp values. Will make CL 10036044 trivial.

Patch Set 1 #

Patch Set 2 : diff -r a14bbc9436a3 https://code.google.com/p/go/ #

Patch Set 3 : diff -r 0648763efe60 https://code.google.com/p/go #

Patch Set 4 : diff -r 8f6f14dfd222 https://code.google.com/p/go/ #

Total comments: 2

Patch Set 5 : diff -r ee3004c9d384 https://code.google.com/p/go/ #

Total comments: 5

Patch Set 6 : diff -r ebb4e1526a40 https://code.google.com/p/go/ #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+350 lines, -277 lines) Patch
M src/pkg/runtime/mgc0.c View 1 2 3 4 3 chunks +39 lines, -75 lines 0 comments Download
M src/pkg/runtime/mprof.goc View 1 2 3 chunks +7 lines, -7 lines 0 comments Download
M src/pkg/runtime/panic.c View 1 2 4 chunks +7 lines, -7 lines 0 comments Download
M src/pkg/runtime/proc.c View 1 2 8 chunks +10 lines, -10 lines 0 comments Download
M src/pkg/runtime/runtime.h View 1 2 3 4 5 8 chunks +28 lines, -9 lines 0 comments Download
M src/pkg/runtime/signal_386.c View 1 2 1 chunk +1 line, -1 line 0 comments Download
M src/pkg/runtime/signal_amd64.c View 1 2 1 chunk +1 line, -1 line 0 comments Download
M src/pkg/runtime/signal_arm.c View 1 2 1 chunk +1 line, -1 line 0 comments Download
M src/pkg/runtime/stack.c View 1 2 5 chunks +10 lines, -9 lines 0 comments Download
M src/pkg/runtime/traceback_arm.c View 1 2 3 4 chunks +122 lines, -78 lines 1 comment Download
M src/pkg/runtime/traceback_x86.c View 1 2 3 4 5 3 chunks +124 lines, -79 lines 1 comment Download

Messages

Total messages: 11
rsc
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://code.google.com/p/go/
11 years, 9 months ago (2013-06-12 02:36:31 UTC) #1
dave_cheney.net
https://codereview.appspot.com/10169045/diff/7001/src/pkg/runtime/mgc0.c File src/pkg/runtime/mgc0.c (right): https://codereview.appspot.com/10169045/diff/7001/src/pkg/runtime/mgc0.c#newcode1456 src/pkg/runtime/mgc0.c:1456: if(0 && ScanStackByFrames && pc == (uintptr)runtime·goexit && gp->fnstart ...
11 years, 9 months ago (2013-06-12 02:45:15 UTC) #2
rsc
https://codereview.appspot.com/10169045/diff/7001/src/pkg/runtime/mgc0.c File src/pkg/runtime/mgc0.c (right): https://codereview.appspot.com/10169045/diff/7001/src/pkg/runtime/mgc0.c#newcode1456 src/pkg/runtime/mgc0.c:1456: if(0 && ScanStackByFrames && pc == (uintptr)runtime·goexit && gp->fnstart ...
11 years, 9 months ago (2013-06-12 02:57:52 UTC) #3
dvyukov
LGTM I like the GC simplification https://codereview.appspot.com/10169045/diff/13001/src/pkg/runtime/runtime.h File src/pkg/runtime/runtime.h (right): https://codereview.appspot.com/10169045/diff/13001/src/pkg/runtime/runtime.h#newcode660 src/pkg/runtime/runtime.h:660: Func *fn; // ...
11 years, 9 months ago (2013-06-12 11:30:14 UTC) #4
rsc
Done, thanks.
11 years, 9 months ago (2013-06-12 12:44:53 UTC) #5
rsc
*** Submitted as https://code.google.com/p/go/source/detail?r=bb553699c7e6 *** runtime: adjust traceback / garbage collector boundary The garbage collection ...
11 years, 9 months ago (2013-06-12 12:49:41 UTC) #6
iant
LGTM https://codereview.appspot.com/10169045/diff/17002/src/pkg/runtime/traceback_arm.c File src/pkg/runtime/traceback_arm.c (right): https://codereview.appspot.com/10169045/diff/17002/src/pkg/runtime/traceback_arm.c#newcode97 src/pkg/runtime/traceback_arm.c:97: frame.arglen = 2*sizeof(uintptr) + ((uintptr*)frame.argp)[1]; Both deferproc and ...
11 years, 9 months ago (2013-06-12 13:24:51 UTC) #7
rsc
Thanks for pointing out the newproc inconsistency. The arguments are pushed as machine words, so ...
11 years, 9 months ago (2013-06-12 13:48:20 UTC) #8
ality
This isn't really related to the CL, but I'm curious about the two two significant ...
11 years, 9 months ago (2013-06-12 14:33:28 UTC) #9
rsc
On Wed, Jun 12, 2013 at 10:33 AM, Anthony Martin <ality@pbrane.org> wrote: > This isn't ...
11 years, 9 months ago (2013-06-12 15:53:44 UTC) #10
albert.strasheim
11 years, 9 months ago (2013-06-14 11:30:25 UTC) #11
Message was sent while issue was closed.
Hello

We're seeing a crash that dvyukov suggested might be related to this CL.

runtime: unknown argument frame size for runtime.copy
fatal error: invalid stack

goroutine 0 [idle]:
runtime: unknown argument frame size for runtime.sigreturn
panic during panic

No stack trace beyond that.

I suspect it's happening in code with quite a deep stack that is using the copy
builtin on some memory mapped with syscall.Mmap.

We've seen crashes with:

linux/amd64 devel +e274daf75c26 Thu Jun 13 17:04:47 2013 -0700
linux/amd64 devel +52d53d0e177e Fri Jun 14 11:14:45 2013 +0200

We also saw one segfault in the same test a few days ago while running:

linux/amd64 devel +ae79f385177d Wed Jun 12 14:05:13 2013 +1000

It didn't produce a stack trace in that case either.

It's quite a large chunk of code, but it hasn't seen any changes in a while, so
I think it's probably the runtime, not us.

If it would help we can try and reduce it to something we can submit to the
issue tracker. It's going to take us a while, so if anyone has any ideas before
we start, that would be nice.

Cheers

Albert
Sign in to reply to this message.

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