isce-framework / isce-framework/isce3

interp1d pybind11 test crashes on macOS M1 (Abort trap: 6)

Open
#31 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
239
Forks
90
Avg merge
13d 1h
Merged PRs (30d)
5

Description

I'm running into a consistent crash when running the interp1d Python bindings on macOS M1, even after a clean rebuild with proper libomp support.

System Info

OS: macOS 14.5 (Apple Silicon M1)

Python: 3.11 (via conda miniforge)

ISCE3 commit: 4.0.6

Compiler: LLVM Clang via Homebrew

OpenMP: libomp installed (brew install libomp)

Build Configuration

export CC=/opt/homebrew/opt/llvm/bin/clang
export CXX=/opt/homebrew/opt/llvm/bin/clang++
cmake ../src \
  -DCMAKE_INSTALL_PREFIX=../install \
  -DCMAKE_BUILD_TYPE=Release \
  -DCMAKE_PREFIX_PATH=$CONDA_PREFIX \
  -DCMAKE_C_COMPILER=$CC \
  -DCMAKE_CXX_COMPILER=$CXX \
  -DPython_EXECUTABLE=$CONDA_PREFIX/bin/python3 \
  -DCMAKE_CXX_FLAGS="-fopenmp=libomp -I/opt/homebrew/opt/libomp/include -I/opt/homebrew/opt/llvm/include" \
  -DCMAKE_EXE_LINKER_FLAGS="-L/opt/homebrew/opt/libomp/lib -lomp"

What I Tried

Rebuilt ISCE3 from scratch with the flags above

Verified libomp is correctly linked

Confirmed import isce3.ext.isce3.core works from Python

But running either of the following tests causes a crash:
def test_bindings():
    import isce3.ext.isce3.core as m
    x = [0.0, 1.0, 2.0]
    y = [0.0, 1.0, 4.0]
    interp = m.interp1d(x, y)
    assert interp(1.5) == pytest.approx(2.25)

def test_big_kernel():
    kernel = m.KnabKernel(40, 0.83)
    z = np.random.randn(1024) + 1j * np.random.randn(1024)
    t = np.random.rand(1024) * 1024
    zt = m.interp1d(kernel, z, t)

Error
Fatal Python error: Aborted
Abort trap: 6

This occurs during test execution via pytest as well, and the traceback always points to the interp1d binding call.

Could this be an ABI or heap allocation issue specific to macOS ARM with pybind11? Would love your help verifying or suggesting a workaround — I’m happy to test any proposed patches.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing test_bindings and test_big_kernel under pytest on macOS 14.5 with the documented Apple Silicon, Clang, Python 3.11, and libomp configuration. Inspect the interp1d Python binding call and its ABI or allocation boundary; done means both examples complete without Fatal Python error: Aborted.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, macos, python
Domain
backend, operating-systems, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.