Skip to content

3.15.0a2 doesn't compile with --with-pydebug #142038

@xhochy

Description

@xhochy

Bug report

Bug description:

When configured using ./configure --with-pydebug (and explicitly not using --with-assertions), the build fails with:

+ make -j2 -C build-shared EXTRA_CFLAGS= LIBRARY=libpython3.15t-pic.a libpython3.15t-pic.a
make: Entering directory '/home/conda/feedstock_root/build_artifacts/python-split_1764324859162/work/build-shared'
x86_64-conda-linux-gnu-gcc -pthread -c -fno-strict-overflow -Wsign-compare -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -Og -Wall -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O0 -ffunction-sections -pipe -isystem /home/conda/feedstock_root/build_artifacts/python-split_1764324859162/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/include -fdebug-prefix-map=/home/conda/feedstock_root/build_artifacts/python-split_1764324859162/work=/usr/local/src/conda/python-3.15.0a2 -fdebug-prefix-map=/home/conda/feedstock_root/build_artifacts/python-split_1764324859162/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol=/usr/local/src/conda-prefix -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O0 -ffunction-sections -pipe -isystem /home/conda/feedstock_root/build_artifacts/python-split_1764324859162/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/include -fdebug-prefix-map=/home/conda/feedstock_root/build_artifacts/python-split_1764324859162/work=/usr/local/src/conda/python-3.15.0a2 -fdebug-prefix-map=/home/conda/feedstock_root/build_artifacts/python-split_1764324859162/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol=/usr/local/src/conda-prefix  -std=c11 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden  -I/home/conda/feedstock_root/build_artifacts/python-split_1764324859162/work/Include/internal -I/home/conda/feedstock_root/build_artifacts/python-split_1764324859162/work/Include/internal/mimalloc -IObjects -IInclude -IPython -I. -I/home/conda/feedstock_root/build_artifacts/python-split_1764324859162/work/Include -DNDEBUG -D_FORTIFY_SOURCE=2 -O0 -isystem /home/conda/feedstock_root/build_artifacts/python-split_1764324859162/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/include -I/home/conda/feedstock_root/build_artifacts/python-split_1764324859162/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/include -DNDEBUG -D_FORTIFY_SOURCE=2 -O0 -isystem /home/conda/feedstock_root/build_artifacts/python-split_1764324859162/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/include -I/home/conda/feedstock_root/build_artifacts/python-split_1764324859162/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/include -fPIC -DPy_BUILD_CORE -o Objects/typeobject.o /home/conda/feedstock_root/build_artifacts/python-split_1764324859162/work/Objects/typeobject.c
x86_64-conda-linux-gnu-gcc -pthread -c -fno-strict-overflow -Wsign-compare -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -Og -Wall -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O0 -ffunction-sections -pipe -isystem /home/conda/feedstock_root/build_artifacts/python-split_1764324859162/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/include -fdebug-prefix-map=/home/conda/feedstock_root/build_artifacts/python-split_1764324859162/work=/usr/local/src/conda/python-3.15.0a2 -fdebug-prefix-map=/home/conda/feedstock_root/build_artifacts/python-split_1764324859162/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol=/usr/local/src/conda-prefix -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O0 -ffunction-sections -pipe -isystem /home/conda/feedstock_root/build_artifacts/python-split_1764324859162/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/include -fdebug-prefix-map=/home/conda/feedstock_root/build_artifacts/python-split_1764324859162/work=/usr/local/src/conda/python-3.15.0a2 -fdebug-prefix-map=/home/conda/feedstock_root/build_artifacts/python-split_1764324859162/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol=/usr/local/src/conda-prefix  -std=c11 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden  -I/home/conda/feedstock_root/build_artifacts/python-split_1764324859162/work/Include/internal -I/home/conda/feedstock_root/build_artifacts/python-split_1764324859162/work/Include/internal/mimalloc -IObjects -IInclude -IPython -I. -I/home/conda/feedstock_root/build_artifacts/python-split_1764324859162/work/Include -DNDEBUG -D_FORTIFY_SOURCE=2 -O0 -isystem /home/conda/feedstock_root/build_artifacts/python-split_1764324859162/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/include -I/home/conda/feedstock_root/build_artifacts/python-split_1764324859162/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/include -DNDEBUG -D_FORTIFY_SOURCE=2 -O0 -isystem /home/conda/feedstock_root/build_artifacts/python-split_1764324859162/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/include -I/home/conda/feedstock_root/build_artifacts/python-split_1764324859162/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/include -fPIC -DPy_BUILD_CORE -o Objects/unicode_format.o /home/conda/feedstock_root/build_artifacts/python-split_1764324859162/work/Objects/unicode_format.c
In file included from /home/conda/feedstock_root/build_artifacts/python-split_1764324859162/_build_env/x86_64-conda-linux-gnu/sysroot/usr/include/assert.h:36,
                 from /home/conda/feedstock_root/build_artifacts/python-split_1764324859162/work/Include/Python.h:20,
                 from /home/conda/feedstock_root/build_artifacts/python-split_1764324859162/work/Objects/unicode_format.c:43:
/home/conda/feedstock_root/build_artifacts/python-split_1764324859162/_build_env/x86_64-conda-linux-gnu/sysroot/usr/include/features.h:330:4: warning: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Wcpp]
  330 | #  warning _FORTIFY_SOURCE requires compiling with optimization (-O)
      |    ^~~~~~~
In file included from /home/conda/feedstock_root/build_artifacts/python-split_1764324859162/_build_env/x86_64-conda-linux-gnu/sysroot/usr/include/assert.h:36,
                 from /home/conda/feedstock_root/build_artifacts/python-split_1764324859162/work/Include/Python.h:20,
                 from /home/conda/feedstock_root/build_artifacts/python-split_1764324859162/work/Objects/typeobject.c:3:
/home/conda/feedstock_root/build_artifacts/python-split_1764324859162/_build_env/x86_64-conda-linux-gnu/sysroot/usr/include/features.h:330:4: warning: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Wcpp]
  330 | #  warning _FORTIFY_SOURCE requires compiling with optimization (-O)
      |    ^~~~~~~
In file included from /home/conda/feedstock_root/build_artifacts/python-split_1764324859162/work/Include/internal/pycore_weakref.h:11,
                 from /home/conda/feedstock_root/build_artifacts/python-split_1764324859162/work/Objects/typeobject.c:24:
/home/conda/feedstock_root/build_artifacts/python-split_1764324859162/work/Include/internal/pycore_critical_section.h: In function '_PyCriticalSection_AssertHeld':
/home/conda/feedstock_root/build_artifacts/python-split_1764324859162/work/Include/internal/pycore_critical_section.h:221:29: warning: unused variable 'cs' [-Wunused-variable]
  221 |         PyCriticalSection2 *cs = (PyCriticalSection2 *)(prev & ~_Py_CRITICAL_SECTION_MASK);
      |                             ^~
/home/conda/feedstock_root/build_artifacts/python-split_1764324859162/work/Include/internal/pycore_critical_section.h:225:28: warning: unused variable 'cs' [-Wunused-variable]
  225 |         PyCriticalSection *cs = (PyCriticalSection *)(tstate->critical_section & ~_Py_CRITICAL_SECTION_MASK);
      |                            ^~
/home/conda/feedstock_root/build_artifacts/python-split_1764324859162/work/Include/internal/pycore_critical_section.h: In function '_PyCriticalSection_AssertHeldObj':
/home/conda/feedstock_root/build_artifacts/python-split_1764324859162/work/Include/internal/pycore_critical_section.h:240:29: warning: unused variable 'cs' [-Wunused-variable]
  240 |         PyCriticalSection2 *cs = (PyCriticalSection2 *)(prev & ~_Py_CRITICAL_SECTION_MASK);
      |                             ^~
/home/conda/feedstock_root/build_artifacts/python-split_1764324859162/work/Include/internal/pycore_critical_section.h:246:28: warning: unused variable 'cs' [-Wunused-variable]
  246 |         PyCriticalSection *cs = (PyCriticalSection *)(prev & ~_Py_CRITICAL_SECTION_MASK);
      |                            ^~
/home/conda/feedstock_root/build_artifacts/python-split_1764324859162/work/Include/internal/pycore_critical_section.h:236:14: warning: unused variable 'mutex' [-Wunused-variable]
  236 |     PyMutex *mutex = &_PyObject_CAST(op)->ob_mutex;
      |              ^~~~~
/home/conda/feedstock_root/build_artifacts/python-split_1764324859162/work/Objects/typeobject.c: In function 'set_tp_bases':
/home/conda/feedstock_root/build_artifacts/python-split_1764324859162/work/Objects/typeobject.c:106:10: error: implicit declaration of function 'types_world_is_stopped' [-Wimplicit-function-declaration]
  106 |     if (!types_world_is_stopped()) { _Py_CRITICAL_SECTION_ASSERT_MUTEX_LOCKED(TYPE_LOCK); }
      |          ^~~~~~~~~~~~~~~~~~~~~~
/home/conda/feedstock_root/build_artifacts/python-split_1764324859162/work/Objects/typeobject.c:113:33: note: in expansion of macro 'ASSERT_TYPE_LOCK_HELD'
  113 |     if (TYPE_IS_REVEALED(tp)) { ASSERT_TYPE_LOCK_HELD(); }
      |                                 ^~~~~~~~~~~~~~~~~~~~~
/home/conda/feedstock_root/build_artifacts/python-split_1764324859162/work/Objects/typeobject.c:604:5: note: in expansion of macro 'ASSERT_NEW_TYPE_OR_LOCKED'
  604 |     ASSERT_NEW_TYPE_OR_LOCKED(self);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~

This was introduced in #140133 which tried to fix #133177

CPython versions tested on:

3.15

Operating systems tested on:

Linux

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.15new features, bugs and security fixesbuildThe build process and cross-buildinterpreter-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