Skip to content

Crash when imported before or after Arrow on MacOS #179

@marcelroed

Description

@marcelroed

When using pyarrow at the same time as array_record in Python, I'm getting an initialization issue, I think due to these both being statically linked. There are some more details in this issue.

Here is a minimal reproduction (see apache/arrow#40088 (comment)):

# /// script
# requires-python = ">=3.12"
# dependencies = [
#     "array-record==0.8.1",
#     "pyarrow==21.0.0",
# ]
# ///

from array_record.python import array_record_data_source
import pyarrow
uv run minimal_repro.py
libc++abi: terminating due to uncaught exception of type std::__1::system_error: mutex lock failed: Invalid argument

Or, flipping the order:

# /// script
# requires-python = ">=3.12"
# dependencies = [
#     "array-record==0.8.1",
#     "pyarrow==21.0.0",
# ]
# ///

import pyarrow
from array_record.python import array_record_data_source
uv run minimal_repro2.py
[mutex.cc : 452] RAW: Lock blocking 0x100b1eaa8   @
**HANGS FOREVER**

This is on MacOS 26.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions