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

Issue 4188061: code review 4188061: ld: detect stack overflow due to NOSPLIT (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
14 years ago by rsc
Modified:
14 years ago
Reviewers:
CC:
r, r2, golang-dev
Visibility:
Public.

Description

ld: detect stack overflow due to NOSPLIT Fix problems found. On amd64, various library routines had bigger stack frames than expected, because large function calls had been added. runtime.assertI2T: nosplit stack overflow 120 assumed on entry to runtime.assertI2T 8 after runtime.assertI2T uses 112 0 on entry to runtime.newTypeAssertionError -8 on entry to runtime.morestack01 runtime.assertE2E: nosplit stack overflow 120 assumed on entry to runtime.assertE2E 16 after runtime.assertE2E uses 104 8 on entry to runtime.panic 0 on entry to runtime.morestack16 -8 after runtime.morestack16 uses 8 runtime.assertE2T: nosplit stack overflow 120 assumed on entry to runtime.assertE2T 16 after runtime.assertE2T uses 104 8 on entry to runtime.panic 0 on entry to runtime.morestack16 -8 after runtime.morestack16 uses 8 runtime.newselect: nosplit stack overflow 120 assumed on entry to runtime.newselect 56 after runtime.newselect uses 64 48 on entry to runtime.printf 8 after runtime.printf uses 40 0 on entry to vprintf -8 on entry to runtime.morestack16 runtime.selectdefault: nosplit stack overflow 120 assumed on entry to runtime.selectdefault 56 after runtime.selectdefault uses 64 48 on entry to runtime.printf 8 after runtime.printf uses 40 0 on entry to vprintf -8 on entry to runtime.morestack16 runtime.selectgo: nosplit stack overflow 120 assumed on entry to runtime.selectgo 0 after runtime.selectgo uses 120 -8 on entry to runtime.gosched On arm, 5c was tagging functions NOSPLIT that should not have been, like the recursive function printpanics: printpanics: nosplit stack overflow 124 assumed on entry to printpanics 112 after printpanics uses 12 108 on entry to printpanics 96 after printpanics uses 12 92 on entry to printpanics 80 after printpanics uses 12 76 on entry to printpanics 64 after printpanics uses 12 60 on entry to printpanics 48 after printpanics uses 12 44 on entry to printpanics 32 after printpanics uses 12 28 on entry to printpanics 16 after printpanics uses 12 12 on entry to printpanics 0 after printpanics uses 12 -4 on entry to printpanics

Patch Set 1 #

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

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

Total comments: 2

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

Unified diffs Side-by-side diffs Delta from patch set Stats (+400 lines, -127 lines) Patch
M src/cmd/5c/txt.c View 1 1 chunk +3 lines, -1 line 0 comments Download
M src/cmd/5l/l.h View 1 2 3 4 chunks +5 lines, -0 lines 0 comments Download
M src/cmd/5l/list.c View 1 1 chunk +4 lines, -0 lines 0 comments Download
M src/cmd/5l/noop.c View 1 3 8 chunks +23 lines, -1 line 0 comments Download
M src/cmd/5l/obj.c View 1 2 2 chunks +1 line, -1 line 0 comments Download
M src/cmd/6l/l.h View 1 4 chunks +3 lines, -1 line 0 comments Download
M src/cmd/6l/obj.c View 1 2 2 chunks +1 line, -1 line 0 comments Download
M src/cmd/6l/pass.c View 1 1 chunk +1 line, -7 lines 0 comments Download
M src/cmd/8l/l.h View 1 3 chunks +3 lines, -0 lines 0 comments Download
M src/cmd/8l/obj.c View 1 2 3 1 chunk +0 lines, -1 line 0 comments Download
M src/cmd/8l/pass.c View 1 2 chunks +2 lines, -0 lines 0 comments Download
M src/cmd/ld/lib.h View 1 2 chunks +1 line, -1 line 0 comments Download
M src/cmd/ld/lib.c View 1 2 chunks +180 lines, -0 lines 0 comments Download
M src/pkg/runtime/arm/asm.s View 1 2 chunks +5 lines, -5 lines 0 comments Download
M src/pkg/runtime/cgocall.c View 1 2 chunks +2 lines, -1 line 0 comments Download
M src/pkg/runtime/chan.c View 1 3 5 chunks +36 lines, -8 lines 0 comments Download
M src/pkg/runtime/iface.c View 1 12 chunks +20 lines, -13 lines 0 comments Download
M src/pkg/runtime/malloc.goc View 1 2 chunks +2 lines, -1 line 0 comments Download
M src/pkg/runtime/proc.c View 1 7 chunks +13 lines, -11 lines 0 comments Download
M src/pkg/runtime/runtime.h View 1 1 chunk +8 lines, -74 lines 0 comments Download
M src/pkg/runtime/runtime.c View 1 1 chunk +1 line, -0 lines 0 comments Download
A src/pkg/runtime/stack.h View 1 1 chunk +86 lines, -0 lines 0 comments Download

Messages

Total messages: 7
rsc
Hello r (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://go.googlecode.com/hg/
14 years ago (2011-02-18 18:31:05 UTC) #1
rsc
Tested on linux/*, darwin/*. Fails os.TestSeek on arm but otherwise ok.
14 years ago (2011-02-18 18:35:10 UTC) #2
r
nice 5c catch. the 5l thing looks fatal i am confused about iface.c the rest ...
14 years ago (2011-02-19 04:26:49 UTC) #3
rsc
> the 5l thing looks fatal luckily not much code looks at it. only things ...
14 years ago (2011-02-22 22:05:52 UTC) #4
r2
LGTM
14 years ago (2011-02-22 22:31:21 UTC) #5
rsc
Hello r, r2 (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://go.googlecode.com/hg
14 years ago (2011-02-22 22:40:38 UTC) #6
rsc
14 years ago (2011-02-22 22:40:46 UTC) #7
*** Submitted as 73af7584f8d9 ***

ld: detect stack overflow due to NOSPLIT

Fix problems found.

On amd64, various library routines had bigger
stack frames than expected, because large function
calls had been added.

runtime.assertI2T: nosplit stack overflow
        120	assumed on entry to runtime.assertI2T
        8	after runtime.assertI2T uses 112
        0	on entry to runtime.newTypeAssertionError
        -8	on entry to runtime.morestack01

runtime.assertE2E: nosplit stack overflow
        120	assumed on entry to runtime.assertE2E
        16	after runtime.assertE2E uses 104
        8	on entry to runtime.panic
        0	on entry to runtime.morestack16
        -8	after runtime.morestack16 uses 8

runtime.assertE2T: nosplit stack overflow
        120	assumed on entry to runtime.assertE2T
        16	after runtime.assertE2T uses 104
        8	on entry to runtime.panic
        0	on entry to runtime.morestack16
        -8	after runtime.morestack16 uses 8

runtime.newselect: nosplit stack overflow
        120	assumed on entry to runtime.newselect
        56	after runtime.newselect uses 64
        48	on entry to runtime.printf
        8	after runtime.printf uses 40
        0	on entry to vprintf
        -8	on entry to runtime.morestack16

runtime.selectdefault: nosplit stack overflow
        120	assumed on entry to runtime.selectdefault
        56	after runtime.selectdefault uses 64
        48	on entry to runtime.printf
        8	after runtime.printf uses 40
        0	on entry to vprintf
        -8	on entry to runtime.morestack16

runtime.selectgo: nosplit stack overflow
        120	assumed on entry to runtime.selectgo
        0	after runtime.selectgo uses 120
        -8	on entry to runtime.gosched

On arm, 5c was tagging functions NOSPLIT that should
not have been, like the recursive function printpanics:

printpanics: nosplit stack overflow
        124	assumed on entry to printpanics
        112	after printpanics uses 12
        108	on entry to printpanics
        96	after printpanics uses 12
        92	on entry to printpanics
        80	after printpanics uses 12
        76	on entry to printpanics
        64	after printpanics uses 12
        60	on entry to printpanics
        48	after printpanics uses 12
        44	on entry to printpanics
        32	after printpanics uses 12
        28	on entry to printpanics
        16	after printpanics uses 12
        12	on entry to printpanics
        0	after printpanics uses 12
        -4	on entry to printpanics

R=r, r2
CC=golang-dev
http://codereview.appspot.com/4188061
Sign in to reply to this message.

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