Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
misc/cgo/test: further reduce likeliness of hang in Test9400
As suggested by #49680, a GC could be in-progress when we
disable GC. Force a GC after we pause to ensure we don't
hang in this case.

For #49695

Change-Id: I4fc4c06ef2ac174217c3dcf7d58c7669226e2d24
Reviewed-on: https://go-review.googlesource.com/c/go/+/367874
Run-TryBot: Paul Murphy <murp@ibm.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: Paul Murphy <murp@ibm.com>
  • Loading branch information
pmur committed Nov 30, 2021
1 parent 5f63f16 commit 7ccbcc9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions misc/cgo/test/testdata/issue9400_linux.go
Expand Up @@ -50,6 +50,8 @@ func test9400(t *testing.T) {
// Disable GC for the duration of the test.
// This avoids a potential GC deadlock when spinning in uninterruptable ASM below #49695.
defer debug.SetGCPercent(debug.SetGCPercent(-1))
// And finish any pending GC after we pause, if any.
runtime.GC()

// Temporarily rewind the stack and trigger SIGSETXID
issue9400.RewindAndSetgid()
Expand Down

0 comments on commit 7ccbcc9

Please sign in to comment.