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

x/sys/unix: TestClockNanosleep failures on linux-mipsle-rtrk builder #35622

Closed
bcmills opened this issue Nov 15, 2019 · 5 comments
Closed

x/sys/unix: TestClockNanosleep failures on linux-mipsle-rtrk builder #35622

bcmills opened this issue Nov 15, 2019 · 5 comments
Milestone

Comments

@bcmills
Copy link
Member

@bcmills bcmills commented Nov 15, 2019

https://build.golang.org/log/f0d29a593ccba5704246987f49074bfca43dd1b9

--- FAIL: TestClockNanosleep (0.10s)
    syscall_linux_test.go:580: ClockNanosleep(CLOCK_REALTIME, TIMER_ABSTIME, &unix.Timespec{Sec:1573834610, Nsec:328568608} (=2019-11-15 17:16:50.328568608 +0100 CET m=+0.544561463), nil) = interrupted system call
FAIL
FAIL	golang.org/x/sys/unix	0.599s

CC @tklauser @bogojevic @milanknezevic @cherrymui

@bcmills bcmills added this to the Go1.14 milestone Nov 15, 2019
@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Nov 15, 2019

Now that we use signals for preemption I guess all those calls need to check for EINTR.

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Nov 16, 2019

Change https://golang.org/cl/207285 mentions this issue: unix: don't fail TestClockNanosleep on EINTR from ClockNanosleep

@bcmills

This comment has been minimized.

Copy link
Member Author

@bcmills bcmills commented Nov 16, 2019

@ianlancetaylor, aren't the runtime's handlers all registered with SA_RESTART set?

I would expect preemption to produce spurious EINTR return values in some cgo programs due to #20400, but I don't understand why it would affect a pure-Go package test.

@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Nov 17, 2019

SA_RESTART does not apply to all system calls. For the Linux kernel, see http://man7.org/linux/man-pages/man7/signal.7.html, where it says that the clock_nanosleep system call, among others, always returns EINTR even if the signal was registered with SA_RESTART.

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Nov 17, 2019

Change https://golang.org/cl/207290 mentions this issue: unix: fix EINTR check in TestClockNanosleep

gopherbot pushed a commit to golang/sys that referenced this issue Nov 18, 2019
err == EINTR needs to be checked before err != nil for the interrupted
syscall to be retried properly.

Follow-up for CL 207285

Updates golang/go#35622

Change-Id: I0f8c1a75eb96e11aaba284eb75716db044257cbd
Reviewed-on: https://go-review.googlesource.com/c/sys/+/207290
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.