Skip to content
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

reflect call problem with complex64 following dev.regabi merge #44377

Open
thanm opened this issue Feb 18, 2021 · 3 comments
Open

reflect call problem with complex64 following dev.regabi merge #44377

thanm opened this issue Feb 18, 2021 · 3 comments
Assignees
Milestone

Comments

@thanm
Copy link
Member

@thanm thanm commented Feb 18, 2021

What version of Go are you using (go version)?

$ go version
go version devel +e0215315f5 Tue Feb 16 15:51:50 2021 +0000 linux/amd64

Does this issue reproduce with the latest release?

This is a problem with tip only.

What operating system and processor architecture are you using (go env)?

linux/amd64

What did you do?

I've run into a problem with the reflect package; the error is on tip, and looks like it was introduced during the regabi merge.

Git bisect is blaming e021531 https://go-review.googlesource.com/c/go/+/272568 , which makes sense, since that commit is reflect call related.

I've attached a reproducer in the form of a zip file; these files were extracted from a larger automatically generated test case.

Apologies for not being able to create a smaller test case, but for some reason I had a hard time cutting it down -- when I remove parameters from the function in question it seems to make the failure migrate around or disappear.

If you unpack the zip file and run the test case, here is the output:

$ unzip mumbler.zip
$ cd reflbug
$ go run reflbug/main
Error: fail on =xChecker2.Test3= parm 4 elem 0
Error: fail on =pk.Test3= reflect return 0
Error: fail on =pk.Test3= reflect return 1
Error: fail on =pk.Test3= reflect return 3
Error: fail on =pk.Test3= reflect return 4
Error: fail on =pk.Test3= reflect return 6
$

The function in question being called looks like:

func Callee(p0 StructF3S0, p1 uint64, p2 float32, p3 StructF3S3, p4 complex64, p5 ArrayF3S4E1, p6 StructF3S6, p7 StructF3S7) (r0 ArrayF3S6E4, r1 uint8, r2 ArrayF3S7E0, r3 ArrayF3S8E2, r4 complex128, r5 **uint64, r6 int16) {

When this is called from the driver (main.go) via reflection, the value of the paramter "p4" seems to be incorrect.

What did you expect to see?

Run with no errors

What did you see instead?

Errors as described above.

refl.zip

@thanm
Copy link
Member Author

@thanm thanm commented Feb 18, 2021

@thanm thanm added this to the Go1.17 milestone Feb 18, 2021
@mknyszek mknyszek self-assigned this Feb 18, 2021
@mknyszek
Copy link
Contributor

@mknyszek mknyszek commented Feb 18, 2021

thanks Than I'll take a look.

@gopherbot
Copy link

@gopherbot gopherbot commented Feb 18, 2021

Change https://golang.org/cl/293789 mentions this issue: reflect: include the alignment of zero-sized types in stack offsets

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants