Skip to content

Build failure on main and latest Python 3.14 beta (missing mt_continue_should_break) #134768

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
thesamesam opened this issue May 27, 2025 · 1 comment
Labels
3.14 bugs and security fixes 3.15 new features, bugs and security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@thesamesam
Copy link
Contributor

thesamesam commented May 27, 2025

Bug report

Bug description:

The 3.14 branch and main both fail to build with --enable-assertions:

$ ./configure --with-assertions
$ make
[...]
gcc  -fno-strict-overflow -Wsign-compare -g -O3 -Wall    -std=c11 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden  -I./Include/internal -I./Include/internal/mimalloc  -I. -I./Include    -fPIC -c ./Modules/_zstd/compressor.c -o Modules/_zstd/compressor.o
In file included from ./Include/Python.h:19,
                 from ./Modules/_zstd/compressor.c:15:
./Modules/_zstd/compressor.c: In function ‘compress_mt_continue_lock_held’:
./Modules/_zstd/compressor.c:547:20: error: implicit declaration of function ‘mt_continue_should_break’ [-Wimplicit-function-declaration]
  547 |             assert(mt_continue_should_break(&in, &out));
      |                    ^~~~~~~~~~~~~~~~~~~~~~~~
make: *** [Makefile:3579: Modules/_zstd/compressor.o] Error 1

I'll send a patch now.

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

Linked PRs

@thesamesam thesamesam added the type-bug An unexpected behavior, bug, or error label May 27, 2025
@emmatyping emmatyping added stdlib Python modules in the Lib dir 3.14 bugs and security fixes 3.15 new features, bugs and security fixes labels May 27, 2025
@emmatyping emmatyping marked this as a duplicate of #134893 May 29, 2025
gpshead pushed a commit that referenced this issue May 30, 2025
In 121ed71, mt_continue_should_break
was changed to be guarded by `Py_DEBUG`, but it's used in `compress_mt_continue_lock_held`
with just `assert`, so it needs to be available when `NDEBUG` is undefined
too.

`Py_DEBUG` implies `NDEBUG` is undefined, so we can check just that.

Fixes: 121ed71
miss-islington pushed a commit to miss-islington/cpython that referenced this issue May 30, 2025
…onGH-134769)

In 121ed71, mt_continue_should_break
was changed to be guarded by `Py_DEBUG`, but it's used in `compress_mt_continue_lock_held`
with just `assert`, so it needs to be available when `NDEBUG` is undefined
too.

`Py_DEBUG` implies `NDEBUG` is undefined, so we can check just that.
(cherry picked from commit 2f2bee2)

Co-authored-by: Sam James <[email protected]>
Fixes: 121ed71
@gpshead
Copy link
Member

gpshead commented May 30, 2025

thanks!

@gpshead gpshead closed this as completed May 30, 2025
gpshead pushed a commit that referenced this issue May 30, 2025
…134769) (#134916)

gh-134768: Fix definition of `mt_continue_should_break()` (GH-134769)

In 121ed71, mt_continue_should_break
was changed to be guarded by `Py_DEBUG`, but it's used in `compress_mt_continue_lock_held`
with just `assert`, so it needs to be available when `NDEBUG` is undefined
too.

`Py_DEBUG` implies `NDEBUG` is undefined, so we can check just that.
(cherry picked from commit 2f2bee2)


Fixes: 121ed71

Co-authored-by: Sam James <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.14 bugs and security fixes 3.15 new features, bugs and security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

3 participants