Skip to content

gh-142038: Expand guard for types_world_is_stopped to fix debug builds without assertions - #142039

Merged
vstinner merged 2 commits into
python:mainfrom
xhochy:gh-142038
Dec 3, 2025
Merged

vstinner merged 2 commits into
python:mainfrom
xhochy:gh-142038

Conversation

@xhochy

@xhochy xhochy commented Nov 28, 2025 •

Copy link
Copy Markdown
Contributor

The types_world_is_stopped() function needs to be defined if NDEBUG or when we're in a debug build is not defined.

Issue:

@bedevere-app

bedevere-app Bot commented Nov 28, 2025

Copy link
Copy Markdown

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

Comment thread Objects/typeobject.c Outdated
#define END_TYPE_DICT_LOCK() Py_END_CRITICAL_SECTION2()

#ifndef NDEBUG
#if !defined(NDEBUG) || defined(Py_Debug)

@picnixz picnixz Nov 28, 2025 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name of the macro is not Py_Debug but Py_DEBUG And ideally, I think we should instead use Py_DEBUG rather than NDEBUG.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, this should be just Py_DEBUG.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We had that before, and that caused problems for non-debug builds with --with-assertions. This issue was then addressed by #140133, which, however, introduced a new problem with debug-without-assertions builds.

@bedevere-app

bedevere-app Bot commented Nov 28, 2025

Copy link
Copy Markdown

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@vstinner

vstinner commented Dec 2, 2025

Copy link
Copy Markdown
Member

Can someone else reproduce #142038 issue?

@vstinner vstinner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vstinner
vstinner merged commit f6f456f into python:main Dec 3, 2025
@bedevere-bot

Copy link
Copy Markdown

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot s390x Fedora Stable Clang Installed 3.x (tier-3) has failed when building commit f6f456f.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/1645/builds/1663) and take a look at the build logs.
  4. Check if the failure is related to this commit (f6f456f) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/1645/builds/1663

Failed tests:

  • test_profiling

Failed subtests:

  • test_gil_mode_integration_behavior - test.test_profiling.test_sampling_profiler.test_modes.TestGilModeFiltering.test_gil_mode_integration_behavior

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-s390x.clang-installed/build/target/lib/python3.15/test/test_profiling/test_sampling_profiler/test_modes.py", line 384, in test_gil_mode_integration_behavior
    with test_subprocess(gil_test_script) as subproc:
         ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-s390x.clang-installed/build/target/lib/python3.15/contextlib.py", line 141, in __enter__
    return next(self.gen)
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-s390x.clang-installed/build/target/lib/python3.15/test/test_profiling/test_sampling_profiler/helpers.py", line 85, in test_subprocess
    raise RuntimeError(
        f"Unexpected response from subprocess: {response!r}"
    )
RuntimeError: Unexpected response from subprocess: b'readythreads_ready'
@xhochy
xhochy deleted the gh-142038 branch December 4, 2025 09:45
StanFromIreland pushed a commit to StanFromIreland/cpython that referenced this pull request Dec 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

6 participants