]> Cypherpunks.ru repositories - gostls13.git/commit
runtime: move Segv and TgkillSegv to testprog
authorCherry Mui <cherryyz@google.com>
Fri, 2 Jun 2023 21:54:57 +0000 (17:54 -0400)
committerCherry Mui <cherryyz@google.com>
Mon, 5 Jun 2023 15:24:08 +0000 (15:24 +0000)
commit6dd3bfbed6f17e7789f092e96408c00c227a8b68
tree1b4ba2a190788f3b431a4b9affd17cc82d765ba7
parent96b79bd3208078835d6a1b9b8c7050554eccc734
runtime: move Segv and TgkillSegv to testprog

The non-cgo test points Segv and TgkillSegv are currently in
testprogcgo. Although the test points don't explicitly use cgo,
being a cgo program, there is still some C code that runs when
the test point is invoked, such as thread creation code.

For the cgo test points, sometimes we fail to unwind the stack if
C code is involved. For the non-cgo ones, we want to always be
able to unwind the stack, so we check for stack unwinding failures.
But if a signal is landed in the small piece of C code mentioned
above, we may still fail to unwind. Move the non-cgo test points
to a pure-Go program to avoid this problem.

May fix #52963.
Updates #59029, #59443, #59492.

Change-Id: I35d99a0dd4c7cdb627e2083d2414887a24a2822d
Reviewed-on: https://go-review.googlesource.com/c/go/+/500535
Reviewed-by: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Cherry Mui <cherryyz@google.com>
src/runtime/crash_cgo_test.go
src/runtime/testdata/testprog/segv.go [new file with mode: 0644]
src/runtime/testdata/testprog/segv_linux.go [new file with mode: 0644]
src/runtime/testdata/testprogcgo/segv.go
src/runtime/testdata/testprogcgo/segv_linux.go