-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
Is your feature request related to a problem? Please describe.
Currently we use arbitrary stack sizes, as "suggested" by the operating system.
This leads expressions with deep recursion to crash on some machines, but not others.
Describe the solution you'd like
Get a consistent logical stack size, regardless of operating system or cpu architecture.
Larger, or even "infinite" stack sizes can be implemented with a segmented stack.
Coroutines can be used to implement that, but I don't know if we should commit to coroutines, as their interaction with the GC still isn't quite solved. Currently they're only really used in the evaluator during source filtering, which why we can get away with workarounds, such as:
- Fix gc crash #4944
- and even on macOS Disable GC during coroutine execution + test #7725
Describe alternatives you've considered
Alternatively, we may determine a stack size that is "large enough", configure it to be that large, keep count in the evaluator, and error out, as proposed in
This also has a bad interaction with coroutines, which is having to allocate a significantly larger stack, which makes adding many sources more expensive.
Additional context
- Measure the stack to at least improve the error
- Impossible to trace error: stack overflow (possible infinite recursion) #6361
Priorities
Add 👍 to issues you find important.