<div dir="ltr">While working in scipy.ndimage I tried to replace the following code, <a href="https://github.com/scipy/scipy/blob/master/scipy/ndimage/src/ni_support.c#L95">see here</a> for the source:<div><br></div><div><font face="monospace, monospace">npy_intp max_lines;</font></div><div><font face="monospace, monospace">int ii;</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">for (ii = 0; ii < array->nd; ii++)</font></div><div><font face="monospace, monospace"> max_lines *= array->dimensions[ii];</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="arial, helvetica, sans-serif">with the in theory equivalent:</font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="monospace, monospace">max_lines = PyArray_SIZE(array);</font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">Oddly enough, the result is a segfault as soon as </font><font face="monospace, monospace">PyArray_SIZE</font><font face="arial, helvetica, sans-serif"> is called, e.g. by running the ndimage tests.</font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">Both numpy and scipy are the latest development versions, built by myself on OSX. Unfortunately I don't have Python and friends built with debug symbols, so the best I have been able to figure out, through printf debugging, is that the segfault happens before </font><font face="monospace, monospace">PyArray_MultiplyList</font><font face="arial, helvetica, sans-serif"> is entered, which made me suspicious of it being</font><font face="arial, helvetica, sans-serif"> related to </font><font face="monospace, monospace">import_array()</font><font face="arial, helvetica, sans-serif"> not being called, but that doesn't seem to be the case.</font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">Any thoughts on what may be causing this?<br clear="all"></font><div><br></div><div>Jaime</div><div><br></div>-- <br><div class="gmail_signature">(\__/)<br>( O.o)<br>( > <) Este es Conejo. Copia a Conejo en tu firma y ayúdale en sus planes de dominación mundial.</div>
</div></div>