[Numpy-discussion] Segfault in mingw in test_arrayprint.TestComplexArray

Ondřej Čertík ondrej.certik at gmail.com
Thu Jul 19 11:58:19 EDT 2012


On Thu, Jul 19, 2012 at 12:58 PM, Ondřej Čertík <ondrej.certik at gmail.com> wrote:
>>> I've nailed it to:
>>>
>>>>>> import numpy as np
>>>>>> np.array([complex(0, 1)], np.complex64)
>>> wine: Unhandled page fault on read access to 0x00000000 at address
>>> (nil) (thread 0009), starting debugger...
>>> ...
>
> Btw, I tried to debug it using:
>
> $ winedbg --gdb "C:\Python27\python"
>
> and I got:
>
>
> Wine-gdb> backtrace
> #0  0x7bc73735 in call_exception_handler ()
>    from /usr/bin/../lib32/wine/ntdll.dll.so
> #1  0x7bc76397 in ?? () from /usr/bin/../lib32/wine/ntdll.dll.so
> #2  0xdeadbabe in ?? ()
> Backtrace stopped: Not enough registers or memory available to unwind further
>
>
>
> So unfortunately it doesn't show where exactly it fails, I would need
> to get the full stack trace. Also I noticed even simpler
> way to segfault it:
>
> import numpy
> numpy.array([1j])


So I have tried the MinGW-5.0.3.exe in Wine, but it tries to install
from some wrong url and it fails to install.
I have unpacked the tarballs by hand into "~/.wine/drive_c/MinGW":

binutils-2.17.50-20070129-1.tar.gz
w32api-3.7.tar.gz
gcc-g77-3.4.5-20051220-1.tar.gz
gcc-g++-3.4.5-20051220-1.tar.gz
gcc-core-3.4.5-20051220-1.tar.gz
mingw-runtime-3.10.tar.gz

also in the same directory, I had to do:

cp ../windows/system32/msvcr90.dll lib/

Also I've added the bin directory to PATH using the following trick:

$ cat > tmp <<EOF
REGEDIT4

[HKEY_CURRENT_USER\Environment]
"PATH"="C:\\\\MinGW\\\\bin"
EOF
$ wine regedit tmp



Then I build and installed numpy using:

wine "C:\Python27\python" setup.py build --compiler=mingw32 install

And now there is no segfault when constructing a complex array! So
newer (newest) mingw miscompiles NumPy somehow...


Anyway, running tests, it gets much farther then before, now it hangs at:


test_multiarray.TestIO.test_ascii ...
err:ntdll:RtlpWaitForCriticalSection section 0x785b7428 "?" wait timed
out in thread 0009, blocked by 0000, retrying (60 sec)
fixme:keyboard:X11DRV_ActivateKeyboardLayout 0x4090409, 0000: semi-stub!
err:ntdll:RtlpWaitForCriticalSection section 0x785b7428 "?" wait timed
out in thread 0009, blocked by 0000, retrying (60 sec)
err:ntdll:RtlpWaitForCriticalSection section 0x785b7428 "?" wait timed
out in thread 0009, blocked by 0000, retrying (60 sec)
...

Not sure what this problem is yet.

Ondrej



More information about the NumPy-Discussion mailing list