-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/compile: internal compiler error instantiating generic type #48185
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
Comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I get the same error with anacrolix/stm@80e033a, running
|
Simpler reproducer for unified IR:
I think this is problem of types2 lazy loading API. In |
I have a fix for the -G=3 version of the issue. I will not close automatically, so the bug can remain open for the unified IR version of the issue. Or we can create separate issues. |
Change https://golang.org/cl/347909 mentions this issue: |
Thanks for all the issue reports, @dsnet and @anacrolix . They are all useful, so don't worry about filing them. Of course, somewhat minimized cases are always appreciated (so it is easier to add a test case). |
Change https://golang.org/cl/347534 mentions this issue: |
For lazy import resolution, there's reentrancy issue with (*Named).load method, when "t.resolve(t)" can lead us to the same named type, thus (*Named).load is called recursively, causing the deadlock. The main problem is that when instantinate a type, we calculate the type hashing, including TParams. Calling t.TParams().Len() triggers the reentrancy call to "(*Named).load". To fix this, just not checking TParams().Len() if we are hashing. Updates #48185 Change-Id: Ie34842d7b10fad5d11fbcf75bb1c64a89deac6b8 Reviewed-on: https://go-review.googlesource.com/c/go/+/347534 Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com> Trust: Robert Griesemer <gri@golang.org> Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Robert Findley <rfindley@google.com> Reviewed-by: Robert Griesemer <gri@golang.org> TryBot-Result: Go Bot <gobot@golang.org>
I apologize for all the bug reports, but I'm hitting another internal compiler error.
Reproduction:
Based on @mdempsky's comment in #48016 (comment), I tried building this with
GOEXPERIMENT=unified
and that also panics, but due to a different problem:The relevant change that seems to cause an ICE is the code that instantiates a generic type:
\cc @danscales @mdempsky @griesemer @ianlancetaylor
The text was updated successfully, but these errors were encountered: