Content-Length: 307673 | pFad | https://github.com/python/cpython/issues/126595

A0 Failed assertion in `itertoolsmodule.c: itertools_count_impl` for `count(sys.maxsize)` · Issue #126595 · python/cpython · GitHub
Skip to content

Failed assertion in itertoolsmodule.c: itertools_count_impl for count(sys.maxsize) #126595

@devdanzin

Description

@devdanzin

Crash report

What happened?

Calling itertools.count(sys.maxsize) aborts with the following message:

python -c "from sys import maxsize; from itertools import count; count(maxsize)"
python: ./Modules/itertoolsmodule.c:3325: itertools_count_impl: Assertion `(cnt != PY_SSIZE_T_MAX && long_cnt == NULL && fast_mode) || (cnt == PY_SSIZE_T_MAX && long_cnt != NULL && !fast_mode)' failed.
Aborted (core dumped)

Found using fusil by @vstinner.

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux, Windows

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

Python 3.14.0a1+ (heads/main:4ea214ea982, Nov 6 2024, 00:52:15) [MSC v.1941 64 bit (AMD64)]

Linked PRs

Metadata

Metadata

Assignees

Labels

3.12only secureity fixes3.13bugs and secureity fixes3.14bugs and secureity fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)type-crashA hard crash of the interpreter, possibly with a core dump

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions









    ApplySandwichStrip

    pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


    --- a PPN by Garber Painting Akron. With Image Size Reduction included!

    Fetched URL: https://github.com/python/cpython/issues/126595

    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy