diff options
author | Nikhil Benesch <nikhil.benesch@gmail.com> | 2018-07-02 11:29:11 -0400 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2018-07-03 04:16:23 +0000 |
commit | 0e0cd70ecf6b5f0d9c8271f68b8fcc9f85cd6598 (patch) | |
tree | dc4892b1120a87f1606eced6b9610e421ff8cfa0 /src/runtime/traceback.go | |
parent | 33f6b08ffe5cfcb8efc4b6529ff8e23e04290b84 (diff) | |
download | go-0e0cd70ecf6b5f0d9c8271f68b8fcc9f85cd6598.tar.gz go-0e0cd70ecf6b5f0d9c8271f68b8fcc9f85cd6598.zip |
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 <iant@golang.org>
Diffstat (limited to 'src/runtime/traceback.go')
-rw-r--r-- | src/runtime/traceback.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/runtime/traceback.go b/src/runtime/traceback.go index cc5e01eb8b3..49536539008 100644 --- a/src/runtime/traceback.go +++ b/src/runtime/traceback.go @@ -1115,6 +1115,13 @@ func isSystemGoroutine(gp *g) bool { // to the symbolizer function, return the file/line of the call // instruction. No additional subtraction is required or appropriate. // +// On all platforms, the traceback function is invoked when a call from +// Go to C to Go requests a stack trace. On linux/amd64, linux/ppc64le, +// and freebsd/amd64, the traceback function is also invoked when a +// signal is received by a thread that is executing a cgo call. The +// traceback function should not make assumptions about when it is +// called, as future versions of Go may make additional calls. +// // The symbolizer function will be called with a single argument, a // pointer to a struct: // |