You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Apple M4 Pro: Unit tests fail with Fatal Python error: Illegal instruction #561
Thread 0x0000ffff46fdf180 (most recent call first):
File "/usr/local/lib/python3.13/concurrent/futures/thread.py", line 90 in _worker
File "/usr/local/lib/python3.13/threading.py", line 994 in run
File "/usr/local/lib/python3.13/threading.py", line 1043 in _bootstrap_inner
File "/usr/local/lib/python3.13/threading.py", line 1014 in _bootstrap
NOTE: The mdio CLI works in a container on Mac.
# HOW TO BUILD AND RUN THIS DOCKERFILE
# docker build -t mdio-nox2 -f .devcontainer/Dockerfile.nox2 .
# docker run -it --rm mdio-nox2 --list
# docker run -it --rm mdio-nox2 -s tests-3.13
#
FROM python:"3.13"-"bookworm"
RUN groupadd --gid 1000 python && useradd --uid 1000 --gid 1000 -m python
USER python
# Add path to the user-installed packages
ENV PYTHONUSERBASE=/home/python/.localvs
ENV PATH="$PYTHONUSERBASE/bin:$PATH"
COPY --chown=python:python ./ /home/python/mdio-pytho
WORKDIR /home/python/mdio-python
RUN pip install .
# Install UV dependency manager and Nox test automator
RUN python3 -m pip install uv=="0.6.11" nox=="2025.2.9"
ENTRYPOINT ["nox"]
CMD ["--list"]
All tests seem to pass in M1 Max. Not sure what is specific to M4 Pro. Would you be able to find out which function is the culprit and then we can look for a fix?
My guess is this is numpy or numba (IBM <> IEEE conversion stuff in SEG-Y) related.
Clarification: to ensure independence from the local environment, the tests are run in a container created from python:3.13-bookworm docker image (see above)
docker run -it --rm mdio-nox --list
docker run -it --rm mdio-nox -s tests-3.13
which is equivalent to running
nox --list
nox -s tests-3.13
Nox can be run in a container without a problem on a Windows machine under docker, but fails on Mac under podman.
Thread 0x0000ffff73fff180 (most recent call first):
File "/usr/local/lib/python3.13/concurrent/futures/thread.py", line 90 in _worker
File "/usr/local/lib/python3.13/threading.py", line 994 in run
File "/usr/local/lib/python3.13/threading.py", line 1043 in _bootstrap_inner
File "/usr/local/lib/python3.13/threading.py", line 1014 in _bootstrap
Activity
tasansal commentedon Jun 20, 2025
All tests seem to pass in M1 Max. Not sure what is specific to M4 Pro. Would you be able to find out which function is the culprit and then we can look for a fix?
My guess is this is numpy or numba (IBM <> IEEE conversion stuff in SEG-Y) related.
https://github.com/TGSAI/segy can you run the unit tests here to rule out the numba case.
tasansal commentedon Jun 20, 2025
Also, are you running the tests with
nox -s testsor manually withpytest. The nox environment ensures correct dependency versions are installed.dmitriyrepin commentedon Jun 24, 2025
Clarification: to ensure independence from the local environment, the tests are run in a container created from python:3.13-bookworm docker image (see above)
docker run -it --rm mdio-nox --list
docker run -it --rm mdio-nox -s tests-3.13
which is equivalent to running
nox --list
nox -s tests-3.13
Nox can be run in a container without a problem on a Windows machine under docker, but fails on Mac under podman.
dmitriyrepin commentedon Jun 24, 2025
Using the same Docker file with the segy code on Mac fails halfway on tests/test_ibm_float.py:
~/Documents/MyCode/segy % docker run -it --rm segy-nox -s tests-3.13
nox > Running session tests-3.13
nox > Creating virtual environment (uv) using python3.13 in .nox/tests-3-13
nox > uv sync --frozen --no-dev
nox > uv export --only-dev --no-hashes -o .nox/tests-3-13/tmp/requirements.txt
nox > uv pip install 'coverage[toml]' pytest pygments s3fs --constraints .nox/tests-3-13/tmp/requirements.txt
nox > coverage run --parallel -m pytest
================================================================= test session starts =================================================================
platform linux -- Python 3.13.4, pytest-8.3.5, pluggy-1.5.0
rootdir: /home/python/segy
configfile: pyproject.toml
collected 255 items
tests/test_accessors.py .. [ 0%]
tests/test_arrays.py ..... [ 2%]
tests/test_cli.py ..... [ 4%]
tests/test_ibm_float.py ..........Fatal Python error: Illegal instruction
Thread 0x0000ffff73fff180 (most recent call first):
File "/usr/local/lib/python3.13/concurrent/futures/thread.py", line 90 in _worker
File "/usr/local/lib/python3.13/threading.py", line 994 in run
File "/usr/local/lib/python3.13/threading.py", line 1043 in _bootstrap_inner
File "/usr/local/lib/python3.13/threading.py", line 1014 in _bootstrap