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

runtime: TestDebugCallUnsafePoint failure on noopt builder #36110

Closed
bcmills opened this issue Dec 12, 2019 · 11 comments
Closed

runtime: TestDebugCallUnsafePoint failure on noopt builder #36110

bcmills opened this issue Dec 12, 2019 · 11 comments

Comments

@bcmills
Copy link
Member

@bcmills bcmills commented Dec 12, 2019

--- FAIL: TestDebugCallUnsafePoint (0.00s)
    debug_test.go:220: want "call not at safe point", got %!s(<nil>)
FAIL
FAIL	runtime	23.293s

2019-12-12T17:47:19-100bf44/linux-amd64-noopt

Possibly related to async preemption?

CC @cherrymui @aclements @mknyszek @ianlancetaylor

@bcmills bcmills added this to the Go1.14 milestone Dec 12, 2019
@cherrymui
Copy link
Contributor

@cherrymui cherrymui commented Dec 19, 2019

I think the idea is that function debugCallUnsafePointWorker (https://go.googlesource.com/go/+/refs/heads/master/src/runtime/debug_test.go#188) does not contain any safe points after the atomic variable ready is set to 1. But this is not true for noopt build, where the atomic functions are not intrinsified and are calls (therefore safe points). I guess we should either skip the test on noopt build, or rewrite the worker function in a way that contains no calls even with noopt (I don't know how).

It doesn't seem related to preemption.

@bcmills
Copy link
Member Author

@bcmills bcmills commented Jan 22, 2020

Given the timing, I suspect that CL 205718 made this particular test flakier by making InjectDebugCall more likely to succeed (for #35376).

I don't think we should just skip the test on the noopt builder, since the test may also flake for non-builder users and developers using the same flags.

However, if we could detect the presence of safe points at runtime, perhaps we could skip the test dynamically.

@bcmills bcmills added the Testing label Jan 22, 2020
@toothrot toothrot modified the milestones: Go1.14, Go1.15 Feb 25, 2020
@bcmills
Copy link
Member Author

@bcmills bcmills commented Mar 13, 2020

The failure mode has changed, but the test remains flaky. (It now has extra recurseFn lines in the output.)

2020-03-13T00:19:08-85e87f9/linux-amd64-noopt
2020-03-12T20:00:02-e221a75/linux-amd64-noopt

--- FAIL: TestDebugCallUnsafePoint (0.00s)
    debug_test.go:220: want "call not at safe point", got %!s(<nil>)
recurseFn 0 4294967295
recurseFn 1 4294967295
recurseFn 2 4294967295
recurseFn 3 4294967295
recurseFn 4 4294967295
recurseFn 5 4294967295
recurseFn 6 4294967295
recurseFn 7 4294967295
recurseFn 8 4294967295
recurseFn 0 4294967295
recurseFn 1 4294967295
recurseFn 2 4294967295
recurseFn 3 4294967295
recurseFn 4 4294967295
recurseFn 5 4294967295
recurseFn 6 4294967295
recurseFn 7 4294967295
recurseFn 8 4294967295
recurseFn 0 4294967295
recurseFn 1 4294967295
recurseFn 2 4294967295
recurseFn 3 4294967295
recurseFn 4 4294967295
recurseFn 5 4294967295
recurseFn 6 4294967295
recurseFn 7 4294967295
recurseFn 8 4294967295
FAIL
FAIL	runtime	22.758s
@thanm
Copy link
Member

@thanm thanm commented Apr 7, 2020

I see this pretty regularly on the dev.link dashboard.

Also worth noting that it's not hard to reproduce by hand, e.g.

$  cd $GOROOT/src/runtime
$  go test -i -o t -gcflags=all="-l -N" .
$ ./t -test.count=100 -test.run=TestDebugCallUnsafePoint
--- FAIL: TestDebugCallUnsafePoint (0.00s)
    debug_test.go:220: want "call not at safe point", got %!s(<nil>)
--- FAIL: TestDebugCallUnsafePoint (0.00s)
    debug_test.go:220: want "call not at safe point", got %!s(<nil>)
--- FAIL: TestDebugCallUnsafePoint (0.00s)
    debug_test.go:220: want "call not at safe point", got %!s(<nil>)
--- FAIL: TestDebugCallUnsafePoint (0.00s)
    debug_test.go:220: want "call not at safe point", got %!s(<nil>)
--- FAIL: TestDebugCallUnsafePoint (0.00s)
    debug_test.go:220: want "call not at safe point", got %!s(<nil>)
FAIL

@gopherbot
Copy link

@gopherbot gopherbot commented Jun 4, 2020

Change https://golang.org/cl/236597 mentions this issue: cmd/compile: mark block control instruction unsafe in "all unsafe" functions

@gopherbot gopherbot closed this in f84bbd5 Jun 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
6 participants
You can’t perform that action at this time.