| commit | 1b463205dc9a0f87a8439d95225891d6242711b5 | [log] [tgz] |
|---|---|---|
| author | Michael Anthony Knyszek <mknyszek@google.com> | Thu Dec 19 17:38:58 2024 +0000 |
| committer | Gopher Robot <gobot@golang.org> | Thu Dec 19 12:27:00 2024 -0800 |
| tree | c7dd51bd39121c1752a458ae31f8cbdef9ffe8f5 | |
| parent | 453fb03fae2cddf2a8a275056f12c8290341734c [diff] |
gocore: record global pointers not described in DWARF as roots Currently globals are entirely defined by what we can find in DWARF, but there are some globals (for example, runtime..interfaceSwitch.0) which have no corresponding DWARF. This is problematic, because markObjects uses the full set of global pointers *instead of* the roots we found to mark objects. This is more precise, but creates a discrepancy, and callers (such as the dominator functionality) can't actually find a path to all listed objects. Fix this by walking all these undescribed global pointers and recording them explicitly as "unknown" roots. This makes viewcore much more robust to future changes, at the expense of not being able to type the undescribed things it finds. This change also refactors ForEachRootPtr's internals into something that could be executed from markObjects, and refactors markObjects to be simpler and use the Process APIs. Goroutine stack roots already do this, but globals do not, causing certain intuitive invariants (like that each object in ForEachObject should be reachable from ForEachRoot) to be violated. Change-Id: Ie170098e5e5df929bbef5dee47b068de213a89a4 Reviewed-on: https://go-review.googlesource.com/c/debug/+/637876 Auto-Submit: Nicolas Hillegeer <aktau@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Nicolas Hillegeer <aktau@google.com>
This repository holds utilities and libraries for debugging Go programs.
WARNING! Please expect breaking changes and unstable APIs. Most of them are currently are at an early, experimental stage.
This repository uses Gerrit for code changes. To learn how to submit changes to this repository, see https://go.dev/doc/contribute.
The git repository is https://go.googlesource.com/debug.
The main issue tracker for the debug repository is located at https://go.dev/issues. Prefix your issue with “x/debug:” in the subject line, so it is easy to find.