Skip to content

Crash msgspec with Python 3.13.* #142671

Description

@shadchin

Bug report

Bug description:

The original problem - msgspec/msgspec#960

In Python 3.13 PyObject_GC_New does not do initialization inline values (aka _PyObject_InitInlineValues).
In Python 3.14 PyObject_GC_New does initialization inline values - https://github.com/python/cpython/blob/main/Python/gc.c#L2377-L2379

Are there any reasons why PyObject_GC_New doesn't do this initialization in Python 3.13?

I tried to fix msgspec by adding a call to the private function _PyObject_InitInlineValues, but this causes other problems.
Can you tell me how to fix this place more correctly? I just came up with the idea to make a copy of the _PyObject_InitInlineValues function in msgspec for Python 3.13.

CPython versions tested on:

3.13

Operating systems tested on:

Linux

Activity

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.13bugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)topic-C-APItype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions