]> Cypherpunks.ru repositories - gostls13.git/commit
runtime: bypass scheduler when doing traceback for goroutine profile
authorCherry Mui <cherryyz@google.com>
Wed, 10 Nov 2021 00:50:47 +0000 (19:50 -0500)
committerCherry Mui <cherryyz@google.com>
Thu, 11 Nov 2021 15:34:02 +0000 (15:34 +0000)
commit8c73f80400d04a320165f4c1e535524cc50e20b4
tree1c5799e5e3e05da81cd1367ccd7242207d696b70
parent47b3ab5ede452a88c2da4c5eaf092b2d707d2ff4
runtime: bypass scheduler when doing traceback for goroutine profile

When acquire a goroutine profile, we stop the world then acquire a
stack trace for each goroutine. When cgo traceback is used, the
traceback code may call the cgo traceback function using cgocall.
As the world is stopped, cgocall will be blocked at exitsyscall,
causing a deadlock. Bypass the scheduler (using asmcgocall) to fix
this.

Change-Id: Ic4e596adc3711310b6a983d73786d697ef15dd72
Reviewed-on: https://go-review.googlesource.com/c/go/+/362757
Trust: Cherry Mui <cherryyz@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/runtime/crash_cgo_test.go
src/runtime/mprof.go
src/runtime/testdata/testprogcgo/gprof.go [new file with mode: 0644]
src/runtime/testdata/testprogcgo/gprof_c.c [new file with mode: 0644]