Skip to content

[BUG]: trying to catch a py::type_error makes the compilation crash with Clang on Windows #3746

@MatthieuHernandez

Description

@MatthieuHernandez

Required prerequisites

Problem description

The compiler Clang v13.0.0 craches at the linking step on Windows when add to following line to my code :

 try {
    auto casted_values = py::cast<std::vector<int32_t>>(values); // Here values is a py::list&.
  } catch (const py::cast_error& e) {
    throw py::type_error("this method expects integers as param");
  }

The error is :

LLVM ERROR: Associative COMDAT symbol '??0builtin_exception@pybind11@@QEAA@PEBD@Z' does not exist.
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace.

The strange thing is that if I recompile the same code but keep the CMake cache, it works. 🤔
It also works perfectly under Linux with CGG.

Does anyone have an explanation for this?

EDIT : It seems that the problem comes from the try catch but I have no idea why.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions