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

Comments

@randall77
Copy link
Contributor

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
Copy link

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

@randall77
Copy link
Contributor Author

@gopherbot, please open a backport to 1.12.

@gopherbot
Copy link

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
Copy link

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>
@golang golang locked and limited conversation to collaborators Jun 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants