-
-
Notifications
You must be signed in to change notification settings - Fork 273
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
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
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. |
# for free
to join this conversation on GitHub.
Already have an account?
# 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: