Skip to content

[BUG]: nullptr dereference in create_pp_content_once (internals.h) #6046

@yobeonline

Description

@yobeonline

Required prerequisites

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

3.0.4

Problem description

The crash occurs on Windows when importing my pybind11 lib after pyarrow 18.1.0 is already imported. The conditions for it to crash are weirdly specific:

  • It disappears if my library is compiled in Debug
  • It disappears if i upgrade pyarrow to 19.0.0
  • It disappears if I upgrade to python 3.14
    The nullptr dererefence happens in the function create_pp_content_once when locking pp_set_mutex_ even though the mutex seemed initialized (I cannot be sure however because I was looking at an optimized build).

I reproduced the crash with an empty module compiled with pybind11.

I am building with Visual Studio 2022.

Reproducible example code

#include <pybind11/pybind11.h>

PYBIND11_MODULE(foo, m){}
import pyarrow
import foo

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

3.0.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    triageNew bug, unverified

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions