New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nil pointer dereference panic when computing aliasTypeName #798
Labels
bug
Something isn't working
Comments
Thanks for the throrough investigation. This does sound like a bug. Happy to accept a patch with an added test case; otherwise I'll look into a fix soon. |
mvdan
changed the title
panic: runtime error: invalid memory address or nil pointer dereference
nil pointer dereference panic when computing aliasTypeName
Nov 12, 2023
mvdan
added a commit
to mvdan/garble-fork
that referenced
this issue
Nov 14, 2023
TypeName.Pkg is documented as: Pkg returns the package to which the object belongs. The result is nil for labels and objects in the Universe scope. When a struct type embeds a builtin alias type, such as byte, this would lead to a panic since we assumed we could use the Pkg method. Fixes burrowers#798.
lu4p
pushed a commit
that referenced
this issue
Nov 15, 2023
TypeName.Pkg is documented as: Pkg returns the package to which the object belongs. The result is nil for labels and objects in the Universe scope. When a struct type embeds a builtin alias type, such as byte, this would lead to a panic since we assumed we could use the Pkg method. Fixes #798.
Thanks for the quick turn around on this fix! Still was waiting on some internal approval to be able to open a patch w/ test cases 😅 but will validate this on the next version. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What version of Garble and Go are you using?
What environment are you running Garble on?
go env
OutputWhat did you do?
When attempting to garble another project, I found one of our DataDog sub-dependencies (specifically: https://github.com/DataDog/sketches-go/tree/master) caused this panic. This can be reproduced by attempting to garble the project directly:
What did you expect to see?
What did you see instead?
Additional Info
I did some digging into the error and narrowed down the nil pointer panic. From the stack trace its here: https://github.com/burrowers/garble/blob/v0.10.1/main.go#L1424
I pulled some data on the obj:
From the Datadog library side it looks specifically that these 3 lines are the culprit: https://github.com/DataDog/sketches-go/blob/master/ddsketch/encoding/flag.go#L38-L40
If I edit that file and give those byte values arbitrary keys, garble works as expected. ex:
This however isn't a practical workaround since this library sits as a fairly deep sub-dependency of the Datadog tracer library and won't be easy to patch.
The text was updated successfully, but these errors were encountered: