Skip to content
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

array iterator segfault on __setstate__() when exhausted #128961

Closed
tom-pytel opened this issue Jan 17, 2025 · 3 comments
Closed

array iterator segfault on __setstate__() when exhausted #128961

tom-pytel opened this issue Jan 17, 2025 · 3 comments
Labels
extension-modules C modules in the Modules dir type-crash A hard crash of the interpreter, possibly with a core dump

Comments

@tom-pytel
Copy link
Contributor

tom-pytel commented Jan 17, 2025

Crash report

What happened?

>>> import array
... a = array.array('i')
... it = iter(a)
... list(it)
... it.__setstate__(0)
... 
Segmentation fault (core dumped)

This goes back at least to py 3.8 (checked on that one), PR fix incoming.

CPython versions tested on:

3.14

Operating systems tested on:

Linux

Output from running 'python -VV' on the command line:

Python 3.14.0a4+ (heads/arrayiter:7d97bc8eda, Jan 17 2025, 16:24:27) [GCC 11.4.0]

Linked PRs

@tom-pytel tom-pytel added the type-crash A hard crash of the interpreter, possibly with a core dump label Jan 17, 2025
tom-pytel added a commit to tom-pytel/cpython that referenced this issue Jan 17, 2025
@tom-pytel
Copy link
Contributor Author

Ping @erlend-aasland

tom-pytel added a commit to tom-pytel/cpython that referenced this issue Jan 17, 2025
@picnixz picnixz added the extension-modules C modules in the Modules dir label Jan 18, 2025
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Jan 18, 2025
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Jan 18, 2025
@erlend-aasland
Copy link
Contributor

@erlend-aasland
Copy link
Contributor

For the record: this was discovered while the OP was working on #128943.

erlend-aasland pushed a commit that referenced this issue Jan 18, 2025
erlend-aasland pushed a commit that referenced this issue Jan 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extension-modules C modules in the Modules dir type-crash A hard crash of the interpreter, possibly with a core dump
Projects
None yet
Development

No branches or pull requests

3 participants