Skip to content

os: TestRootConcurrentClose fails when runtime.AddCleanup is used #71117

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

Closed
cagedmantis opened this issue Jan 3, 2025 · 4 comments
Closed

os: TestRootConcurrentClose fails when runtime.AddCleanup is used #71117

cagedmantis opened this issue Jan 3, 2025 · 4 comments
Assignees
Labels
arch-wasm WebAssembly issues BugReport Issues describing a possible bug in the Go implementation. 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. Testing An issue that has been verified to require only test changes, not just a test failure.
Milestone

Comments

@cagedmantis
Copy link
Contributor

cagedmantis commented Jan 3, 2025

While in the process of replacing the use of runtime.SetFinalizer with runtime.AddCleanup (#70907) in the os package, the TestRootConcurrentClose tests started failing. An investigation into the build error on go.dev/cl/638555 showed that on the gotip-wasip1-wasm_wazero builder, TestRootConcurrentClose fails because the goroutine that is spawned runs continuously and never allows the the original goroutine to continue processing.

Umbrella issue: #71134

@golang/wasm

@cagedmantis cagedmantis added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. arch-wasm WebAssembly issues compiler/runtime Issues related to the Go compiler and/or runtime. labels Jan 3, 2025
@gabyhelp
Copy link

gabyhelp commented Jan 3, 2025

Related Code Changes

(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)

@dmitshur dmitshur added this to the Backlog milestone Jan 3, 2025
@gabyhelp gabyhelp added the Bug label Jan 6, 2025
@mknyszek mknyszek moved this to In Progress in Go Compiler / Runtime Jan 8, 2025
@cagedmantis
Copy link
Contributor Author

Umbrella issue: #71134

@jba jba added BugReport Issues describing a possible bug in the Go implementation. and removed Bug labels Jan 10, 2025
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/640195 mentions this issue: os: skip force the goroutine to be scheduled on WASM

@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 22, 2025
@cherrymui
Copy link
Member

I'll just note that at least on my machine with wazero, go test -short -run=TestRootConcurrentClose -count=2 -v os hangs in the second run of the test even without replacing SetFinalizer with AddCleanup. So I don't think this is a bug in AddCleanup. It is more of #71134.

@github-project-automation github-project-automation bot moved this from In Progress to Done in Go Compiler / Runtime Jan 22, 2025
@dmitshur dmitshur modified the milestones: Backlog, Go1.24 Jan 22, 2025
@dmitshur dmitshur added the Testing An issue that has been verified to require only test changes, not just a test failure. label Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arch-wasm WebAssembly issues BugReport Issues describing a possible bug in the Go implementation. 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. Testing An issue that has been verified to require only test changes, not just a test failure.
Projects
Development

No branches or pull requests

6 participants