Skip to content

Commit 7ccbcc9

Browse files
committed
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 <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> Trust: Paul Murphy <[email protected]>
1 parent 5f63f16 commit 7ccbcc9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

misc/cgo/test/testdata/issue9400_linux.go

+2
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ func test9400(t *testing.T) {
5050
// Disable GC for the duration of the test.
5151
// This avoids a potential GC deadlock when spinning in uninterruptable ASM below #49695.
5252
defer debug.SetGCPercent(debug.SetGCPercent(-1))
53+
// And finish any pending GC after we pause, if any.
54+
runtime.GC()
5355

5456
// Temporarily rewind the stack and trigger SIGSETXID
5557
issue9400.RewindAndSetgid()

0 commit comments

Comments
 (0)