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

Ralf Gommers ralf.gommers at googlemail.com
Thu Jul 19 14:00:45 EDT 2012


On Thu, Jul 19, 2012 at 5:58 PM, Ondřej Čertík <ondrej.certik at gmail.com>wrote:

> 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":
>
> Not surprising, that MinGW is really getting old. It's still the last
available one with gcc 3.x as IIRC.


> 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/
>

Looks like I have an older Wine, not sure if it makes a difference:

$ locate msvcr90.dll
/Users/rgommers/.wine/drive_c/windows/winsxs/x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.21022.8_x-ww_d08d0375/msvcr90.dll
/Users/rgommers/__wine/drive_c/windows/winsxs/x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.21022.8_x-ww_d08d0375/msvcr90.dll

$ locate msvcr71.dll
/Users/rgommers/.wine/drive_c/windows/system32/msvcr71.dll
/Users/rgommers/Code/wine/dlls/msvcr71/msvcr71.dll.fake
/Users/rgommers/Code/wine/dlls/msvcr71/msvcr71.dll.so
/Users/rgommers/__wine/drive_c/windows/system32/msvcr71.dll
/Users/rgommers/wine/build/wine-1.1.39/dlls/msvcr71/msvcr71.dll.fake
/Users/rgommers/wine/build/wine-1.1.39/dlls/msvcr71/msvcr71.dll.so
/Users/rgommers/wine/wine-1.1.39/lib/wine/fakedlls/msvcr71.dll
/Users/rgommers/wine/wine-1.1.39/lib/wine/msvcr71.dll.so
/usr/local/lib/wine/fakedlls/msvcr71.dll
/usr/local/lib/wine/msvcr71.dll.so



>
> 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
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20120719/04e19be9/attachment.html>


More information about the NumPy-Discussion mailing list