]> Cypherpunks.ru repositories - gostls13.git/commit
debug/dwarf: delay array type fixup to handle type cycles
authorThan McIntosh <thanm@google.com>
Wed, 12 May 2021 15:03:48 +0000 (11:03 -0400)
committerThan McIntosh <thanm@google.com>
Thu, 13 May 2021 12:32:21 +0000 (12:32 +0000)
commita63cded5e413ffad1ec8088ef7abd10abb7b5252
tree0c709a5d5962ae231d7d868979ec7558c64da649
parent0fa2302ee5db35b4caae6211656f81ebb92cdb0a
debug/dwarf: delay array type fixup to handle type cycles

A user encountered a debug/dwarf crash when running the dwarf2json
tool (https://github.com/volatilityfoundation/dwarf2json) on a
debug-built copy of the linux kernel. In this crash, the DWARF type
reader was trying to examine the contents of an array type while that
array type was still in the process of being constructed (due to
cycles in the type graph).

To avoid such situations, this patch extends the mechanism introduced
in https://go-review.googlesource.com/18459 (which handles typedef
types) to delay fixup of array types as well.

Change-Id: I303f6ce5db1ca4bd79da3581957dfc2bfc17cc01
Reviewed-on: https://go-review.googlesource.com/c/go/+/319329
Trust: Than McIntosh <thanm@google.com>
Run-TryBot: Than McIntosh <thanm@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Yi Chou <yich@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
src/debug/dwarf/type.go