-
Notifications
You must be signed in to change notification settings - Fork 18k
debug/dwarf: DW_TAG_reference_type causes a panic when encountered by debug/dwarf #29601
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
Change https://golang.org/cl/157177 mentions this issue: |
I sent a CL to address this. @ilch1 please be warned, I suspect that there are other DWARF C++isms that aren't handled by the Go debug/dwarf package. If you are writing a tool that consumes DWARF from a mixed C++/Go binary (and you're interested primarily in the Go or C parts) you might consider adapting your code to skip the those compile units based on producer. |
Change https://golang.org/cl/157537 mentions this issue: |
I wouldn't generally recommend using |
Yes, there are a several C++ DWARF tags that are not handled by the debug/dwarf package. Is the goal to eventually add support for decoding all of DWARF tags defined in |
I have a counter-proposal: add a
I think that's an anti-goal. |
I like this approach better. There is |
I wasn't aware that |
I am on board for the idea of dwarf.UnsupportedType -- I'll see about creating a patch for that. |
Change https://golang.org/cl/158797 mentions this issue: |
Sent a new CL with dwarf.UnsupportedType: https://go-review.googlesource.com/c/go/+/158797 |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Tried to parse the dwarf information of an elf file.
Compile the following:
Then try to parse the DWARF information from the compiled ELF file, using:
Run:
<prog> a.out
What did you expect to see?
data.Type()
extracting the type of each variableWhat did you see instead?
It appears that the
switch e.Tag {
indebug/dwarf/type.go:readType()
does not handle some dwarf tag types. This results in no error generated and use of a uninitialized global variable (that was not initialized in the switch statements), which ultimately causes the nil dereference.The text was updated successfully, but these errors were encountered: