-
Notifications
You must be signed in to change notification settings - Fork 18k
runtime: MOVUPS in duffcopy causing "suicide: sys: floating point in note handler" on Plan9 #12829
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
If you want Plan 9 to stop regressing in this way, you should add a unit test which triggers it. Cause a bunch of notes to happen at a time/place where these copy routines would run? Any fix for this would need a test anyway, so writing the test wouldn't be a waste of time. /cc @0intro |
We already turn off duffcopy when goos==Nacl. You can just turn duffcopy off when goos==plan9 also. |
Sgtm, but a test is still important. On Sat, 3 Oct 2015 11:53 Keith Randall notifications@github.com wrote:
|
Agreed. |
A test: package main
import (
"fmt"
"os"
"testing"
)
func TestNote(t *testing.T) {
pid := os.Getpid()
path := fmt.Sprintf("/proc/%d/note", pid)
f, err := os.Create(path)
if err != nil {
t.Fatalf("unable to open note file: %v", err)
}
defer f.Close()
fmt.Fprint(f, "Hello, world!\n")
} I have run a non-test variant (make TestNote into a func main() and you got it), but not as go test, as I only have go 1.4.2 available directly on my plan9 box. I can install one from master later tonight when I come home for testing "go test" directly. The only issue that could be would be whether go test would detect that the thread has been suspended as an error. If the signal handler works in the _SigNotify case, then this should simply do nothing. Otherwise, the thread will have execution suspended in the "broken" run state, and "XYZ: pid: suicide: sys: floating point in note handler: pc=somewhere" printed to stderr. It does not validate the _SigPanic or _SigExit branches. A side-note is that, due to the go runtime posting "go: exit" to all threads on shutdown, any terminating application is a test, with all threads being suspended and having their own line about floating point written to stderr. |
@Joushou, if that test code causes it to crash, then why do the |
@bradfitz As far I understand it, the tests pass on plan9/386, but not on plan9/amd64. The real issue is we don't have any plan9/amd64 builder currently. |
@0intro: Yes, it's amd64 specific. 386 uses MOVL, whereas amd64 uses MOVOU with an XMM register. |
We really need an plan9/amd64 builder before we can even discuss changes for plan9/amd64. In fact, I'm actually a little tempted to delete all the plan9/amd64 code since it's been (way!) over four weeks (per golang.org/wiki/PortingPolicy) since we last saw a successful build result plan9/amd64. The porting policy requires we have a running builder. If 9k is a buggy kernel, are there any other non-buggy amd64 kernels which can run in other environments at least? VMWare? AWS? |
The former plan9/amd64 builder was running the 9front kernel. |
I was about to suggest that. 9front doesn't seem to have known issues with the amd64 kernel. I would be very sad if the plan9/amd64 code got pulled. |
@Joushou, maybe you can help run a builder. :) |
@0intro, I don't know anything about 9k vs 9front. Old style builders can't be trybots, but that's fine. Email me for a build key. |
@bradfitz I might be able to donate some processing power myself to the task in the near future, but my internet connection is wireless and unstable until some legal matters get sorted out. Until then, I can only help with others' builders, and try to see if I can find and fix other plan9 issues. :) |
@Joushou Any help is very appreciated :) A plan9/amd64 (9front) builder is now running. |
CL https://golang.org/cl/15421 mentions this issue. |
Go and OS versions
go:
go version devel +5a2a556 Fri Oct 2 16:39:16 2015 +0100 darwin/amd64
executing OS: 9front amd64 current head
compiling OS: OS X 10.11
Test
Expected result
This is also the result on 1.5.1
Actual result
Debug info
The above appears to be calling copyduff from the sighandler. Change 14836 (https://go-review.googlesource.com/#/c/14836/) changes runtime.copyduff from using MOVQ to using MOVUPS for performance reasons, but Plan9 does not permit using floating point in note handlers. This includes operations that access XMM registers, such as MOVUPS.
Almost two years ago, a similar issue was fixed, where runtime.memmove (which used MOVOU) was used accidentally in the plan9 signal handler: https://codereview.appspot.com/34640045/
Proposed solution
A solution would be to avoid using copyduff in this case or to have a slower copyduff as well. Reverting the optimized copyduff for only this reason would seem silly to me.
The text was updated successfully, but these errors were encountered: