[Numpy-discussion] Strange crash in numpy.linalg.lstsq.

josef.pktd@gmai... josef.pktd@gmai...
Mon Aug 17 12:55:08 CDT 2009


On Mon, Aug 17, 2009 at 1:42 PM, Jonathan
Taylor<jonathan.taylor@utoronto.ca> wrote:
> Hi,
>
> I am getting a strange crash in numpy.linalg.lstsq.  I have put the code
> that causes the crash along with two data files on my website at:
>
> http://www.cs.toronto.edu/~jtaylor/crash/
>
> I would be interested to know if this bug can be duplicated and/or if anyone
> has any suggestions as to why:
>
> import numpy as np
> A = np.load('A.npy')
> b = np.load('b.npy')
> rc = np.linalg.lstsq(A,b)
>
> produces:
>
> *** glibc detected *** /usr/bin/python: free(): invalid next size (normal):
> 0x091793c0 ***
> ======= Backtrace: =========
> /lib/tls/i686/cmov/libc.so.6[0xb7dc7a85]
> /lib/tls/i686/cmov/libc.so.6(cfree+0x90)[0xb7dcb4f0]
> /u/jtaylor/lib/python2.5/site-packages/numpy/core/multiarray.so[0xb795403e]
> /usr/bin/python[0x811247a]
> /usr/bin/python(PyEval_EvalCodeEx+0x323)[0x80cae33]
> /usr/bin/python(PyEval_EvalFrameEx+0x565e)[0x80c93fe]
> /usr/bin/python(PyEval_EvalCodeEx+0x6e7)[0x80cb1f7]
> /usr/bin/python(PyEval_EvalCode+0x57)[0x80cb347]
> /usr/bin/python(PyRun_FileExFlags+0xf8)[0x80ea818]
> /usr/bin/python[0x80c1f5a]
> /usr/bin/python(PyObject_Call+0x27)[0x805cb97]
> /usr/bin/python(PyEval_EvalFrameEx+0x4064)[0x80c7e04]
> /usr/bin/python(PyEval_EvalCodeEx+0x6e7)[0x80cb1f7]
> /usr/bin/python[0x8113696]
> /usr/bin/python(PyObject_Call+0x27)[0x805cb97]
> /usr/bin/python(PyEval_EvalFrameEx+0x4064)[0x80c7e04]
> /usr/bin/python(PyEval_EvalCodeEx+0x6e7)[0x80cb1f7]
> /usr/bin/python(PyEval_EvalFrameEx+0x565e)[0x80c93fe]
> /usr/bin/python(PyEval_EvalCodeEx+0x6e7)[0x80cb1f7]
> /usr/bin/python[0x8113696]
> /usr/bin/python(PyObject_Call+0x27)[0x805cb97]
> /usr/bin/python[0x8062bfb]
> /usr/bin/python(PyObject_Call+0x27)[0x805cb97]
> /usr/bin/python(PyEval_EvalFrameEx+0x3d07)[0x80c7aa7]
> /usr/bin/python(PyEval_EvalCodeEx+0x6e7)[0x80cb1f7]
> /usr/bin/python(PyEval_EvalFrameEx+0x565e)[0x80c93fe]
> /usr/bin/python(PyEval_EvalFrameEx+0x5945)[0x80c96e5]
> /usr/bin/python(PyEval_EvalCodeEx+0x6e7)[0x80cb1f7]
> /usr/bin/python(PyEval_EvalFrameEx+0x6d09)[0x80caaa9]
> /usr/bin/python(PyEval_EvalCodeEx+0x6e7)[0x80cb1f7]
> /usr/bin/python(PyEval_EvalFrameEx+0x565e)[0x80c93fe]
> /usr/bin/python(PyEval_EvalCodeEx+0x6e7)[0x80cb1f7]
> /usr/bin/python(PyEval_EvalFrameEx+0x565e)[0x80c93fe]
> /usr/bin/python(PyEval_EvalFrameEx+0x5945)[0x80c96e5]
> /usr/bin/python(PyEval_EvalCodeEx+0x6e7)[0x80cb1f7]
> /usr/bin/python(PyEval_EvalFrameEx+0x565e)[0x80c93fe]
> /usr/bin/python(PyEval_EvalCodeEx+0x6e7)[0x80cb1f7]
> /usr/bin/python(PyEval_EvalFrameEx+0x565e)[0x80c93fe]
> /usr/bin/python(PyEval_EvalCodeEx+0x6e7)[0x80cb1f7]
> /usr/bin/python(PyEval_EvalFrameEx+0x565e)[0x80c93fe]
> /usr/bin/python(PyEval_EvalCodeEx+0x6e7)[0x80cb1f7]
> /usr/bin/python(PyEval_EvalCode+0x57)[0x80cb347]
> /usr/bin/python(PyRun_FileExFlags+0xf8)[0x80ea818]
> /usr/bin/python(PyRun_SimpleFileExFlags+0x199)[0x80eaab9]
> /usr/bin/python(Py_Main+0xa35)[0x8059335]
> /usr/bin/python(main+0x22)[0x80587f2]
> /lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xe0)[0xb7d72450]
> /usr/bin/python[0x8058761]
> ======= Memory map: ========
> 08048000-08140000 r-xp 00000000 08:06 83501      /usr/bin/python2.5
> 08140000-08165000 rw-p 000f7000 08:06 83501      /usr/bin/python2.5
> 08165000-0919a000 rw-p 08165000 00:00 0          [heap]
> b5200000-b5221000 rw-p b5200000 00:00 0
> b5221000-b5300000 ---p b5221000 00:00 0
> b53fc000-b5499000 r-xp 00000000 00:1a 552170
> /h/44/jtaylor/lib/python2.5/site-packages/Cython/Compiler/Parsing.so
> b5499000-b54a2000 rw-p 0009d000 00:1a 552170
> /h/44/jtaylor/lib/python2.5/site-packages/Cython/Compiler/Parsing.so
> b54a2000-b5624000 rw-p b54a2000 00:00 0
> b5624000-b568f000 r-xp 00000000 00:1a 553542
> /h/44/jtaylor/build/matplotlib/lib/matplotlib/backends/_backend_agg.so
> b568f000-b5691000 rw-p 0006a000 00:1a 553542
> /h/44/jtaylor/build/matplotlib/lib/matplotlib/backends/_backend_agg.so
> b5691000-b56f6000 r-xp 00000000 08:06 90831
> /usr/lib/python2.5/lib-dynload/unicodedata.so
> b56f6000-b5705000 rw-p 00065000 08:06 90831
> /usr/lib/python2.5/lib-dynload/unicodedata.so
> b5705000-b5725000 r-xp 00000000 00:1a 553545
> /h/44/jtaylor/build/matplotlib/lib/matplotlib/backends/_tkagg.so
> b5725000-b5726000 rw-p 00020000 00:1a 553545
> /h/44/jtaylor/build/matplotlib/lib/matplotlib/backends/_tkagg.so
> b5726000-b5727000 ---p b5726000 00:00 0
> b5727000-b5f27000 rwxp b5727000 00:00 0
> b5f27000-b5f3e000 r-xp 00000000 08:06 85532      /usr/lib/libxcb.so.1.0.0
> b5f3e000-b5f3f000 rw-p 00016000 08:06 85532      /usr/lib/libxcb.so.1.0.0
> b5f3f000-b5f53000 r-xp 00000000 08:06 1187870
> /lib/tls/i686/cmov/libnsl-2.7.so
> b5f53000-b5f55000 rw-p 00013000 08:06 1187870
> /lib/tls/i686/cmov/libnsl-2.7.so
> b5f55000-b5f57000 rw-p b5f55000 00:00 0
> b5f57000-b603b000 r-xp 00000000 08:06 85536      /usr/lib/libX11.so.6.2.0
> b603b000-b603e000 rw-p 000e4000 08:06 85536      /usr/lib/libX11.so.6.2.0
> b603e000-b60e7000 r-xp 00000000 08:06 85098      /usr/lib/libtcl8.4.so.0
> b60e7000-b60f1000 rw-p 000a8000 08:06 85098      /usr/lib/libtcl8.4.so.0
> b60f1000-b60f2000 rw-p b60f1000 00:00 0
> b60f2000-b61c4000 r-xp 00000000 08:06 85102      /usr/lib/libtk8.4.so.0
> b61c4000-b61cf000 rw-p 000d2000 08:06 85102      /usr/lib/libtk8.4.so.0
> b61cf000-b61d0000 rw-p b61cf000 00:00 0
> b61d0000-b62a8000 r-xp 00000000 08:06 85103      /usr/lib/libBLT.2.4.so.8.4
> b62a8000-b62b9000 rw-p 000d8000 08:06 85103      /usr/lib/libBLT.2.4.so.8.4
> b62b9000-b62ba000 rw-p b62b9000 00:00 0
> b62ba000-b62dc000 r-xp 00000000 08:06 180469     /usr/lib/libpng12.so.0.15.0
> b62dc000-b62dd000 rw-p 00022000 08:06 180469     /usr/lib/libpng12.so.0.15.0
> b62f5000-b62f6000 rw-p b62f5000 00:00 0
> b62f6000-b631d000 r-xp 00000000 00:1a 553544
> /h/44/jtaylor/build/matplotlib/lib/matplotlib/_png.so
> b631d000-b631e000 rw-p 00027000 00:1a 553544
> /h/44/jtaylor/build/matplotlib/lib/matplotlib/_png.so
> b631e000-b6367000 r-xp 00000000 00:1a 553543
> /h/44/jtaylor/build/matplotlib/lib/matplotlib/_image.so
> b6367000-b6369000 rw-p 00049000 00:1a 553543
> /h/44/jtaylor/build/matplotlib/lib/matplotlib/_image.so
> b6369000-b63d3000 r-xp 00000000 08:06 83795
> /usr/lib/libfreetype.so.6.3.16
> b63d3000-b63d6000 rw-p 0006a000 08:06 83795
> /usr/lib/libfreetype.so.6.3.16
> b63d6000-b6424000 r-xp 00000000 00:1a 553535
> /h/44/jtaylor/build/matplotlib/lib/matplotlib/ft2font.so
> b6424000-b6427000 rw-p 0004e000 00:1a 553535
> /h/44/jtaylor/build/matplotlib/lib/matplotlib/ft2font.so
> b6427000-b650f000 r-xp 00000000 08:06 88506      /usr/lib/libstdc++.so.6.0.9
> b650f000-b6512000 r--p 000e8000 08:06 88506      /usr/lib/libstdc++.so.6.0.9
> b6512000-b6514000 rw-p 000eb000 08:06 88506      /usr/lib/libstdc++.so.6.0.9
> b6514000-b651a000 rw-p b6514000 00:00 0
> b651e000-b6528000 r-xp 00000000 08:06 313979
> /usr/lib/python2.5/lib-dynload/_tkinter.so
> b6528000-b6529000 rw-p 0000a000 08:06 313979
> /usr/lib/python2.5/lib-dynload/_tkinter.so
> b6529000-b652d000 r-xp 00000000 08:06 90832
> /usr/lib/python2.5/lib-dynload/zlib.so
> b652d000-b652e000 rw-p 00004000 08:06 90832
> /usr/lib/python2.5/lib-dynload/zlib.so
> b652e000-b6532000 r-xp 00000000 00:1a 553538
> /h/44/jtaylor/build/matplotlib/lib/matplotlib/_cntr.so
> b6532000-b6533000 rw-p 00004000 00:1a 553538
> /h/44/jtaylor/build/matplotlib/lib/matplotlib/_cntr.so
> b6533000-b6577000 r-xp 00000000 00:1a 553541
> /h/44/jtaylor/build/matplotlib/lib/matplotlib/_path.so
> b6577000-b6578000 rw-p 00044000 00:1a 553541
> /h/44/jtaylor/build/matplotlib/lib/matplotlib/_path.so
> b6578000-b6587000 r-xp 00000000 08:06 92419
> /usr/lib/python2.5/lib-dynload/datetime.so
> b6587000-b658a000 rw-p 0000e000 08:06 92419
> /usr/lib/python2.5/lib-dynload/datetime.so
> b658a000-b65b9000 r-xp 00000000 00:1a 532925
> /h/44/jtaylor/lib/python2.5/site-packages/numpy/random/mtrand.so
> b65b9000-b65cb000 rw-p 0002e000 00:1a 532925
> /h/44/jtaylor/lib/python2.5/site-packages/numpy/random/mtrand.so
> b65cb000-b6923000 r-xp 00000000 08:06 517267
> /usr/lib/atlas/libblas.so.3.0
> b6923000-b6927000 rw-p 00358000 08:06 517267
> /usr/lib/atlas/libblas.so.3.0
> b6927000-b6e6f000 r-xp 00000000 08:06 517268
> /usr/lib/atlas/liblapack.so.3.0
> b6e6f000-b6e72000 rw-p 00548000 08:06 517268
> /usr/lib/atlas/liblapack.so.3.0
> b6e72000-b6f76000 rw-p b6e72000 00:00 0
> b6f76000-b6f7a000 r-xp 00000000 08:06 85530      /usr/lib/libXdmcp.so.6.0.0
> b6f7a000-b6f7b000 rw-p 00003000 08:06 85530      /usr/lib/libXdmcp.so.6.0.0
> b6f7b000-b6f7f000 r-xp 00000000 08:06 92437
> /usr/lib/python2.5/lib-dynload/_csv.so
> b6f7f000-b6f81000 rw-p 00004000 08:06 92437
> /usr/lib/python2.5/lib-dynload/_csv.so
> b6f81000-b6f84000 r-xp 00000000 08:06 92427
> /usr/lib/python2.5/lib-dynload/_locale.so
> b6f84000-b6f85000 rw-p 00003000 08:06 92427
> /usr/lib/python2.5/lib-dynload/_locale.so
> b6f85000-b6f8e000 r-xp 00000000 00:1a 533113
> /h/44/jtaylor/lib/python2.5/site-packages/numpy/fft/fftpack_lite.so
> b6f8e000-b6f8f000 rw-p 00008000 00:1a 533113
> /h/44/jtaylor/lib/python2.5/site-packages/numpy/fft/fftpack_lite.so
> b6f8f000-b6fad000 r-xp 00000000 00:1a 533028
> /h/44/jtaylor/lib/python2.5/site-packages/numpy/core/scalarmath.so
> b6fad000-b6fae000 rw-p 0001e000 00:1a 533028
> /h/44/jtaylor/lib/python2.Aborted
>
>
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>
>

no problem here, with official Windows numpy

Josef

>>> np.version.version
'1.3.0'

>python -i why_crash.py
>>> print rc
(array([ -5.23462841,  -4.85584394,  -2.99233015,  -7.54676368,
       -10.15455332,   7.074554  ,   8.4043877 ,   2.79661679,
         3.41336578,   5.29202285,   2.70716181,  15.53449435,
         9.34557621,  17.32209602,  18.16994838, -50.98017437,
       -50.96547959, -17.51283078,   7.68637678,  13.53704022,
        20.66278929, -23.64368007,  -4.70942583,  18.2568222 ,
         2.45709374,  12.97156815,  15.47026211, -44.93348725,
         7.7558192 , -39.13996758,   1.20214959,  23.61872159,
       -20.21198664,  -7.87137325,  -4.20255668, -45.24948722,
        12.49507108,  24.22157348,  23.46404032,  18.62294373,
       -26.31401828,  24.35842929, -37.5578372 ,  18.24079679,
        28.90693972, -40.40246853,  23.85976491,  11.70965078,
        17.38628028,   6.14989021,   0.19683346,  11.57781284,
        -6.70961655, -21.98525308, -11.30257635,  31.16804751,
         5.08794164,   0.26279222, -27.78390652, -26.3151511 ,
        14.89172102,  29.02572416, -10.84227516,   3.20577699,
       -34.73738042,  24.90588989,  37.92166034, -30.30146211,
        37.28852751, -16.03146259, -30.87415056, -33.02832669,
       -21.63514384,  11.15711455,  10.43855884,  -7.08345237,
        31.50460928, -28.64336727, -12.32269443, -24.59112645,
        41.71351395, -29.85091349,  -4.07409268,   0.82708638,
        14.67839587,  41.58165228, -29.44030397,  31.13279856,
       -28.46626932,  31.21863319, -30.50159697,  -6.26718832,
       -26.41654876,  -2.42547434,  44.00738912, -10.94028372,
        -0.65862359, -25.08227995, -26.04263867,  13.25529043,
        -7.41115206,  36.11891076,  47.22737694,  23.39250661,
       -16.59126536,  37.75596345,  12.59698144,   9.15952276,
       -22.0567611 , -27.79573887, -30.57535286,  28.71831817,
       -21.38243352,  19.30944773,  49.81583705, -19.59172648]), array([ 1063.81
458595]), 116, array([ 10.77032961,   3.02162267,   3.02054405,   3.0010756 ,
         2.96191492,   2.94807426,   2.94230063,   2.93906657,
         2.92832506,   2.91399677,   2.88159001,   2.86294336,
         2.85790349,   2.84497487,   2.82744239,   2.81275744,
         2.78836986,   2.77119523,   2.76422221,   2.75861982,
         2.75015801,   2.72908307,   2.68445243,   2.67800314,
         2.666536  ,   2.65671856,   2.64826304,   2.63879427,
         2.6296631 ,   2.60120053,   2.59118748,   2.58256916,
         2.57264941,   2.56585886,   2.53898947,   2.53365513,
         2.52103196,   2.49959127,   2.47968021,   2.46456052,
         2.46068247,   2.44924031,   2.43199483,   2.41963211,
         2.41515001,   2.40937849,   2.39016287,   2.3762653 ,
         2.35560428,   2.34357138,   2.3260469 ,   2.30884773,
         2.29027418,   2.27944481,   2.27465575,   2.25660949,
         2.21410648,   2.20263598,   2.1791073 ,   2.15789688,
         2.14225592,   2.13043072,   2.09846149,   2.07491627,
         2.06112946,   2.04336228,   2.02056257,   1.99107297,
         1.98856298,   1.97039638,   1.9575191 ,   1.93587212,
         1.91997992,   1.85665009,   1.84338407,   1.79610228,
         1.79328928,   1.78429932,   1.74123465,   1.7241243 ,
         1.7010803 ,   1.64746663,   1.62765943,   1.62303706,
         1.61800823,   1.60531761,   1.52425119,   1.50620662,
         1.485018  ,   1.45765932,   1.40861388,   1.39268607,
         1.3483904 ,   1.32025766,   1.31350522,   1.28517948,
         1.25950863,   1.23770526,   1.18665953,   1.15504454,
         1.14088912,   1.11336858,   1.01682096,   0.9791356 ,
         0.93161774,   0.90834728,   0.8611552 ,   0.82261935,
         0.79141265,   0.64055544,   0.60890393,   0.58578707,
         0.4948037 ,   0.38776132,   0.35580931,   0.20854201]))
>>>


More information about the NumPy-Discussion mailing list