-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Stack Overflow with Deeply Nested Filter Expressions #8900
Comments
Current Quickfix: Increasing the stack size e.g. via the RUST_MIN_STACK environment variable (e.g., to 16MB) temporarily resolves the issue. Long-term Solution: We should probably implement and use a stackless variant of |
Thanks @orlandohohmeier -- note there is some significant work currently being undertaken on the Maybe once that is done, it will be easier to implement a stackless variant 🤔 We have some version of this pattern in the SQL planner already (SqlToRel) |
@alamb, thanks for the pointers! I'll dive into #8913 to understand the ongoing changes in the TreeNode APIs better. Glancing over it and aiming at maintaining the interface things could be done in parallel. I'll also review the existing implementation of the |
Describe the bug
When running a query with a deeply nested filter expression the query fails with stack overflow – the bug initially manifested as a
EXC_BAD_ACCESS
error on macOS in our application. The problem is that the filter expression is recursively normalized usingtransform_up
which can cause stack overflows. This probably also happens in other scenarios where one would end up with a deeply nested tree.Tested/Reproduced with:
version = "34.0.0"
macOS = 14.2.1
To Reproduce
Minimal Reproducible Example:
For it to run into an SO with an optimized release build the depth needs to be increased to 10000.
Expected behavior
The query should complete without errors, despite the complexity of the filter expression.
Additional context
No response
/cc @nfnt
The text was updated successfully, but these errors were encountered: