-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Assertion failure in subtype for TypeVar in Union #21191
Comments
Not that I am seriously suggesting this as a fix, but --- a/src/subtype.c
+++ b/src/subtype.c
@@ -42,7 +42,7 @@ extern "C" {
typedef struct {
int depth;
int more;
- uint32_t stack[10]; // stack of bits represented as a bit vector
+ uint32_t stack[100]; // stack of bits represented as a bit vector
} jl_unionstate_t;
// Linked list storing the type variable environment. A new jl_varbinding_t fixes this issue, the disabled test of #21192, and all the cases reported in #20103. But presumable, somewhere |
We might as well make that change as a stopgap. It's not wrong. |
In the hope of finding some time, I'll try (again) to pinpoint the underlying cause here. If I don't succeed in the next days, I'll submit a PR with above patch. Also note #20103 (comment) - the fixes of #20103 are mostly already present in master, not due to this patch. |
This solves #21191 and similar issues, but there probably is an underlying problem yet to be solved which makes such a large stack necessary in the first place.
This solves #21191 and similar issues, but there probably is an underlying problem yet to be solved which makes such a large stack necessary in the first place.
Looks like I can't get my mental picture of what the code should do to match what the actually code does. My understanding is that if |
The forall predicate needs to keep track of all tests that it has already done, and all tests that it still needs to do in order to verify that those two unions are not identical. This causes an exponential explosion in the number of combinations that need to be tested, especially since we can't detect what the value(s) and constraints on Perhaps we should change the abort into a "subtype too complex" exception? or add the ability to malloc a larger table as-needed? |
The original example works now. |
Closing in favor of #27101. |
With assertions disabled, this just segfaults. (Discovered while working on https://github.com/JuliaLang/julia/pull/20626/files#r108347856)
The text was updated successfully, but these errors were encountered: