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/race: NoRaceMutexPureHappensBefore failures #35745

Closed
bcmills opened this issue Nov 21, 2019 · 10 comments
Closed

runtime/race: NoRaceMutexPureHappensBefore failures #35745

bcmills opened this issue Nov 21, 2019 · 10 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. RaceDetector
Milestone

Comments

@bcmills
Copy link
Contributor

bcmills commented Nov 21, 2019

NoRaceMutexPureHappensBefore             FAILED+
[…]
Passed 347 of 348 tests (99.71%, 1+, 0-)
0 expected failures (0 has not fail)
--- FAIL: TestRace (8.48s)
FAIL
FAIL	runtime/race	22.915s

2019-11-19T19:14:25-8608733/windows-amd64-longtest
2019-11-07T20:34:27-4751db9/windows-amd64-race

CC @aclements

@bcmills bcmills added OS-Windows NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Nov 21, 2019
@bcmills bcmills added this to the Backlog milestone Nov 21, 2019
@dvyukov
Copy link
Member

dvyukov commented Apr 10, 2020

I think we should print the race report for "FAILED+". Or can anybody reproduce this to extract the report?

@bcmills
Copy link
Contributor Author

bcmills commented Dec 4, 2020

CC @dfava

@bcmills
Copy link
Contributor Author

bcmills commented Feb 11, 2021

@bcmills bcmills changed the title runtime/race: NoRaceMutexPureHappensBefore failures on Windows runtime/race: NoRaceMutexPureHappensBefore failures Feb 11, 2021
@dfava
Copy link
Contributor

dfava commented Feb 12, 2021

Most likely the detector is flagging a race when the second go func(){...} is scheduled to run before the first go func() {...}. Indeed, there is a race in this scheduling. One possibility is to bump up the wait time in time.After() until this intermittent failure goes away.

Do we have the output from the race detector?

@gopherbot
Copy link

Change https://golang.org/cl/291292 mentions this issue: testing/race: increase wait time that forces a particular scheduling

@bcmills
Copy link
Contributor Author

bcmills commented Feb 12, 2021

Do we have the output from the race detector?

The log I linked is the only log I have. (If you want to modify TestRace to dump more information on failure, I think that would be an excellent improvement to the test!)

@bcmills
Copy link
Contributor Author

bcmills commented Jan 26, 2022

@gopherbot, please backport to Go 1.16. This is a test-only fix, and the test can spuriously fail in TryBot and release-testing runs for other backports.

@gopherbot
Copy link

Backport issue(s) opened: #50832 (for 1.16).

Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://golang.org/wiki/MinorReleases.

@gopherbot
Copy link

Change https://golang.org/cl/381034 mentions this issue: [release-branch.go1.16] testing/race: fixing intermittent test failure

@dmitshur dmitshur added NeedsFix The path to resolution is known, but the work has not been done. and removed NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Jan 27, 2022
gopherbot pushed a commit that referenced this issue Jan 27, 2022
Test NoRaceMutexPureHappensBefore in runtime/race/testdata/mutex_test.go
expects the second spawned goroutine to run after the first.  The test
attempts to force this scheduling with a 10 millisecond wait.  Following
a suggestion by Bryan Mills, we force this scheduling using a shared
variable whose access take place within the existing mutex.

Fixes #50832.
Updates #35745.

Change-Id: Ib23ec51492ecfeed4752e020401dd25755a669ed
Reviewed-on: https://go-review.googlesource.com/c/go/+/291292
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
Trust: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
(cherry picked from commit aaed6cb)
Reviewed-on: https://go-review.googlesource.com/c/go/+/381034
Trust: Bryan Mills <bcmills@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
@golang golang locked and limited conversation to collaborators Jan 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. RaceDetector
Projects
None yet
Development

No branches or pull requests

5 participants