-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/compile/internal/importer: deadlock in recursion through type parameter #63285
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
@mdempsky in this case I think there is a bug in the unified reader (in the compiler only): specifically here: In this case, SetConstraint is called during the set-up of the parent named type, but (for better or worse) is documented that it should be called only after "the bound's underlying is fully defined". The go/types unified importer calls SetConstraint in a later: Can we do the same in the compiler? The obvious alternative is to make the bound calculation lazy, and that is liable to have a larger blast radius than pushing additional complexity into the importer. |
CC @griesemer as well. Tentatively marked this for 1.22, as I think this bug has existed for a long time; if the fix proves to be safe, perhaps we can back-port. |
This didn't make 1.23, unfortunately. Moving to 1.24. |
Reading through some of the code, I think I have to agree with @findleyr above — Yet, examining the stack trace, it's clear that the type parameters are still just It seems that we did ensure |
Tried out a somewhat trivial port of the In short, we might need to bring over a bit more than initially suspected. |
Change https://go.dev/cl/667215 mentions this issue: |
As mentioned in #60817 (comment)_:
Output:
Here is a Playground where you can reproduce the problem.
Originally posted by @jub0bs in #60817 (comment)
The text was updated successfully, but these errors were encountered: