Skip to content

Commit 38aa2f5

Browse files
committed
debug
1 parent e434b5e commit 38aa2f5

File tree

1 file changed

+24
-3
lines changed

1 file changed

+24
-3
lines changed

.github/workflows/build-with-clang.yml

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,29 @@ jobs:
9393
- name: Run mkl_umath tests
9494
run: |
9595
source ${{ env.ONEAPI_ROOT }}/setvars.sh
96+
ulimit -c unlimited
9697
pip install pytest
97-
# mkl_umath cannot be installed in editable mode, we need
98-
# to change directory before importing it and running tests
9998
cd ..
100-
python -X faulthandler -m pytest -q --pyargs mkl_umath/mkl_umath/tests -k "not patch"
99+
# First a minimal import to see if pure import crashes
100+
python -X faulthandler -c "import numpy, mkl_umath; print('import-only OK')"
101+
# Run tests normally; expect segfault
102+
python -X faulthandler -m pytest -q --pyargs mkl_umath/mkl_umath/tests || echo "pytest exit code=$?"
103+
COREFILE=$(ls core* 2>/dev/null | head -1 || true)
104+
if [ -f "$COREFILE" ]; then
105+
echo "Core file: $COREFILE"
106+
gdb -batch -ex "bt full" -ex "info threads" python "$COREFILE"
107+
else
108+
echo "No core produced"
109+
fi
110+
# Retry with MKL mitigations to confirm cause
111+
export MKL_DISABLE_FAST_MM=1
112+
export MKL_THREADING_LAYER=SEQUENTIAL
113+
python -X faulthandler -c "import numpy, mkl_umath; print('sequential + fast_mm disabled import OK')"
114+
python -X faulthandler -m pytest -q --pyargs mkl_umath/mkl_umath/tests || echo "pytest (sequential) exit code=$?"
115+
# Show loaded modules
116+
python - <<'EOF'
117+
import sys, mkl_umath, numpy
118+
print("Loaded mkl_umath from:", mkl_umath.__file__)
119+
print("MKL_THREADING_LAYER =", __import__('os').environ.get('MKL_THREADING_LAYER'))
120+
print("Has _ufuncs:", '_ufuncs' in dir(mkl_umath))
121+
EOF

0 commit comments

Comments
 (0)