-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
cmd/cgo: opaque struct pointers are broken since Go 1.15.3 #42032
Comments
CC @randall77 Here type Type struct {
C C.LLVMTypeRef
}
func Int8Type() (t Type) { t.C = C.LLVMInt8Type(); return } I think the issue here is that because |
This works around a bug in Go 1.15.3 by pinning an older version. See: golang/go#42032
This works around a bug in Go 1.15.3 by pinning an older version. See: golang/go#42032
@ianlancetaylor , how would that lead to params[1] being nil? I would expect an overzealous |
@aykevl Your second issue (the reflect.Value.pointer one) I'm tracking at #42076. Here Reproduction note: |
Change https://golang.org/cl/264300 mentions this issue: |
@gopherbot please open a backport issue for 1.15. |
Backport issue(s) opened: #42151 (for 1.15). Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://golang.org/wiki/MinorReleases. |
@aclements Yes, I was evidently wrong. Sorry for the misleading suggestion. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes, it reproduces since 76a2c87 (I bisected to that commit), see #41432.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I ran the following program:
What did you expect to see?
In Go before 76a2c87 it gives output like this, with all pointers set:
What did you see instead?
Since 76a2c87 (in Go 1.15.3), I get output like this:
The pointer values change each run, that's not the issue. The issue is that
params[1]
is nil. To be precise, it appears that values appended to the slice withappend
are nil.Interestingly, when I remove the
name
field of the struct, the issue disappears.While investigating this issue, I also found some other weird behavior that might be related:
Output:
(The result is the same in Go 1.15.3 and in the commit before 76a2c87). I'm including this as this smells like a bug somewhere, although I can't really say where. Maybe the code (2nd snippet) is wrong, but it looks correct to me.
The text was updated successfully, but these errors were encountered: