]> Cypherpunks repositories - gostls13.git/commit
runtime: prioritize panic output over racefini
authorMichael Anthony Knyszek <mknyszek@google.com>
Wed, 30 Jul 2025 00:36:40 +0000 (00:36 +0000)
committerGopher Robot <gobot@golang.org>
Thu, 30 Oct 2025 19:57:08 +0000 (12:57 -0700)
commit89dee70484669d546fff6ca29a4717368af351ff
treea7eea3814465a758aeadb6b61a01458362f829e8
parent8683bb846dfc1460c476cfed1696aad8e681926f
runtime: prioritize panic output over racefini

For some reason CL 646198 uncovered #3934 and #20018 again, but only in
race mode. It turns out that because racefini does not return, and
racefini is called early after main returns, we would not properly wait
for a concurrent panic to complete. This would result in fairly
consistent failures of TestPanicRace, which specifically looks for the
panic output to appear if main concurrently exits.

The important part of this change is that race mode will no longer have
the bug described in #3934 and #20018. A byproduct, however, is that
racefini is that we're essentially prioritizing the panic output over
racefini in this scenario. If racefini were to reveal a latent race
condition and fail, we'll prefer to surface the panic. Such a case is
probably fine, because the panic is always an crashing, unrecoverable
panic.

For #3934.
For #20018.

Change-Id: I0674a75c918563c5ec4ee1eec057dfd096fcfbc8
Reviewed-on: https://go-review.googlesource.com/c/go/+/691795
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
src/runtime/crash_test.go
src/runtime/proc.go