Skip to content
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

cmd/link: fix deferreturn detector #32477

Closed
randall77 opened this issue Jun 7, 2019 · 4 comments
Closed

cmd/link: fix deferreturn detector #32477

randall77 opened this issue Jun 7, 2019 · 4 comments
Assignees

Comments

@randall77
Copy link
Contributor

@randall77 randall77 commented Jun 7, 2019

The logic for detecting deferreturn calls is wrong.
We look for a relocation whose symbol is runtime.deferreturn and has an offset of 0. But on some architectures, the relocation offset is not zero. These include arm (the offset is 0xebfffffe) and s390x (the offset is 6).
This ends up having the deferreturn offset at 0, so we end up using the entry point live map instead of the deferreturn live map in a frame which defers and then segfaults.

Update #6980

@randall77 randall77 self-assigned this Jun 7, 2019
@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Jun 7, 2019

Change https://golang.org/cl/181258 mentions this issue: cmd/link: fix deferreturn detector

@gopherbot gopherbot closed this in 9eb4031 Jun 7, 2019
@randall77

This comment has been minimized.

Copy link
Contributor Author

@randall77 randall77 commented Jun 7, 2019

@gopherbot, please open a backport to 1.12.

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Jun 7, 2019

Backport issue(s) opened: #32484 (for 1.12).

Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://golang.org/wiki/MinorReleases.

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Jun 8, 2019

Change https://golang.org/cl/181378 mentions this issue: Revert "Revert "cmd/compile,runtime: allocate defer records on the stack""

gopherbot pushed a commit that referenced this issue Jun 10, 2019
…ack""

This reverts CL 180761

Reason for revert: Reinstate the stack-allocated defer CL.

There was nothing wrong with the CL proper, but stack allocation of defers exposed two other issues.

Issue #32477: Fix has been submitted as CL 181258.
Issue #32498: Possible fix is CL 181377 (not submitted yet).

Change-Id: I32b3365d5026600069291b068bbba6cb15295eb3
Reviewed-on: https://go-review.googlesource.com/c/go/+/181378
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.