Skip to content

[BUG]: 3.0.2 is crashing when binding with std containers #5993

@hiphyengine

Description

@hiphyengine

Required prerequisites

What version (or hash if on master) of pybind11 are you using?

3.0.2

Problem description

I updated from 3.0.1 to 3.0.2 and now pybind11 is crashing when the compiled and loaded in Python. I am currently trying it in windows with VS2026 and intel oneAPI compiler. I haven't tried Linux or g++ yet. I also have not narrowed down which container binding is crashing.
version 3.0.1 is working fine. I have attached the crash report. It is coming from Blender. Blender is using python 3.11. The crash is from python.

blender.crash.txt

Reproducible example code

C++

#include <pybind11/pybind11.h>
namespace py = pybind11;

PYBIND11_MAKE_OPAQUE(std::array<double, 3>)
PYBIND11_MAKE_OPAQUE(std::array<int, 3>)
PYBIND11_MAKE_OPAQUE(std::vector<double>)
PYBIND11_MAKE_OPAQUE(std::vector<int>)
PYBIND11_MAKE_OPAQUE(std::vector<uint8_t>)
PYBIND11_MAKE_OPAQUE(std::vector<std::array<double, 3>>)
PYBIND11_MAKE_OPAQUE(std::vector<std::array<int, 3>>)
PYBIND11_MAKE_OPAQUE(std::vector<std::string>)

PYBIND11_MODULE(TestAPI, m, py::mod_gil_not_used())
{
}

Python:

if (os.name == "nt"):
    try:
        ctypes.CDLL(os.path.join(addon_dir, "cAPI\SimulationAPI.cp311-win_amd64.pyd"))
    except OSError as e:
        print(f"Error loading .pyd file: {e}")

from .cAPI import TestAPI

Is this a regression? Put the last known working version here if it is.

3.0.1

Metadata

Metadata

Labels

triageNew bug, unverified

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions