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

os/signal: TestSignal fails #4987

Closed
alberts opened this issue Mar 6, 2013 · 4 comments
Closed

os/signal: TestSignal fails #4987

alberts opened this issue Mar 6, 2013 · 4 comments
Milestone

Comments

@alberts
Copy link
Contributor

alberts commented Mar 6, 2013

What steps will reproduce the problem?

run the following for a few hours:

#!/bin/bash
set -xe
go test -c os/signal
while true; do
./signal.test -test.v -test.short -test.cpu 1,2,4
done

What is the expected output?

test passes always

What do you see instead?

=== RUN TestSignal
--- PASS: TestSignal (0.02 seconds)
signal_test.go:35: sighup...
signal_test.go:44: sigwinch...
signal_test.go:52: sigwinch...
signal_test.go:55: sigwinch...
=== RUN TestStress
--- PASS: TestStress (0.10 seconds)
=== RUN TestSignal-2
--- PASS: TestSignal-2 (0.00 seconds)
signal_test.go:35: sighup...
signal_test.go:44: sigwinch...
signal_test.go:52: sigwinch...
signal_test.go:55: sigwinch...
=== RUN TestStress-2
--- PASS: TestStress-2 (0.10 seconds)
=== RUN TestSignal-4
--- FAIL: TestSignal-4 (0.00 seconds)
signal_test.go:35: sighup...
signal_test.go:44: sigwinch...
signal_test.go:23: signal was user defined signal 1, want window changed
=== RUN TestStress-4
--- PASS: TestStress-4 (0.10 seconds)
FAIL

Which compiler are you using (5g, 6g, 8g, gccgo)?

6g

Which operating system are you using?

linux

Which version are you using?  (run 'go version')

go version devel +9742f722b558 Mon Mar 04 19:48:50 2013 -0800 linux/amd64

Please provide any additional information below.

takes a lot of runs to reproduce this

I've been able to reproduce this twice on a many-core machine. I can't imagine that some
outside force is sending SIGUSR1 to my Go tests, but I guess nothing is impossible...
@alberts
Copy link
Contributor Author

alberts commented Mar 8, 2013

Comment 1:

It reproduces pretty quickly if you strace the test. Example strace attached.
#!/bin/bash
set -xe
go test -c os/signal
while true; do
strace -f -v -tt -o/dev/shm/strace.log ./signal.test -test.v -test.short -test.cpu 1,2,4
done
I wonder if a signal from say cpu=2 leaks into the cpu=4 test?

Attachments:

  1. strace.log (1186905 bytes)

@alberts
Copy link
Contributor Author

alberts commented Mar 11, 2013

Comment 2:

Reproduced this on a laptop without much else running, so I don't think it's a machine
issue.

@dvyukov
Copy link
Member

dvyukov commented Mar 11, 2013

Comment 3:

I was able to reproduce it once.
I think I understand what happens -- the signal simply slips from one test into another
(signal handler on a background thread (scavenger?) get preempted and rescheduled in the
subsequent test).
But reproduction rate is very low, I can't be sure.
Mailed:
https://golang.org/cl/7713043

@dvyukov
Copy link
Member

dvyukov commented Mar 11, 2013

Comment 4:

This issue was closed by revision fe01755.

Status changed to Fixed.

@rsc rsc added this to the Go1.1 milestone Apr 14, 2015
@rsc rsc removed the go1.1maybe label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
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

4 participants