Skip to content

Commit 0e0cd70

Browse files
beneschianlancetaylor
authored andcommitted
runtime: document when cgo traceback function is called
Fixes #24518. Change-Id: I99c79c5a2ab9dbe7f0d257c263da9d2b5d1d55c4 Reviewed-on: https://go-review.googlesource.com/121917 Reviewed-by: Ian Lance Taylor <[email protected]>
1 parent 33f6b08 commit 0e0cd70

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/runtime/traceback.go

+7
Original file line numberDiff line numberDiff line change
@@ -1115,6 +1115,13 @@ func isSystemGoroutine(gp *g) bool {
11151115
// to the symbolizer function, return the file/line of the call
11161116
// instruction. No additional subtraction is required or appropriate.
11171117
//
1118+
// On all platforms, the traceback function is invoked when a call from
1119+
// Go to C to Go requests a stack trace. On linux/amd64, linux/ppc64le,
1120+
// and freebsd/amd64, the traceback function is also invoked when a
1121+
// signal is received by a thread that is executing a cgo call. The
1122+
// traceback function should not make assumptions about when it is
1123+
// called, as future versions of Go may make additional calls.
1124+
//
11181125
// The symbolizer function will be called with a single argument, a
11191126
// pointer to a struct:
11201127
//

0 commit comments

Comments
 (0)