#1144807 pybind11-dev: Regression introduced from 3.0.0 to 3.0.2

#1144807#5
Date:
2026-08-19 05:03:34 UTC
From:
To:
Dear Maintainer,

Imported from Ubuntu bug https://bugs.launchpad.net/ubuntu/+source/pybind11/+bug/2164501

From 3.0.0 to 3.0.2, pybind11 has a regression causing crashes during interpreter shutdown with `py::enum_<>` by duplicating late-added `def_property_static` argument strings and `function_record` heap-type deallocation to call `PyObject_Free()` and decref the type.

This was first reported in #2163679 where autopkgtest was failing for ecflow with a `free(): invalid pointer` crash. This can be better seen in the stacktrace:

...
#7 malloc_printerr (str=<optimized out>) at ./malloc/malloc.c:5341
No locals.
#8 0x00007ffff7cb0b44 in malloc_printerr_tail (str=<optimized out>) at ./malloc/malloc.c:5358
No locals.
#9 0x00007ffff6d47e6c in pybind11::cpp_function::destruct (rec=0xd940e0, free_strings=true) at /usr/include/pybind11/pybind11.h:769
        arg = @0xd94290: {name = 0x7ffff72523e7 "self", descr = 0x0, value = {<pybind11::detail::object_api<pybind11::handle>> = {<pybind11::detail::pyobject_tag> = {<No data fields>}, <No data fields>}, m_ptr = 0x0}, convert = true, none = false}
        __for_range = std::vector of length 1, capacity 1 = {{name = 0x7ffff72523e7 "self", descr = 0x0, value = {<pybind11::detail::object_api<pybind11::handle>> = {<pybind11::detail::pyobject_tag> = {<No data fields>}, <No data fields>}, m_ptr = 0x0}, convert = true, none = false}}
        __for_begin = <optimized out>
        __for_end = <optimized out>
        next = 0x0
#10 pybind11::detail::function_record_PyTypeObject_methods::tp_dealloc_impl (self=0x7ffff68e97d0) at /usr/include/pybind11/pybind11.h:1250
        py_func_rec = 0x7ffff68e97d0
#11 0x0000000000514c33 in _Py_Dealloc ()
No symbol table info available.
#12 0x0000000000537d59 in ?? ()
No symbol table info available.
#13 0x0000000000514c33 in _Py_Dealloc ()
No symbol table info available.
#14 0x0000000000691dc3 in ?? ()
No symbol table info available.
...

After some digging I found this upstream PR [1] that introduced a latent bug where a `free()` is called on string-literals. This was then noted by the following upstream issues [2] and [3], and addressed with the following PRs [4] and [5]. The eventual stable version of pybind11 is 3.0.3 (see: [6]).

Since the current version of pybind11 for both Resolute and Stonking is 3.0.1-3, it can be assumed that all the following reverse-dependencies are affected (reverse-depends -b pybind11-dev) in both Resolute and Stonking:

- adios2
- amgcl
- aoflagger
- bespokesynth
- camitk
- cctbx
- darkradiant
- dart
- dm-tree
- dolfin
- ecflow
- freecad
- gnuradio
- gr-limesdr
- gridtools
- gtsam
- gudhi
- halide
- kms++
- netgen
- nmodl
- odil
- open3d
- opencc
- opencolorio
- opengv
- openimageio
- opm-common
- opm-simulators
- orocos-kdl
- pybind11-json
- pycuda
- pyosmium
- pytango
- python-awkward
- python-boost-histogram
- python-laszip
- python-mapbox-earcut
- python-samplerate
- pytorch
- pytorch-audio
- pytorch-cluster
- pytorch-rocm
- pytorch-scatter
- pytorch-sparse
- scikit-build-core
- sfst
- simgrid
- spglib
- tinyobjloader
- votca
- xeus-python
- xrt
- ycmd

1. https://github.com/pybind/pybind11/pull/5486
2. https://github.com/pybind/pybind11/issues/5976
3. https://github.com/pybind/pybind11/issues/5991
4. https://github.com/pybind/pybind11/pull/6010
5. https://github.com/pybind/pybind11/pull/6015
6. https://github.com/pybind/pybind11/releases#release-v3.0.3

#1144807#10
Date:
2026-08-19 08:57:46 UTC
From:
To:
This can be seen in the autopkgtest regression of ecflow [1] which
prevents its migration to testing.


[1] https://ci.debian.net/packages/e/ecflow/testing/amd64

#1144807#23
Date:
2026-09-07 19:33:18 UTC
From:
To:
Dear maintainer,

I've prepared an NMU for pybind11 (versioned as 3.0.4-0.1) and uploaded
it to DELAYED/2. Please feel free to tell me if I should cancel it.

cu
Adrian

#1144807#28
Date:
2026-09-08 11:12:39 UTC
From:
To:
I'll make a team upload.

However, note that NMUs which are also a "new upstream release" are
troublesome, as the archive scripts do not allow a team upload
containing the same .orig.tar.gz already in delayed/2, and this
usually forces the real maintainer to either cancel the NMU or ask the
NMUer to cancel it, which is an additional burden.

#1144807#33
Date:
2026-09-08 12:05:25 UTC
From:
To:
We believe that the bug you reported is fixed in the latest version of
pybind11, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 1144807@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Santiago Vila <sanvila@debian.org> (supplier of updated pybind11 package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
Format: 1.8
Date: Tue, 08 Sep 2026 12:40:00 +0200
Source: pybind11
Architecture: source
Version: 3.1.0-1
Distribution: unstable
Urgency: medium
Maintainer: Debian Science Maintainers <debian-science-maintainers@lists.alioth.debian.org>
Changed-By: Santiago Vila <sanvila@debian.org>
Closes: 1138110 1144807
Changes:
 pybind11 (3.1.0-1) unstable; urgency=medium
 .
   * Team upload.
   * New upstream release.
   * Fixes crashes during interpreter shutdown. Closes: #1144807.
   * Update Uploaders field. Closes: #1138110.
   * Drop "Priority: optional" (default).
   * Update standards-version.
   * Switch to debian/salsa-ci.yml.
Checksums-Sha1:
 c64c240d40d31f667146aee1149664502986b4b3 2401 pybind11_3.1.0-1.dsc
 1d140a9278beeaf67203683166affa6b1941acaf 984694 pybind11_3.1.0.orig.tar.gz
 edc753cccf7085ce15f1153527877d761b33c48e 69036 pybind11_3.1.0-1.debian.tar.xz
 bf8db93e151f0e23e712c30ce9fd1cf0a83ed6d7 10879 pybind11_3.1.0-1_source.buildinfo
Checksums-Sha256:
 cec094718917a3a626a367207136db12c704e5cc0382f1d9ff26b61b3445729a 2401 pybind11_3.1.0-1.dsc
 ef712655692a2e9bf7bb7874c022564a45f91d847ddee987e720cd9e28849665 984694 pybind11_3.1.0.orig.tar.gz
 4a7202d7403bb29738ec5b847eab5d1e9e6212b4a47a0de2491f34956e79a6d1 69036 pybind11_3.1.0-1.debian.tar.xz
 c9ce2e209f3dd143ac1eae74dea9a27f7af0095006476e653088b6e0a09320c4 10879 pybind11_3.1.0-1_source.buildinfo
Files:
 d9e94aaf28d5b606244620dc3dd8a035 2401 libs optional pybind11_3.1.0-1.dsc
 235664b4673257b80a9ab79f9b208e94 984694 libs optional pybind11_3.1.0.orig.tar.gz
 f1d08c65581bf27528b0785bcd3ebbaf 69036 libs optional pybind11_3.1.0-1.debian.tar.xz
 12be98429226b9d80303beeb0c0bb514 10879 libs optional pybind11_3.1.0-1_source.buildinfo
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEE1Uw7+v+wQt44LaXXQc5/C58bizIFAmqf6WIACgkQQc5/C58b
izKSugf/fNZiIcxxtGXU756DjzgafoPSoneN38/RdocnZSbiVpzggj5ac6s+Fch5
7Y9Lxb6mKUJR2551kmREqnOi4M96n9amzpK90O58/JXzyEHGPAgyH8ZxMascPUkG
kpnEaiFxZyF297FW+jqtwrXlED2MLcMcoklCA7ZinDIPveT97vzIrQIWr0Ws+mJC
V8IXMF4DcR9ezaNbKe9QLzWRD0MfvbUlb39eX2EnGmc0Id0LbJ4NcxaF0Y2gVhuv
aQp0ZyG/fABYpFCZluHCI/t4FQhk6l/NPmWt7UtPhM8W8OhAMA0e2u4imeaaE1fS
LdfR6zdu36ojP2hL43LTmY4N+dnHJQ==
=fAl1
-----END PGP SIGNATURE-----