]> Cypherpunks repositories - gostls13.git/commit
ld: detect stack overflow due to NOSPLIT
authorRuss Cox <rsc@golang.org>
Tue, 22 Feb 2011 22:40:40 +0000 (17:40 -0500)
committerRuss Cox <rsc@golang.org>
Tue, 22 Feb 2011 22:40:40 +0000 (17:40 -0500)
commitd9fd11443ca0a6e421cb8f68b533eb2af136e81f
tree00861db4f692aca0b9965ad92523e1d46fd092e5
parent7f5acfb2835b096434bafa237c43b2d87d50ea71
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
https://golang.org/cl/4188061
22 files changed:
src/cmd/5c/txt.c
src/cmd/5l/l.h
src/cmd/5l/list.c
src/cmd/5l/noop.c
src/cmd/5l/obj.c
src/cmd/6l/l.h
src/cmd/6l/obj.c
src/cmd/6l/pass.c
src/cmd/8l/l.h
src/cmd/8l/obj.c
src/cmd/8l/pass.c
src/cmd/ld/lib.c
src/cmd/ld/lib.h
src/pkg/runtime/arm/asm.s
src/pkg/runtime/cgocall.c
src/pkg/runtime/chan.c
src/pkg/runtime/iface.c
src/pkg/runtime/malloc.goc
src/pkg/runtime/proc.c
src/pkg/runtime/runtime.c
src/pkg/runtime/runtime.h
src/pkg/runtime/stack.h [new file with mode: 0644]