libdynd / dynd-python

Python exposure of dynd
http://libdynd.org
Other
120 stars 23 forks source link

dtype vs ndt comparisons segfault #208

Open jreback opened 9 years ago

jreback commented 9 years ago

it would be nice if this doesn't segfault, not sure if we can do anythin about this (though maybe if __array_priority__ is set really high then this will do the reverse comparsion (which ndt handles correctly), e.g. b == a -> False

In [3]: from dynd import ndt

In [4]: a = np.dtype('float')

In [5]: b = ndt.type('int')

In [6]: a == b
/Users/jreback/anaconda/envs/dynd/bin/python.app: line 3:  9062 Segmentation fault: 11  /Users/jreback/anaconda/envs/dynd/python.app/Contents/MacOS/python "$@"
izaid commented 9 years ago

Noted, will get back to you.

mwiebe commented 9 years ago

It's numpy crashing here, I reported an issue to numpy https://github.com/numpy/numpy/issues/3614 but didn't submit a patch to fix it at that time. It's basically because DyND's types have a 'dtype' attribute to get to the dtype for array types easily, and NumPy goes into an infinite loop with that.