aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/symtab.go
diff options
context:
space:
mode:
authorAustin Clements <austin@google.com>2019-10-10 14:38:15 -0400
committerAustin Clements <austin@google.com>2019-11-02 21:51:16 +0000
commitd16ec137568fb20e674a99c265e7c340c065dd69 (patch)
tree7e61729e505094e6fc1c7336dd48da5fc9c3e041 /src/runtime/symtab.go
parenta3ffb0d9eb948409c0898c6b1803401c9bc68ed4 (diff)
downloadgo-d16ec137568fb20e674a99c265e7c340c065dd69.tar.gz
go-d16ec137568fb20e674a99c265e7c340c065dd69.zip
runtime: scan stacks conservatively at async safe points
This adds support for scanning the stack when a goroutine is stopped at an async safe point. This is not yet lit up because asyncPreempt is not yet injected, but prepares us for that. This works by conservatively scanning the registers dumped in the frame of asyncPreempt and its parent frame, which was stopped at an asynchronous safe point. Conservative scanning works by only marking words that are pointers to valid, allocated heap objects. One complication is pointers to stack objects. In this case, we can't determine if the stack object is still "allocated" or if it was freed by an earlier GC. Hence, we need to propagate the conservative-ness of scanning stack objects: if all pointers found to a stack object were found via conservative scanning, then the stack object itself needs to be scanned conservatively, since its pointers may point to dead objects. For #10958, #24543. Change-Id: I7ff84b058c37cde3de8a982da07002eaba126fd6 Reviewed-on: https://go-review.googlesource.com/c/go/+/201761 Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
Diffstat (limited to 'src/runtime/symtab.go')
-rw-r--r--src/runtime/symtab.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/runtime/symtab.go b/src/runtime/symtab.go
index e99b8cf669..35960e89c5 100644
--- a/src/runtime/symtab.go
+++ b/src/runtime/symtab.go
@@ -255,6 +255,7 @@ const (
funcID_gopanic
funcID_panicwrap
funcID_handleAsyncEvent
+ funcID_asyncPreempt
funcID_wrapper // any autogenerated code (hash/eq algorithms, method wrappers, etc.)
)