-
-
Notifications
You must be signed in to change notification settings - Fork 272
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
Compile error using proto in code #600
Comments
What command did you run, exactly? What was your |
I met the same problem, with GOGARBLE=*.
The original codes in gogo/protobuf: func NewUnsafeXXX_InternalExtensions(m map[int32]Extension) XXX_InternalExtensions {
x := &XXX_InternalExtensions{
p: new(struct {
mu sync.Mutex
extensionMap map[int32]Extension
}),
}
x.p.extensionMap = m
return *x
} And the codes generated with -debugdir: func JJQBRarf(pKKAo9Lb map[int32]Extension) XXX_InternalExtensions {
bugSTccM := &XXX_InternalExtensions{
p: /*line IHC2YGin.go:1*/ new(struct {
jenTz2av sync.AzrdG1Dc
e4CKCV5a map[int32]Extension
}),
}
bugSTccM.p.extensionMap = pKKAo9Lb
return *bugSTccM
} The outputs show that it should be |
Codes are compiled with go version go1.19.2 linux/arm64. |
GOGARBLE=* garble -literals -tiny -seed=2b2519936fa82dd90a7d9605ee69e2096dd5ee7a239bea5b6354231422d9daab build -trimpath -ldflags "-s -w -buildid=" |
I'm having the same issue
and it hangs there |
solved by downgrading to v0.7.2 |
I'm fully aware this is still an issue, by the way - I spent multiple hours debugging it last month but I couldn't spot the fix. @theaog if an older version of garble works for you, could you try a git bisect to see if it was a regression in garble? Note that you'll have to set a specific |
I'm not sure if this was a bug in garble or in Go, but it appears to be fixed with the latest master version of Go, golang/go@a5a4744. From https://github.com/golang/protobuf at golang/protobuf@5d5e8c0, with garble as of 98466a1, I get a failure with Go 1.19.4:
and success with Go at the master commit shown above:
I burned some CPU to bisect what change in upstream Go magically fixed the issue, and it points to https://go-review.googlesource.com/c/go/+/422235. It's not too surprising, since unified IR is meant to deduplicate code and fix subtle bugs or discrepancies in the toolchain. I'm still unsure what exactly caused the problem, but I'm inclined to not spend more hours trying to investigate the cause if Go 1.20 will apparently fix it for us. As far as I can tell, we're not misusing Go libraries like go/types. For those of you getting this error: could you please try Go 1.20rc1 and see if you still get the same error? You'll need to build garble with that version of Go as well. |
I'm also having this error with garble version v0.9.1 I wanted to test it without any literals, or tiny, just a build.
though, golang 1.20 release date, if I'm not wrong is 2nd of February 2023. Tomorrow. If and when it comes out, I'll try it again, and see if the error is still occurring. |
For what it's worth, you don't have to wait to try it out. Go 1.20-rc3 came out earlier this month. |
Ha, Go 1.20 is out now :) Narrowly missed it with the comment above. |
Still broken with 1.20 for me. Same error as reported by others. Go 1.20 and garble 0.9.3. |
use the latest master: go install mvdan.cc/garble@master do a |
The current garble release is able to obfuscate it with Go 1.20. While here, re-generate all files to use "go 1.20" directives, and add a TODO about also testing binary builds for each project. See burrowers#600.
To confirm that this now works, CI now obfuscates the entire protobuf module as well. #682 |
The current garble release is able to obfuscate it with Go 1.20. While here, re-generate all files to use "go 1.20" directives, and add a TODO about also testing binary builds for each project. See #600.
I'm not sure this is fixed. At least it isn't for me. and am getting
Note I've also tried to install from the master branch |
This is a separate issue already see #685 |
this is still aissuse i think. |
If so, raise a new issue following the template with reproduction steps. |
the issue is already opened #906 i use a package that use protobuf i can't share the full reproduction steps, because its just a hello world program with this package whatsmeow |
do you think vendor folder might be causing the panic ? |
OK. That is not a compiler error so it's an entirely different kind of issue. Please use #906 instead, and avoid replying in closed threads. |
What version of Garble and Go are you using?
What environment are you running Garble on?
go env
OutputWhat did you do?
github.com/gogo/protobuf/proto
exit status 1,# github.com/gogo/protobuf/proto :1: cannot use new(struct{gAnS1ywh sync.ZhKsEoKJ; t5ZtpFMU map[int32]Extension}) (value of type *struct{gAnS1ywh uBuv_tzJ.ZhKsEoKJ; t5ZtpFMU map[int32]Extension}) as type *struct{mu uBuv_tzJ.ZhKsEoKJ; extensionMap map[int32]Extension} in assignment :1: cannot use new(struct{gAnS1ywh sync.ZhKsEoKJ; t5ZtpFMU map[int32]Extension}) (value of type *struct{gAnS1ywh uBuv_tzJ.ZhKsEoKJ; t5ZtpFMU map[int32]Extension}) as type *struct{mu uBuv_tzJ.ZhKsEoKJ; extensionMap map[int32]Extension} in struct literal exit status 2 # github.com/golang/protobuf/proto :2: unknown field 'Fuz2DW1T' in struct literal of type U9ByUkhc.H7qJWzJo exit status 2 exit status 2
What did you expect to see?
Normal compilation
What did you see instead?
The text was updated successfully, but these errors were encountered: