-
Notifications
You must be signed in to change notification settings - Fork 18k
misc/cgo: 1.7rc5 tests segfault on Clear Linux #16618
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
Comments
Which version of gcc? /cc @ianlancetaylor |
gcc 6.1 On Fri, Aug 5, 2016 at 9:07 AM, Brad Fitzpatrick [email protected]
|
Steps to reproduce
(one may need a few pathname fixes from https://github.com/clearlinux-pkgs/go due to /etc being only for the sysadmin and not for the OS to fill in) |
The errors you are reporting are in misc/cgo/testcarchive. You can run just those tests by going to that directory and running Do you see any other test failures? |
the go test will run the OS go, not the newly built one (and since the On Fri, Aug 5, 2016 at 9:46 AM, Ian Lance Taylor [email protected]
|
I have no idea how this works in Docker. At the point of that test failure, Go has already been installed and be used independently. Yes, you would have to use the newly installed Go, not the system go. Do you see any other test failures? |
I'll poke some more to get better isolation on this On Fri, Aug 5, 2016 at 10:26 AM, Ian Lance Taylor [email protected]
|
managed to get the testsuite not delete the test binary... #0 runtime.raise () at /usr/lib/golang/src/runtime/sys_linux_amd64.s:110 |
Thanks. That stack trace implies that we received a signal when the runtime package variable |
I'll poke at the patch in that issue. Note that running the test app in gdb directly (rather than pointing it at a core dump) leads to a crash in an SSE/AVX instruction in pthreads where it appears the stack is not 16 byte aligned properly (but only 8 byte aligned), while the pthread code assumes it gets called with a properly aligned stack... who owns aligning the initial stack at startup.. is that a go low level thing or is that even before any go code runs? |
(gdb) bt |
Could you please post the stack trace for the AVX crash?
It might be the cause that we're not careful with proper
stack alignments on the system stack.
|
I see that _rt0_amd64_linux_lib is using a 16-byte aligned stack frame
(0x50 bytes).
Could you please try break on _rt0_amd64_linux_lib and display the
value of %rsp to rule out the possibility that glibc is not passing
correctly
aligned stack?
b *_rt0_amd64_linux_lib
r
p/x %rsp
|
(gdb) p/x $rsp |
Dump of assembler code for function _rt0_amd64_linux_lib: |
Seems like the dynamic linker is passing non-16-byte-aligned
stack pointer to DT_INIT_ARRAY functions?
|
No, I think it is our fault. It is normal for the stack to be aligned before the call instruction, and thus at an 8-byte offset at the start of the function. |
Perhaps broken by the change to enable frame pointers by default. |
Ahh, then the solution is simply increase the frame size of
_rt0_amd64_linux_lib by 8?
|
That would be my guess, yes. Why nobody else is seeing this I do not know. |
as to why others don't see this... clear linux is rather aggressive on the use of sse/avx... |
A more generic fix is harder. Because Go functions don't require special
stack alignments, and we certainly don't want to make cmd/internal/obj
always align the stack to 16-byte.
Perhaps in Go 1.8, we introduce a new textflag to say this function needs
extra stack alignment and apply those to all functions that call external
code?
|
@fenrus75, could you please give https://golang.org/cl/25550 a try?
|
sure testing now |
@ianlancetaylor, I managed to disable the framepointer
experiment, and indeed the stack frame size changes.
Does Go 1.7 officially support disabling the framepointer
experiment with GOEXPERIMENT="noframepointer"?
If yes, then we need a better fix for Go 1.7.
|
with that patch misc/cgo/testcarchivePASS and the build completes correctly/succesfully. |
I think people who set |
…inux_lib Fixes golang#16618. Change-Id: Iffada12e8672bbdbcf2e787782c497e2c45701b1 Reviewed-on: https://go-review.googlesource.com/25550 Run-TryBot: Minux Ma <[email protected]> Reviewed-by: Arjan Van De Ven <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> TryBot-Result: Gobot Gobot <[email protected]>
Please answer these questions before submitting your issue. Thanks!
go version
)?1.7rc5
go env
)?root@arjan-box /var/lib/mock/clear-go/root/builddir # go env
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH=""
GORACE=""
GOROOT="/usr/lib/golang"
GOTOOLDIR="/usr/lib/golang/pkg/tool/linux_amd64"
GO15VENDOREXPERIMENT="1"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0"
CXX="g++"
CGO_ENABLED="1"
Linux OS is Clear Linux (http://www.clearlinux.org)
I'm the distro packager, trying to package 1.7rc5 (in prep for 1.7 release)
any suggestions on diagnosing this welcome; it seems coredumps aren't happening really and finding any of the artifacts at the end of the all.bash script is proving hard
The text was updated successfully, but these errors were encountered: