commit | 0bd8c7d24b53d98b9a33e22179c7b89277348cd2 | [log] [tgz] |
---|---|---|
author | Jordan Lewis <jordanthelewis@gmail.com> | Sat Mar 26 00:42:25 2022 +0000 |
committer | Dominik Honnef <dominik@honnef.co> | Sun Apr 03 17:08:28 2022 +0000 |
tree | 73a1eeecfdfbc47706d49f32313f715a02de297c | |
parent | c6cfd1b9c5445e45049bf27f827e92404c70ab44 [diff] |
gocore: bugfix to Go 1.17 cores, Go 1.16 cores and Go 1.11+ cores This CL fixes several bugs in `gocore`, the library that `viewcore` uses to parse a core dump, as well as adds general updates for the more recent Go versions. First, we fix _func types for Go 1.16. In 1.16, the types of a few fields in _func were changed. This commit makes the corresponding change to gocore. This is the commit the changed the field types: CL 248332. Additionally, we updated the func parsing to deal with the new split pclntab. Previously, the code that deserialized the heapArena.bitmap field to check whether addresses contained pointers or not was incorrect. It was treating the entire bitmap as 1 bit per pointer. However, that is not what the bitmap represents. Each byte in the bitmap is actually split in half. The high bits contain the 4 scan bits. And the low bits contain the 4 pointer bits. See https://github.com/golang/go/blob/3b304ce7fe35b9d1e8cf0b0518ed2550c361a010/src/runtime/mbitmap.go#L17-L35 for a more detailed description. This commit corrects the issue and allows gocore to correctly traverse the object graph. Finally, for Go 1.17, we stop subtracting the heap unallocated space represented by curArena from the total size of the heap. This reflects the change that was made in CL 270537. Also, a few incidental fixes: - Stop thrashing the viewcore cache on the first command in interactive mode. - Synthesize types for 0-size arrays in structs Change-Id: Ia1636932d7c6c59bbd640f6b5b00b221369fed44 GitHub-Last-Rev: c66ea5a6d246f1f5f089a49824a91d34ebab5279 GitHub-Pull-Request: golang/debug#7 Reviewed-on: https://go-review.googlesource.com/c/debug/+/321736 Trust: Cherry Mui <cherryyz@google.com> Trust: Daniel Martà <mvdan@mvdan.cc> Reviewed-by: Keith Randall <khr@golang.org> Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org>
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://golang.org/doc/contribute.html.
The main issue tracker for the debug repository is located at https://github.com/golang/go/issues. Prefix your issue with “x/debug:” in the subject line, so it is easy to find.