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 — Abort from `GenericAlias.__sizeof__`: `ob->ob_type != &PyLong_Type` · Issue #127603 · python/cpython

Abort from GenericAlias.__sizeof__: ob->ob_type != &PyLong_Type #127603

New issue
Copy link
New issue
Copy link
Closed
Closed
Abort from GenericAlias.__sizeof__: ob->ob_type != &PyLong_Type#127603
Copy link
Labels
3.12only security fixesonly 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

@devdanzin
devdanzin
opened on Dec 4, 2024
Issue body actions

Crash report

What happened?

It's possible to abort the interpreter in 3.12 by calling __sizeof__ of a GenericAlias instance:

from types import GenericAlias

g = GenericAlias(BaseException, Exception)
g.__sizeof__(1)

Abort message:

python: ./Include/object.h:231: Py_SIZE: Assertion `ob->ob_type != &PyLong_Type' failed.
Aborted

Found using fusil by @vstinner.

CPython versions tested on:

3.12

Operating systems tested on:

Linux

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

Python 3.12.8+ (heads/3.12:8e3c2d2, Dec 4 2024, 10:58:33) [GCC 11.4.0]

Activity

  1. devdanzin
    added
    type-crashA hard crash of the interpreter, possibly with a core dumpA hard crash of the interpreter, possibly with a core dump
    on Dec 4, 2024
  2. vstinner commented on Dec 4, 2024

    @vstinner
    vstinner
    on Dec 4, 2024
    Member
    More actions

    I created #127605 backport to fix the issue.

  3. picnixz
    added
    topic-typing
    interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)
    3.12only security fixesonly security fixes
    and removed
    topic-typing
    on Dec 5, 2024
  4. vstinner commented on Dec 11, 2024

    @vstinner
    vstinner
    on Dec 11, 2024
    Member
    More actions

    Fixed by commit 0964f9f. Thanks for your bug report.

  5. vstinner
    closed this as completedon Dec 11, 2024
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

    3.12only security fixesonly 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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — 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.