GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — array iterator segfault on __setstate__() when exhausted · Issue #128961 · python/cpython

array iterator segfault on __setstate__() when exhausted #128961

New issue
Copy link
New issue
Copy link
Closed
Closed
array iterator segfault on __setstate__() when exhausted#128961
Copy link
Labels
extension-modulesC modules in the Modules dirC modules in the Modules dirtype-crashA hard crash of the interpreter, possibly with a core dumpA hard crash of the interpreter, possibly with a core dump

Description

@tom-pytel
tom-pytel
opened on Jan 17, 2025
Issue body actions

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

  • gh-128961: Fix exhausted array iterator crash in __setstate__ #128962
  • [3.13] gh-128961: Fix exhausted array iterator crash in __setstate__() (GH-128962) #128976
  • [3.12] gh-128961: Fix exhausted array iterator crash in __setstate__() (GH-128962) #128977

Activity

  1. tom-pytel
    added
    type-crashA hard crash of the interpreter, possibly with a core dumpA hard crash of the interpreter, possibly with a core dump
    on Jan 17, 2025
  2. tom-pytel
    added a commit that references this issue on Jan 17, 2025

    pythongh-128961: fix array iterator segfault on __setstate__

    7831074
  3. tom-pytel commented on Jan 17, 2025

    @tom-pytel
    tom-pytel
    on Jan 17, 2025
    ContributorAuthor
    More actions

    Ping @erlend-aasland

  4. tom-pytel
    added a commit that references this issue on Jan 17, 2025

    test raise StopIteration after pythongh-128961

    8eab735
  5. picnixz
    added
    extension-modulesC modules in the Modules dirC modules in the Modules dir
    on Jan 18, 2025
  6. erlend-aasland
    added a commit that references this issue on Jan 18, 2025

    gh-128961: Fix exhausted array iterator crash in __setstate__() (#128962

    4dade05
  7. miss-islington
    added 2 commits that reference this issue on Jan 18, 2025

    pythongh-128961: Fix exhausted array iterator crash in __setstate__() (…

    29cbdab

    pythongh-128961: Fix exhausted array iterator crash in __setstate__() (…

    bf59715
  8. erlend-aasland commented on Jan 18, 2025

    @erlend-aasland
    erlend-aasland
    on Jan 18, 2025
    Contributor
    More actions

    Fixed with:

    • gh-128961: Fix exhausted array iterator crash in __setstate__ #128962
    • [3.13] gh-128961: Fix exhausted array iterator crash in __setstate__() (GH-128962) #128976
    • [3.12] gh-128961: Fix exhausted array iterator crash in __setstate__() (GH-128962) #128977

    Auto-merge enabled for the backports. Closing as resolved. Thanks for identifying the bug and fixing it, Tomasz!

  9. erlend-aasland
    closed this as completedon Jan 18, 2025
  10. erlend-aasland commented on Jan 18, 2025

    @erlend-aasland
    erlend-aasland
    on Jan 18, 2025
    Contributor
    More actions

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

  11. erlend-aasland
    added 2 commits that reference this issue on Jan 18, 2025

    [3.12] gh-128961: Fix exhausted array iterator crash in __setstate__() (

    405f6d7

    [3.13] gh-128961: Fix exhausted array iterator crash in __setstate__() (

    c75894a
  12. srinivasreddy
    added a commit that references this issue on Jan 21, 2025

    pythongh-128961: Fix exhausted array iterator crash in __setstate__() (…

    e0f3786
  13. serhiy-storchaka
    added this to Struct, memoryview and array issues 🏗️on Jul 13, 2026
  14. github-project-automation
    moved this to Todo in Struct, memoryview and array issues 🏗️on Jul 13, 2026
  15. github-project-automation
    moved this from Todo to Done in Struct, memoryview and array issues 🏗️on Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    extension-modulesC modules in the Modules dirC modules in the Modules dirtype-crashA hard crash of the interpreter, possibly with a core dumpA hard crash of the interpreter, possibly with a core dump

    Projects

    • Struct, memoryview and array issues 🏗️
      Status
      Done
      Show more project fields

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402520 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.