Crash report
What happened?
When creating a deeply nested chain of filter() iterators, Python 3.12 can handle it (although very slow), but Python 3.13 results in a segmentation fault instead of raising an exception.
This appears to be a regression in Python 3.13’s iterator implementation, as user code should never cause a segfault. Ideally, this should raise a RecursionError or another Python exception, not crash the interpreter.
if __name__ == '__main__':
import sys
import gc
def main():
i = filter(bool, range(1000000))
for _ in range(100000):
i = filter(bool, i)
print(list(i))
#sys.setrecursionlimit(1000000)
main()
CPython versions tested on:
3.13
Operating systems tested on:
Linux
Output from running 'python -VV' on the command line:
Python 3.13.2 crashes with:Segmentation fault (core dumped) Python 3.12.9 executes successfully (though very slow).
Linked PRs
Crash report
What happened?
When creating a deeply nested chain of filter() iterators, Python 3.12 can handle it (although very slow), but Python 3.13 results in a segmentation fault instead of raising an exception.
This appears to be a regression in Python 3.13’s iterator implementation, as user code should never cause a segfault. Ideally, this should raise a RecursionError or another Python exception, not crash the interpreter.
CPython versions tested on:
3.13
Operating systems tested on:
Linux
Output from running 'python -VV' on the command line:
Python 3.13.2 crashes with:Segmentation fault (core dumped) Python 3.12.9 executes successfully (though very slow).
Linked PRs