[Numpy-discussion] Bus error for Debian / SPARC on current trunk

Matthew Brett matthew.brett@gmail....
Mon Mar 5 19:44:03 CST 2012


Hi,

On Mon, Mar 5, 2012 at 11:11 AM, Matthew Brett <matthew.brett@gmail.com> wrote:
> Hi,
>
> On Sun, Mar 4, 2012 at 11:53 PM, Mark Wiebe <mwwiebe@gmail.com> wrote:
>> On Sun, Mar 4, 2012 at 10:34 PM, Matthew Brett <matthew.brett@gmail.com>
>> wrote:
>>>
>>> <snip>
>>> > $ export NPY_SEPARATE_COMPILATION=1
>>>
>>> Thanks, that did it:
>>>
>>> 9194b3af704df71aa9b1ff2f53f169848d0f9dc7 is the first bad commit
>>>
>>> Let me know if I can debug further,
>>
>>
>> That commit was a rewrite of np.concatenate, and I've traced the test
>> function you got the crash in. The only call to concatenate is as follows:
>>
>>>>> a = np.array([True], dtype=object)
>>>>> np.concatenate((a,)*3)
>> array([True, True, True], dtype=object)
>>>>>
>>
>> Can you try this and see if it crashes?
>
> No, that doesn't crash.
>
> Further investigation revealed the crash to be:
>
> (bare-env)[matthew@vagus ~]$ nosetests
> ~/dev_trees/numpy/numpy/lib/tests/test_io.py:TestFromTxt.test_with_masked_column_various
> nose.config: INFO: Ignoring files matching ['^\\.', '^_', '^setup\\.py$']
> Test masked column ... Bus error
>
> Accordingly:
>
> In [1]: import numpy as np
>
> In [2]: from StringIO import StringIO
>
> In [3]: data = StringIO('True 2 3\nFalse 5 6\n')
>
> In [4]: test = np.genfromtxt(data, dtype=None, missing_values='2,5',
> usemask=True)
>
> In [6]: from numpy import ma
>
> In [7]: control = ma.array([(1, 2, 3), (0, 5, 6)], mask=[(0, 1, 0),
> (0, 1, 0)], dtype=[('f0', bool), ('f1', bool), ('f2', int)])
>
> In [8]: test == control
> Bus error
>
>> Another thing you can do is compile with debug information enabled, then run
>> the crashing case in gdb. This will look something like this:
>>
>> $ export CFLAGS=-g
>> $ rm -rf build # make sure it's a fresh build from scratch
>> $ python setup.py install --prefix=<dir> # or however you do it
>> [... build printout]
>> $ gdb python <script/options>
>> [... gdb info]
>> (gdb) run
>>  [... script runs]
>> Program received signal SIGSEGV, Segmentation fault,
>> [crash address]
>> (gdb) backtrace
>> [full backtrace printout]
>>
>> Such a backtrace would be immensely helpful in tracking down why it's
>> crashing.
>
> I'll get back to you with this.

<atest.py>
from StringIO import StringIO

import numpy as np
from numpy import ma

data = StringIO('True 2 3\nFalse 5 6\n')
test = np.genfromtxt(data, dtype=None, missing_values='2,5',
                     usemask=True)
control = ma.array([(1, 2, 3), (0, 5, 6)], mask=[(0, 1, 0), (0, 1, 0)],
                   dtype=[('f0', bool), ('f1', bool), ('f2', int)])
test == control
</atest.py

gdb python
run atest.py

backtrace full attached.

See you,

Matthew
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sparc_bus_error.log
Type: text/x-log
Size: 13328 bytes
Desc: not available
Url : http://mail.scipy.org/pipermail/numpy-discussion/attachments/20120305/6a584123/attachment.bin 


More information about the NumPy-Discussion mailing list