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: incorrect export data for duplicate interface #30659
Comments
This problem seems to be happening fairly late in the game -- from There are four types of interest: T1 named type "LocalM" defined in /src/tm, points to T1 During Export::prepare_types, the traversal visits all four types, When T2 is exported, the code in Interface_type::do_export My feeling at this point is that for the purposes of the exporter, it |
Interesting. One way to look at the problem is to observe that |
Change https://golang.org/cl/166638 mentions this issue: |
Change https://golang.org/cl/166657 mentions this issue: |
Change https://golang.org/cl/166917 mentions this issue: |
New test for issue 30659 (compilation error due to bad export data). Updates #30659. Change-Id: I2541ee3c379e5b22033fea66bb4ebaf720cc5e1f Reviewed-on: https://go-review.googlesource.com/c/go/+/166917 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
…port This change fixes a bug in which two interface types were being incorrectly commoned (considered identical) in the initial stages of writing out types to export data. The indexer does a walk to collect candidates for export, inserting types into a table to eliminate duplicates; as part of this process a local interface type T1 was being commoned with a different interface type T2. This caused a cycle in the exported type graph due to the way embedded interfaces are handled. The fix was to add a new flag to the Type::is_identical utility routine to request that interface type comparison be done by examining the original parse methods, as opposed to the expanded method set, then use the new flag when creating the hash map for the exporter. Fixes golang/go#30659. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/166638 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@269634 138bc75d-0d04-0410-961f-82ee72b054a4
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?linux/amd64
go env
OutputWhat did you do?
Create three packages, "usetm", "tm" and "tm/another/tm".
First package $GOPATH/src/tm/tm.go:
Second package $GOPATH/src/tm/another/tm/tm.go:
Then cd to $GOPATH/usetm and issue a build with gccgo:
$ go build -compiler gccgo .
What did you expect to see?
Successful build
What did you see instead?
Build fails with:
Looking at the export data for GOPATH/src/tm:
Excerpt from $GOPATH/pkg/gccgo_linux_amd64/libtm.a
Note the messed up types (cycle involving 2 and 3). So the problem is really with the export data, not with the error itself (compiler it correct to report a cycle, since that's what the bogus export data says).
The text was updated successfully, but these errors were encountered: