Skip to content

CPython fails to compile when the internal Py_STACKREF_DEBUG macro is defined #131904

Closed
@tomasr8

Description

@tomasr8

Bug report

Bug description:

When the Py_STACKREF_DEBUG macro is defined here:

// Define this to get precise tracking of stackrefs.
// #define Py_STACKREF_DEBUG 1

CPython fails to compile:

~ make -s
In file included from ./Include/internal/pycore_dict.h:13,
                 from Objects/call.c:4:
./Include/internal/pycore_stackref.h: In function ‘PyStackRef_XCLOSE’:
./Include/internal/pycore_stackref.h:154:21: error: too few arguments to function ‘_Py_stackref_close’
  154 |     PyObject *obj = _Py_stackref_close(ref);
      |                     ^~~~~~~~~~~~~~~~~~
./Include/internal/pycore_stackref.h:64:24: note: declared here
   64 | PyAPI_FUNC(PyObject *) _Py_stackref_close(_PyStackRef ref, const char *filename, int linenumber);
      |                        ^~~~~~~~~~~~~~~~~~
make: *** [Makefile:3127: Objects/call.o] Error 1
make: *** Waiting for unfinished jobs....

This error can probably be fixed by using PyStackRef_CLOSE instead of _Py_stackref_close but this reveals other errors which I'm not sure how to fix.

cc @markshannon since you last worked on this area.

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    interpreter-core(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions