-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
numpy.test() leads to segmentation fault on Apple M1 #17964
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I think this build does not include OpenBLAS because I have not built OpenBLAS. |
|
|
@picn0113, according to the test log please, could you provide the build log and GDB backtrace of the segfault? gdb --args python3 runtests.py -t numpy/core/tests/test_multiarray.py
(gdb) run
segfault should appear here
(gdb) backtrace
involved calls should appear here |
please, could you verify #18001 via NumPy version 1.21.0.dev0+193.g2f5abf4d
NumPy relaxed strides checking option: True
NumPy CPU features: NEON NEON_FP16 NEON_VFPV4 ASIMD ASIMDHP? ASIMDDP? |
I have no gdb available and can't find the log.
|
Is this output from pr #18001?
please, could you run the following command and provides URL for git clean -xdf
python3 runtests.py --show-build-log -t numpy/core/tests/test_multiarray.py -- -vv &> build_and_test.log |
|
Why should missing optimizations cause a segfault? |
|
I think apple arm64 should be independence from other aarch64. |
no, the build log just discovered another bug, and according to build_and_test.log we need to dig from
no, both of them are referring to the same thing "the 64-bit state of Armv8", Apple called it "arm64", LLVM/GCC "aarch64". |
For Apple, if SSE3 is not detected, then it should be ARM, right? |
@picn0113 , see comment, Distutils shouldn't test x86 features from the first place. thank you for your report. Is there any possibility to provide backtrace via |
Something is broken and Apple doesn't allow to lldb system python. |
This time I get something new:
It's homebrew's python3 8000 .9. |
|
This is from Apple's console. |
And with Python 3.8.2, the results vary. |
@picn0113 thanks for all of that info! I don't suppose you have a debug python available easily on homebrew, that could be a useful try if you do. The last stack traces seem to originate from within Python, which means that something went wrong earlier. Potentially quite a bit earlier. If you use
you could narrow down things further by copying the precise tests that crashed, e.g.:
I admit that probably doesn't help much on its own, but maybe it can at least help whoever ends up digging deeper to have a more minimal example/starting point. |
I wish you have new hardware earlier. |
|
I think the swing between |
1.21.0.dev0+343.g098a3b417 without OpenBLAS still vary. |
@seiko2plus I don't know why there's no change with Apple's 3.8.2? |
@picn0113, #18001 should fix enabling SIMD optimization but not fixing the current crush, it actually another bug discovered by your build log. unfortunately, I don't have access to M1 to verify the changes or to trace errors.
Do you mean you still see no features enabled? similar to the following: NumPy CPU features: nothing enabled if yes, then please provides me the last build log. |
#ifndef __ARM_NEON_H #if !defined(__ARM_NEON) |
@picn0113, I did some search, It seems to me you're using Rosetta and there's nothing to do here. You should try to install miniforge3 to get a native build. |
|
|
There is no |
@picn0113, I'm going to dig on it , I have now a remote access to DTK.
This error caused by default config of conda python build, you can override it via:
|
|
@picn0113, this another bug in _simd testing unit, you can disable it through build option ..................................................................................................................................................................................F......FF................ [ 48%]
......................................Fatal Python error: Bus error
Current thread 0x0000000104987d40 (most recent call first):
File "/Users/sayed/me/numpy/build/testenv/lib/python3.9/site-packages/numpy/f2py/tests/test_callback.py", line 103 in check_function
File "/Users/sayed/me/numpy/build/testenv/lib/python3.9/site-packages/numpy/f2py/tests/test_callback.py", line 68 in test_all
File "/Users/sayed/mambaforge/lib/python3.9/site-packages/_pytest/python.py", line 183 in pytest_pyfunc_call
File "/Users/sayed/mambaforge/lib/python3.9/site-packages/pluggy/callers.py", line 187 in _multicall
File "/Users/sayed/mambaforge/lib/python3.9/site-packages/pluggy/manager.py", line 84 in <lambda>
File "/Users/sayed/mambaforge/lib/python3.9/site-packages/pluggy/manager.py", line 93 in _hookexec
File "/Users/sayed/mambaforge/lib/python3.9/site-packages/pluggy/hooks.py", line 286 in __call__
File "/Users/sayed/mambaforge/lib/python3.9/site-packages/_pytest/python.py", line 1641 in runtest
File "/Users/sayed/mambaforge/lib/python3.9/site-packages/_pytest/runner.py", line 162 in pytest_runtest_call
File "/Users/sayed/mambaforge/lib/python3.9/site-packages/pluggy/callers.py", line 187 in _multicall
File "/Users/sayed/mambaforge/lib/python3.9/site-packages/pluggy/manager.py", line 84 in <lambda>
File "/Users/sayed/mambaforge/lib/python3.9/site-packages/pluggy/manager.py", line 93 in _hookexec
File "/Users/sayed/mambaforge/lib/python3.9/site-packages/pluggy/hooks.py", line 286 in __call__
File "/Users/sayed/mambaforge/lib/python3.9/site-packages/_pytest/runner.py", line 255 in <lambda>
File "/Users/sayed/mambaforge/lib/python3.9/site-packages/_pytest/runner.py", line 311 in from_call
File "/Users/sayed/mambaforge/lib/python3.9/site-packages/_pytest/runner.py", line 254 in call_runtest_hook
File "/Users/sayed/mambaforge/lib/python3.9/site-packages/_pytest/runner.py", line 215 in call_and_report
File "/Users/sayed/mambaforge/lib/python3.9/site-packages/_pytest/runner.py", line 126 in runtestprotocol
File "/Users/sayed/mambaforge/lib/python3.9/site-packages/_pytest/runner.py", line 109 in pytest_runtest_protocol
File "/Users/sayed/mambaforge/lib/python3.9/site-packages/pluggy/callers.py", line 187 in _multicall
File "/Users/sayed/mambaforge/lib/python3.9/site-packages/pluggy/manager.py", line 84 in <lambda>
File "/Users/sayed/mambaforge/lib/python3.9/site-packages/pluggy/manager.py", line 93 in _hookexec
File "/Users/sayed/mambaforge/lib/python3.9/site-packages/pluggy/hooks.py", line 286 in __call__
File "/Users/sayed/mambaforge/lib/python3.9/site-packages/_pytest/main.py", line 348 in pytest_runtestloop
File "/Users/sayed/mambaforge/lib/python3.9/site-packages/pluggy/callers.py", line 187 in _multicall
File "/Users/sayed/mambaforge/lib/python3.9/site-packages/pluggy/manager.py", line 84 in <lambda>
File "/Users/sayed/mambaforge/lib/python3.9/site-packages/pluggy/manager.py", line 93 in _hookexec
File "/Users/sayed/mambaforge/lib/python3.9/site-packages/pluggy/hooks.py", line 286 in __call__
File "/Users/sayed/mambaforge/lib/python3.9/site-packages/_pytest/main.py", line 323 in _main
File "/Users/sayed/mambaforge/lib/python3.9/site-packages/_pytest/main.py", line 269 in wrap_session
File "/Users/sayed/mambaforge/lib/python3.9/site-packages/_pytest/main.py", line 316 in pytest_cmdline_main
File "/Users/sayed/mambaforge/lib/python3.9/site-packages/pluggy/callers.py", line 187 in _multicall
File "/Users/sayed/mambaforge/lib/python3.9/site-packages/pluggy/manager.py", line 84 in <lambda>
File "/Users/sayed/mambaforge/lib/python3.9/site-packages/pluggy/manager.py", line 93 in _hookexec
File "/Users/sayed/mambaforge/lib/python3.9/site-packages/pluggy/hooks.py", line 286 in __call__
File "/Users/sayed/mambaforge/lib/python3.9/site-packages/_pytest/config/__init__.py", line 162 in main
File "/Users/sayed/me/numpy/build/testenv/lib/python3.9/site-packages/numpy/_pytesttester.py", line 209 in __call__
File "/Users/sayed/me/numpy/runtests.py", line 358 in main
File "/Users/sayed/me/numpy/runtests.py", line 642 in <module> I will release patches to fixing them soon. |
Okay. Thank you @seiko2plus. |
I get a segfault from _mac_os_check and I'm not even on ARM. This whole macos/brew/compiler/python3 combination keeps biting me everytime whenever I update something. |
There are a few PRs linked which are merged, and this is a very early M1 report, so closing. Please open a new issue if it persists. |
Steps to reproduce:
Error message:
Python 3.8.2 (default, Oct 2 2020, 10:45:41)
[Clang 12.0.0 (clang-1200.0.32.27)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
NumPy version 1.21.0.dev0+20201209183119_bffb006
NumPy relaxed strides checking option: True
NumPy CPU features: nothing enabled
........................................................................ [ 0%]
.......................................................x................ [ 1%]
........................................................................ [ 1%]
..........................x.....F....................................... [ 2%]
........................................................................ [ 2%]
...................sss.................................................. [ 3%]
........................................................................ [ 4%]
........................................................................ [ 4%]
.........................x..........x..x..........x..................... [ 5%]
........................................................................ [ 5%]
........................................................................ [ 6%]
...............................................ssss..................... [ 6%]
...........x............................................................ [ 7%]
........................................................................ [ 8%]
........................................................................ [ 8%]
........................................................................ [ 9%]
........................................................................ [ 9%]
........................................................................ [ 10%]
........................................................................ [ 11%]
........................................................................ [ 11%]
........................................................................ [ 12%]
........................................................................ [ 12%]
........................................................................ [ 13%]
........................................................................ [ 13%]
........................................................................ [ 14%]
........................................................................ [ 15%]
........................................................................ [ 15%]
........................................................................ [ 16%]
.........xx...........................................Fatal Python error: Segmentation fault
no gdb
The text was updated successfully, but these errors were encountered: