-
Notifications
You must be signed in to change notification settings - Fork 17.5k
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
os/signal: TestCtrlBreak fails on windows/386 #10215
Comments
It's it possible that there is race between we send ^C to the process and
the
process installs its control-break handler?
|
I was thinking about the race (in our test). But I don't see how. Parent process waits for 1 second. Surely child should be finished installing the handler. Perhaps I can change the test for parent to read child's output for some "ready" message, but I am grasping for straws here. It would be nice if I can reproduce it here. It also does not break on windows/amd64. Why? |
could we skip the test for now? I want to do a final trybot run on my external linking I've sent CL 7971 to skip the test on windows/386. |
Update #10215. Change-Id: Ib588f90279a4ef5461492553d50ad77c742b3560 Signed-off-by: Shenghou Ma <minux@golang.org> Reviewed-on: https://go-review.googlesource.com/7971 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
I lied. I can reproduce it here. I did git bisect and that is what I find: b115c35 is the first bad commit
Alex |
signal handling doesn't work? package main
import (
"log"
"os"
"os/signal"
"time"
)
func main() {
c := make(chan os.Signal, 10)
signal.Notify(c)
select {
case s := <-c:
log.Println("catch!")
if s != os.Interrupt {
log.Fatalf("Wrong signal received: got %q, want %q\n", s, os.Interrupt)
}
case <-time.After(3 * time.Second):
log.Fatalf("Timeout waiting for Ctrl+Break\n")
}
}
And type CTRL-BREAK or CTRL-C, But |
os1_windows.go func ctrlhandler1(_type uint32) uint32 {
var s uint32
switch _type {
case _CTRL_C_EVENT, _CTRL_BREAK_EVENT:
s = _SIGINT
default:
return 0
}
if sigsend(s) {
println(1) // ADD PRINTLN HERE
return 1
}
exit(2) // SIGINT, SIGTERM, etc
return 0
} When added |
Interesting. That change is huge (+3935, -10636), but it should only affect
code generation. If it's causing problems, then 8g should miscompile some
code.
Please try produce a minimal test case that 8g miscompiles. If I understand
@mattn's comment correctly, 8g miscompiles ctrlhandler1.
|
TestCtrlBreak fails on windows/386
--- FAIL: TestCtrlBreak (2.21s)
signal_windows_test.go:101: Program exited with error: exit status -1073741510
FAIL
FAIL os/signal 2.280s
https://storage.googleapis.com/go-build-log/7dd1854f/windows-386-gce_0e29ac61.log
but succeeds on windows/amd64. I cannot reproduce it here. Strange.
The exit status is STATUS_CONTROL_C_EXIT. I can reproduce the failure, if I disable our C-break handler (comment out call to SetConsoleCtrlHandler in runtime).
Alex
The text was updated successfully, but these errors were encountered: