Navigation Menu

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
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Testing An issue that has been verified to require only test changes, not just a test failure.
Milestone

Comments

@bcmills
Copy link
Contributor

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 the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Dec 12, 2019
@bcmills bcmills added this to the Go1.14 milestone Dec 12, 2019
@cherrymui
Copy link
Member

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
Contributor Author

bcmills commented Jan 21, 2020

@bcmills
Copy link
Contributor Author

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 An issue that has been verified to require only test changes, not just a test failure. label Jan 22, 2020
@bcmills
Copy link
Contributor Author

bcmills commented Feb 21, 2020

@josharian
Copy link
Contributor

@toothrot toothrot modified the milestones: Go1.14, Go1.15 Feb 25, 2020
@bcmills
Copy link
Contributor Author

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
Contributor

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

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

@golang golang locked and limited conversation to collaborators Jun 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Testing An issue that has been verified to require only test changes, not just a test failure.
Projects
None yet
Development

No branches or pull requests

6 participants