Closed dvyukov closed 9 years ago
Easier repro: package main func stackit(n int) { if n == 0 { return } stackit(n - 1) } func main() { defer ((func())(nil))() stackit(1000) } It's deferring a call to a nil object. The stack copier barfs when it comes upon such a defer record. The defer hasn't executed yet. It's easy enough to make the stack copier ignore such defers. But shouldn't we panic on such a defer as soon as it is requested? This is related to issue #8045. "defer nil()" should do the same thing as "go nil()".
Owner changed to @randall77.
CL https://golang.org/cl/101800043 mentions this issue.
The test from the merged issue #8046 still fatal errors. cl/101800043 does not contain test for 8047, so it's unclear whether 8047 is fixed as well.
Status changed to Accepted.
CL https://golang.org/cl/108840043 mentions this issue.
Sorry, it still crashes: go version devel +1282e1d59a81 Wed Jun 11 22:52:01 2014 -0700 darwin/amd64 fatal error: unexpected signal during runtime execution [signal 0xb code=0x1 addr=0x0 pc=0x1a6d7] runtime stack: runtime: unexpected return pc for runtime.newstackcall called from 0x5e708 runtime.throw(0x5bad6) src/pkg/runtime/panic.c:520 +0x69 runtime.sigpanic() src/pkg/runtime/os_darwin.c:439 +0x3d runtime.gostartcallfn(0x7fff5fbff940, 0x0) src/pkg/runtime/stack.c:859 +0x27 runtime.newstack() src/pkg/runtime/stack.c:843 +0x6e4 runtime: unexpected return pc for runtime.newstackcall called from 0x5e708 runtime.newstackcall(0x235f7, 0x7fff00000001) src/pkg/runtime/asm_amd64.s:275 +0x68
Status changed to Accepted.
CL https://golang.org/cl/105140044 mentions this issue.
CL https://golang.org/cl/103370044 mentions this issue.
CL https://golang.org/cl/105120044 mentions this issue.
CL https://golang.org/cl/108890045 mentions this issue.
Attachments: