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
Universal OS/X build segfault 11 in arch -i386 mode #4853
Comments
I can't reproduce this on a mac 10.9, how did you build numpy? |
i did pip install originally when I installed 1.8.0 - no build there. On the master branch, I cloned the git repository and did python setup.py build install. Here's the backtrace:
|
sure thats the same testcase? |
not quite the same... it's np.frombuffer(np.zeros(162. np.uint8).data[2:], np.float64). But it should be much the same. I'm debugging it right now, am leaving for the day though, more on it tomorrow. |
I found an issue in the reductions not checking the alignment properly, that causes the crash but your testcase must be wrong, there is no way maximum is called from ´frombuffer´ |
e.g. doubles are only aligned to 4 bytes on i386 so one cannot peel them to 16 byte alignment. Closes numpygh-4853
It had me flummoxed too, the stack trace - I have no idea why it reads that way and I certainly agree with you that the code it says it's executing can't be the code it is executing. But nevertheless, it happened. I just built Numpy, cherry-picking the referenced commit and confirmed, it fixes the problem. I have to say, your rapid response was great, thanks for fixing the problem. Numpy is at the heart of my project, CellProfiler, which is an open-source tool freely available and designed for biological and medical research and drug discovery. We couldn't have done it without you all. |
e.g. doubles are only aligned to 4 bytes on i386 so one cannot peel them to 16 byte alignment. Closes numpygh-4853
e.g. doubles are only aligned to 4 bytes on i386 so one cannot peel them to 16 byte alignment. Closes numpygh-4853
I am getting a segfault 11 when I do a numpy.frombuffer on a buffer that's not 16-byte aligned when I start Python on the i386 architecture in OS/X. The exact same script works on the 64-bit architecture:
$ arch -i386 python
Python 2.7.6 (v2.7.6:3a1db0d2747e, Nov 10 2013, 00:42:54)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy as np
>>> b = "00"+str(np.arange(20).astype(np.float64).data)
>>> np.version.version
'1.10.0.dev-251acc0'
>>> np.frombuffer(b[2:])
Segmentation fault: 11
and on the 64-bit architecture:
OS/X version is 10.9.
I found this on 1.8.0, tested on 1.9 and master branch with the same result. A colleague reports that 1.7 does not have the problem and that the problem is reproduced on his machine with 1.8.
I am guessing that it's SSE-related since the problem only happens if the buffer size is greater than 32 bytes and that's probably when the conditional code decides to use SSE instead of the regular instructions for copying.
The text was updated successfully, but these errors were encountered: