Repository navigation
fix(python): use pybind11 2.13.6 for CPython 3.14 allocator safety - #2108
Merged
jordimas merged 4 commits intoOct 10, 2026
Merged
Conversation
This was referenced Oct 10, 2026
Distinguish the cp314 ABI from cp314t when both release artifacts exist. Keep the exactly-one wheel check and debug-allocator shutdown gate. Verified filename-only probes for coexistence, missing, and duplicate wheels.
Collaborator
|
Thanks so much! |
2 of 3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2107.
Problem
Published CPython 3.14 CTranslate2 4.8.2 wheels import successfully, then abort during interpreter finalization under the debug allocator:
GDB confirms
type_dealloc->PyMem_Free(type->tp_doc). The current wheel's pinned pybind11 2.11.1 allocatestp_docviaPyObject_MALLOC(object domain), while CPython 3.13+ frees it withPyMem_Free(memory domain). Python 3.11's different allocator API intype_deallocexplains the earlier absence of the crash.Changes
python/install_requirements.txtto guarantee both build routes use the fixed allocation behavior.python -X dev -W error::ResourceWarning -c 'import ctranslate2', not merely successful import.Independently validated fix
On the official CPython 3.14.8 GitHub runner, a minimal C++ heap type with docstrings using pybind11 2.11.1 reproduces exit 134, while 2.13.6 and 3.0.1 exit 0: isolated comparison.
Most importantly, a complete CTranslate2 v4.8.2 Python extension was rebuilt from immutable upstream source commit
d44d2d069eb88c7b7804da864c10c201501cb4a9, with pybind11 2.13.6 and the original official native inference core library:python -X dev -W error::ResourceWarning -c 'import ctranslate2, faster_whisper'exited 0; provenance assertion verified the rebuilt extension was loaded.The experiments did not publish or replace wheels. This PR fixes the upstream build inputs and enforces the result on future release artifacts. No model files, credentials, or user data are required.