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

runtime/cgo: crosscall_s390x does not restore g pointer #16006

Closed
mundaym opened this issue Jun 8, 2016 · 1 comment
Closed

runtime/cgo: crosscall_s390x does not restore g pointer #16006

mundaym opened this issue Jun 8, 2016 · 1 comment

Comments

@mundaym
Copy link
Member

mundaym commented Jun 8, 2016

crosscall_s390x() does not restore the g pointer and so if R13 is overwritten by C code a segmentation fault may occur in runtime.mstart().

This has been seen with Go tip built on:
Linux 58bf5d25d426 4.5.0-1-s390x #1 SMP Debian 4.5.1-1 (2016-04-14) s390x GNU/Linux

Bootstrapped with:
gccgo (GCC) 6.1.0

CL to follow.

@gopherbot
Copy link

CL https://golang.org/cl/23910 mentions this issue.

mundaym added a commit to linux-on-ibm-z/go that referenced this issue Jun 17, 2016
R13 needs to be set to g because C code may have clobbered R13.

Fixes golang#16006.

Change-Id: I66311fe28440e85e589a1695fa1c42416583b4c6
Reviewed-on: https://go-review.googlesource.com/23910
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
@golang golang locked and limited conversation to collaborators Jun 8, 2017
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