-
Notifications
You must be signed in to change notification settings - Fork 18k
runtime: crash in copyabletopsegment for defer of nil func #8047
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
Milestone
Comments
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. |
Issue #8046 has been merged into this issue. |
CL https://golang.org/cl/101800043 mentions this issue. |
This issue was closed by revision 3d1c3e1. Status changed to Fixed. |
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. |
This issue was closed by revision aa04caa. Status changed to Fixed. |
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. |
Owner changed to @rsc. |
This issue was closed by revision 36207a9. Status changed to Fixed. |
CL https://golang.org/cl/103370044 mentions this issue. |
CL https://golang.org/cl/105120044 mentions this issue. |
This issue was closed by revision 060a988. |
CL https://golang.org/cl/108890045 mentions this issue. |
rsc
added a commit
that referenced
this issue
May 11, 2015
««« CL 108840043 / 3a2306461574 runtime: add test for issue 8047. Make sure stack copier doesn't barf on a nil defer. Bug was fixed in https://golang.org/cl/101800043 This change just adds a test. Fixes #8047 LGTM=dvyukov, rsc R=dvyukov, rsc CC=golang-codereviews https://golang.org/cl/108840043 »»» TBR=adg CC=golang-codereviews https://golang.org/cl/102320043
rsc
added a commit
that referenced
this issue
May 11, 2015
««« CL 105140044 / c2832405e9b9 runtime: fix defer of nil func Fixes #8047. LGTM=r, iant R=golang-codereviews, r, iant CC=dvyukov, golang-codereviews, khr https://golang.org/cl/105140044 »»» LGTM=r R=golang-codereviews, r CC=adg, golang-codereviews, iant https://golang.org/cl/103370044
rsc
added a commit
that referenced
this issue
May 11, 2015
…rk on Windows ««« CL 105120044 / 824ea5943ba8 runtime: revise CL 105140044 (defer nil) to work on Windows It appears that something about Go on Windows cannot handle the fault cause by a jump to address 0. The way Go represents and calls functions, this never happened at all, until CL 105140044. This CL changes the code added in CL 105140044 to make jump to 0 impossible once again. Fixes #8047. (again, on Windows) TBR=bradfitz R=golang-codereviews, dave CC=adg, golang-codereviews, iant, r https://golang.org/cl/105120044 »»» LGTM=bradfitz R=golang-codereviews, bradfitz, alex.brainman CC=adg, golang-codereviews https://golang.org/cl/108890045
wheatman
pushed a commit
to wheatman/go-akaros
that referenced
this issue
Jun 25, 2018
fixes golang#8047 LGTM=rsc R=golang-codereviews, rsc CC=golang-codereviews https://golang.org/cl/101800043
wheatman
pushed a commit
to wheatman/go-akaros
that referenced
this issue
Jun 25, 2018
Make sure stack copier doesn't barf on a nil defer. Bug was fixed in https://golang.org/cl/101800043 This change just adds a test. Fixes golang#8047 LGTM=dvyukov, rsc R=dvyukov, rsc CC=golang-codereviews https://golang.org/cl/108840043
wheatman
pushed a commit
to wheatman/go-akaros
that referenced
this issue
Jun 25, 2018
Fixes golang#8047. LGTM=r, iant R=golang-codereviews, r, iant CC=dvyukov, golang-codereviews, khr https://golang.org/cl/105140044
wheatman
pushed a commit
to wheatman/go-akaros
that referenced
this issue
Jun 25, 2018
It appears that something about Go on Windows cannot handle the fault cause by a jump to address 0. The way Go represents and calls functions, this never happened at all, until CL 105140044. This CL changes the code added in CL 105140044 to make jump to 0 impossible once again. Fixes golang#8047. (again, on Windows) TBR=bradfitz R=golang-codereviews, dave CC=adg, golang-codereviews, iant, r https://golang.org/cl/105120044
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Attachments:
The text was updated successfully, but these errors were encountered: