]> Cypherpunks repositories - gostls13.git/commit
runtime: regression test for issue 50936
authorMichael Pratt <mpratt@google.com>
Mon, 31 Jan 2022 21:37:40 +0000 (16:37 -0500)
committerMichael Pratt <mpratt@google.com>
Thu, 3 Feb 2022 16:58:29 +0000 (16:58 +0000)
commitf9b761aa76d0cf439a0c996e1b7c06a0fe49314e
tree57d02c8e876497750dfc67ecc2f5cdb290739a56
parentbec8a108b324b2fc68eafeee7293a479813ec4e2
runtime: regression test for issue 50936

Add a regression test for issue 50936 which coerces the runtime into
frequent execution of the cgocall dropg/execute curg assignment race by
making many concurrent cgo calls eligible for P retake by sysmon. This
results in no P during exitsyscall, at which point they will update curg
and will crash if SIGPROF arrives in between updating mp.curg and
mp.curg.m.

This test is conceptually similar to the basic cgo callback test in
aprof.go but with additional concurrency and a sleep in C.

On my machine this test fails ~5% of the time prior to CL 382079.

For #50936.

Change-Id: I21b6c7f2594f9a615a64580ef70a88b692505678
Reviewed-on: https://go-review.googlesource.com/c/go/+/382244
Trust: Michael Pratt <mpratt@google.com>
Run-TryBot: Michael Pratt <mpratt@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
src/runtime/crash_cgo_test.go
src/runtime/testdata/testprogcgo/aprof.go
src/runtime/testdata/testprogcgo/pprof_callback.go [new file with mode: 0644]