-
-
Notifications
You must be signed in to change notification settings - Fork 32.6k
Closed as duplicate of#61502
Closed as duplicate of#61502
Copy link
Labels
3.13bugs and security fixesbugs and security fixes3.14bugs and security fixesbugs and security fixes3.15new features, bugs and security fixesnew features, bugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-crashA hard crash of the interpreter, possibly with a core dumpA hard crash of the interpreter, possibly with a core dump
Description
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
Metadata
Metadata
Assignees
Labels
3.13bugs and security fixesbugs and security fixes3.14bugs and security fixesbugs and security fixes3.15new features, bugs and security fixesnew features, bugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-crashA hard crash of the interpreter, possibly with a core dumpA hard crash of the interpreter, possibly with a core dump