Description
When doing RobotLocomotion/pybind11#47, I realized that both that PR and the current version of RobotLocomotion/pybind11
segfaults in CPython 3.8.0 debug build on Linux. (Surprised we didn't see it with Mac, but oh well... could be due to it being older 3.8.0)
The following code fails on our newest version of the fork, but not on upstream.
cd pybind11
sudo apt install python3.8-dev python3.8-venv python3.8-dbg
do-build() { (
set -eux;
python_bin=${1}
mode=${2}
git clean -fxd # WARNING!
${python_bin} -m venv ./venv
source ./venv/bin/activate
pip install -U pip wheel
pip install pytest numpy
mkdir build && cd build
cmake .. -GNinja \
-DCMAKE_BUILD_TYPE=${mode} \
-DPYTHON_EXECUTABLE=$(which python)
ninja pytest
) }
# Release
do-build python3.8 Release
# Debug
do-build python3.8-dbg Debug
Segfault info:
python: ../Objects/typeobject.c:3121: _PyType_Lookup: Assertion `!PyErr_Occurred()' failed.
Aborted (core dumped)
Upstream:
- old merge-base: pybind/pybind11@1caf1d061
- Release: Pass, Debug: Segfault
- new merge-base: pybind/pybind11@9c0aa6993
- Release: Pass, Debug: Pass
Fork:
- old: RobotLocomotion/pybind11@58a368ea8e
- Release: Fail, Debug: Segfault
- new: RobotLocomotion/pybind11@58d9205d
- Release: Pass, Debug: Segfault
Note that the above PR (47) makes things pass in non-debug mode, but still fails otherwise.
Should check w/ later CPython 3.8.x versions too.