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
gccgo: bug in type descriptor equality #32901
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Comments
Change https://golang.org/cl/184718 mentions this issue: |
Change https://golang.org/cl/184717 mentions this issue: |
bcmills
added
the
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
label
Jul 2, 2019
gopherbot
pushed a commit
that referenced
this issue
Jul 3, 2019
This CL adds a test for gccgo bug #32901: not all the type descriptors are registered and thus deduplicated with types created by reflection. It needs a few levels of indirect imports to trigger this bug. Updates #32901. Change-Id: Idbd89bedd63fea746769f2687f3f31c9767e5ec0 Reviewed-on: https://go-review.googlesource.com/c/go/+/184718 Reviewed-by: Ian Lance Taylor <iant@golang.org>
kraj
pushed a commit
to kraj/gcc
that referenced
this issue
Jul 3, 2019
In CL 179598, we were using Gogo::packages_, when compiling the main package, as the list of packages of which we need to register the type descriptors. This is not complete. It only includes main's direct import and one-level indirect imports. It does not include all the packages transitively imported. To fix that, we need to track all the transitive imports. We have almost already done that, for init functions. However, there may be packages that don't need init functions but do need to register type descriptors. For them, we add a dummy init function to its export data. So when we compile the main package we will see all the transitive imports. The dummy init functions are not real functions and are not called. Fixes golang/go#32901. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/184717 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@273009 138bc75d-0d04-0410-961f-82ee72b054a4
Fixed in https://golang.org/cl/184717. Not sure why this isn't auto closed... |
Probably due to #32931. |
gopherbot
pushed a commit
to golang/gofrontend
that referenced
this issue
Jul 3, 2019
In CL 179598, we were using Gogo::packages_, when compiling the main package, as the list of packages of which we need to register the type descriptors. This is not complete. It only includes main's direct import and one-level indirect imports. It does not include all the packages transitively imported. To fix that, we need to track all the transitive imports. We have almost already done that, for init functions. However, there may be packages that don't need init functions but do need to register type descriptors. For them, we add a dummy init function to its export data. So when we compile the main package we will see all the transitive imports. The dummy init functions are not real functions and are not called. Fixes golang/go#32901. Change-Id: I683045273fb1b2ac7cf41617e641d8b4340b85a9 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/184717 Reviewed-by: Ian Lance Taylor <iant@golang.org>
asiekierka
pushed a commit
to WonderfulToolchain/gcc-ia16
that referenced
this issue
May 16, 2022
In CL 179598, we were using Gogo::packages_, when compiling the main package, as the list of packages of which we need to register the type descriptors. This is not complete. It only includes main's direct import and one-level indirect imports. It does not include all the packages transitively imported. To fix that, we need to track all the transitive imports. We have almost already done that, for init functions. However, there may be packages that don't need init functions but do need to register type descriptors. For them, we add a dummy init function to its export data. So when we compile the main package we will see all the transitive imports. The dummy init functions are not real functions and are not called. Fixes golang/go#32901. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/184717 From-SVN: r273009
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
What version of Go are you using (
go version
)?gccgo (GCC) 10.0.0 20190702 (experimental)
What did you do?
Build and run the program below, which has four packages: main imports p, which imports q, which imports r.
main.go
p.go
q.go
r.go
What did you expect to see?
Print true.
What did you see instead?
Print false.
The problem is that in CL 179598 we were using Gogo::packages_ (when compiling the main package) as the list of packages to register type descriptors. But if I understand correctly, this list only includes the direct imports of main, and (one level) indirect imports. It does not include all the packages transitively imported. In the example above, "r" is not included, therefore the type descriptors there are not registered, and not deduplicated with reflect-created types.
The text was updated successfully, but these errors were encountered: