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

cmd/cgo/internal/test: TestThreadLock failures #60265

Closed
gopherbot opened this issue May 17, 2023 · 11 comments
Closed

cmd/cgo/internal/test: TestThreadLock failures #60265

gopherbot opened this issue May 17, 2023 · 11 comments
Assignees
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Milestone

Comments

@gopherbot
Copy link

gopherbot commented May 17, 2023

#!watchflakes
post <- pkg == "cmd/cgo/internal/test" && test == "TestThreadLock" && date < "2023-06-01"

Issue created automatically to collect these failures.

Example (log):

scatter = 0x56e1a3
--- FAIL: TestThreadLock (0.00s)
    cgo_thread_lock.go:50: cgo has not locked OS thread

watchflakes

@gopherbot gopherbot added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label May 17, 2023
@gopherbot
Copy link
Author

Found new dashboard test flakes for:

#!watchflakes
post <- pkg == "cmd/cgo/internal/test" && test == "TestThreadLock"
2023-05-17 13:05 linux-amd64-alpine go@a094a824 cmd/cgo/internal/test.TestThreadLock (log)
scatter = 0x56e1a3
--- FAIL: TestThreadLock (0.00s)
    cgo_thread_lock.go:50: cgo has not locked OS thread

watchflakes

@bcmills bcmills added the compiler/runtime Issues related to the Go compiler and/or runtime. label May 17, 2023
@gopherbot
Copy link
Author

Found new dashboard test flakes for:

#!watchflakes
post <- pkg == "cmd/cgo/internal/test" && test == "TestThreadLock"
2023-05-17 14:46 linux-amd64-longtest go@b7e767b0 cmd/cgo/internal/test.TestThreadLock (log)
--- FAIL: TestThreadLock (0.00s)
    cgo_thread_lock.go:50: cgo has not locked OS thread

watchflakes

@mknyszek
Copy link
Contributor

@aclements points out we might just be running this test under conditions we previously weren't, because they moved this test out of it's original location. It's also possible we were having this failure before under misc/cgo/test, but there don't seem to be any other failures there.

@mknyszek
Copy link
Contributor

Added release-blocker until we can figure out more details. Probably won't be long-term.

@aclements
Copy link
Member

This test has been in the tree for years, but never ran before CL 493603, which I submitted 2 days ago.

@gopherbot
Copy link
Author

Found new dashboard test flakes for:

#!watchflakes
post <- pkg == "cmd/cgo/internal/test" && test == "TestThreadLock"
2023-05-18 00:35 linux-amd64-wsl go@956d31ec cmd/cgo/internal/test.TestThreadLock (log)
--- FAIL: TestThreadLock (0.00s)
    cgo_thread_lock.go:50: cgo has not locked OS thread

watchflakes

@gopherbot
Copy link
Author

Found new dashboard test flakes for:

#!watchflakes
post <- pkg == "cmd/cgo/internal/test" && test == "TestThreadLock"
2023-05-18 01:40 linux-amd64-sid go@6ed84743 cmd/cgo/internal/test.TestThreadLock (log)
--- FAIL: TestThreadLock (0.00s)
    cgo_thread_lock.go:50: cgo has not locked OS thread

watchflakes

@bcmills
Copy link
Contributor

bcmills commented May 18, 2023

I think the test is inherently flaky. The goroutine running testThreadLock could get preempted and moved to a different thread in between the call to syscall.Gettid and the call to C.Ctid.

It was added in https://go.dev/cl/18882.

I suggest that we either delete it (since it never ran before anyway) or change it to make both of the gettid calls from within the C function (before and after the Gosched).

@bcmills bcmills added the NeedsFix The path to resolution is known, but the work has not been done. label May 18, 2023
@gopherbot gopherbot removed the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label May 18, 2023
@gopherbot
Copy link
Author

Change https://go.dev/cl/496182 mentions this issue: cmd/cgo/internal/test: fix TestThreadLock

@gopherbot gopherbot reopened this Sep 8, 2023
@gopherbot
Copy link
Author

Found new dashboard test flakes for:

#!watchflakes
post <- pkg == "cmd/cgo/internal/test" && test == "TestThreadLock"
2023-09-07 16:10 android-386-emu go@dc6513b8 cmd/cgo/internal/test.TestThreadLock (log)
scatter = 0xe87733c0
sqrt is: 0
fatal error: m changed unexpectedly in cgocallbackghello from C


cmd/cgo/internal/test.TestThreadLock(0xbf93d4a0)
	/workdir/go/src/cmd/cgo/internal/test/cgo_test.go:105 +0x37 fp=0xbf8de774 sp=0xbf8de770 pc=0xe873da47
testing.tRunner(0xbf93d4a0, 0xe87f05f8)

watchflakes

@bcmills
Copy link
Contributor

bcmills commented Sep 8, 2023

The above is a different failure mode — looks like a runtime bug rather than a bug in the test.

@bcmills bcmills closed this as completed Sep 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Projects
Status: Done
Development

No branches or pull requests

4 participants