]> Cypherpunks.ru repositories - gostls13.git/commit
[release-branch.go1.21] runtime: don't print "unexpected SPWRITE" when printing traceback
authorCherry Mui <cherryyz@google.com>
Fri, 29 Sep 2023 18:00:04 +0000 (14:00 -0400)
committerGopher Robot <gobot@golang.org>
Wed, 10 Jan 2024 19:17:07 +0000 (19:17 +0000)
commitcaafb50c0dd65b3f5c53a73eb5fdb6cf92462964
tree4807b91d9aa3dd6cfee28f639a2c689fae6d307d
parentcc85462b3d23193e4861813ea85e254cfe372403
[release-branch.go1.21] runtime: don't print "unexpected SPWRITE" when printing traceback

The system stack often starts with a stack transition function
like "systemstack" or "mcall", which is marked as SPWRITE. When
unwinding a system stack for printing, we want the traceback stop
at the stack switching frame, but not print the "unexpected
SPWRITE" message.

Previously before CL 525835, we don't print the "unexpected
SPWRITE" message if unwindPrintErrors is set, i.e. printing a
stack trace. This CL restores this behavior.

Another possibility is not printing the message only on the system
stack. We don't expect a stack transition function to appear in a
user G.

Fixes #64935.

Change-Id: I173e89ead2cd4fbf1f0f8cca225f28718b5baebe
Reviewed-on: https://go-review.googlesource.com/c/go/+/531815
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
(cherry picked from commit 15a274b621b3654e9b4962a27c9d14ea51645b6c)
Reviewed-on: https://go-review.googlesource.com/c/go/+/553476
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@google.com>
TryBot-Bypass: Dmitri Shuralyov <dmitshur@golang.org>
src/runtime/crash_unix_test.go
src/runtime/traceback.go