You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In misc/cgo/testcarchive/main2.c, add a function call within the signal handler which generates an instruction that requires proper alignment. Calling a varargs function with a floating-point parameter seems to suffice:
bcmills:~/src/go.googlesource.com/go/misc/cgo/testcarchive$ go test -v -test.run=TestEarlySignalHandler ./carchive_test.go
=== RUN TestEarlySignalHandler
--- FAIL: TestEarlySignalHandler (6.46s)
carchive_test.go:215:
carchive_test.go:216: signal: segmentation fault (core dumped)
FAIL
exit status 1
FAIL command-line-arguments 7.259s
What did you expect to see?
The test should pass.
What did you see instead?
The test fails due to a second SIGSEGV within the first SIGSEGV handler call. The source of the second SIGSEGV is a movaps instruction which requires the stack to be properly 16-byte aligned.
The text was updated successfully, but these errors were encountered:
bcmills
changed the title
runtime: signal handling: sigfwd calls C handlers with improper alignment under -race
runtime: signal handling: sigfwd calls C handlers with improper alignment
Oct 28, 2016
There is a related issue that sigtramp and/or cgoSigtramp need to save callee-save registers in case they are themselves forwarded calls from some other signal handler, but I'll file that as a separate issue.
go version go1.7.3 linux/amd64
What did you do?
In
misc/cgo/testcarchive/main2.c
, add a function call within the signal handler which generates an instruction that requires proper alignment. Calling a varargs function with a floating-point parameter seems to suffice:Enable the race-detector in the corresponding test:
Then, run the test:
What did you expect to see?
The test should pass.
What did you see instead?
The test fails due to a second SIGSEGV within the first SIGSEGV handler call. The source of the second SIGSEGV is a
movaps
instruction which requires the stack to be properly 16-byte aligned.The text was updated successfully, but these errors were encountered: