[Scipy-tickets] [SciPy] #783: bisplrep segfault with kx=3, ky=3, s=0

SciPy Trac scipy-tickets@scipy....
Sat Jul 17 03:56:58 CDT 2010


#783: bisplrep segfault with kx=3, ky=3, s=0
-------------------------------+--------------------------------------------
 Reporter:  mauger             |       Owner:  somebody   
     Type:  defect             |      Status:  new        
 Priority:  normal             |   Milestone:  Unscheduled
Component:  scipy.interpolate  |     Version:             
 Keywords:                     |  
-------------------------------+--------------------------------------------
Changes (by rgommers):

  * milestone:  0.8.0 => Unscheduled


Old description:

> interpolate.bisplrep is causing a segfault when kx=3, ky=3, s=0 for
> reasonably smooth data. I've attached a data file, and I've pasted a test
> case and the backtrace from gdb.
>

> {{{
> import scipy,numpy
> from scipy import io,interpolate
>
> f = open('tmp.dat')
> data = io.read_array(f)
> f.close()
>
> print "scipy version:",scipy.__version__
> print "numpy version:",numpy.__version__
>
> print "Test 1 - smoothing spline"
> model = interpolate.bisplrep(data[:,0],data[:,1],data[:,2],kx=3,ky=3)
> print "Test 2 - kx=3, ky=1 interpolating spline"
> model = interpolate.bisplrep(data[:,0],data[:,1],data[:,2],kx=3,ky=1,s=0)
> print "Test 3 - kx=3, ky=3 interpolating spline"
> model = interpolate.bisplrep(data[:,0],data[:,1],data[:,2],kx=3,ky=3,s=0)
> }}}
>
> PROGRAM OUTPUT (w/ gdb backtrace)
> {{{
> scipy version: 0.6.0
> numpy version: 1.2.0
> Test 1 - smoothing spline
> Test 2 - kx=3, ky=1 interpolating spline
> Test 3 - kx=3, ky=3 interpolating spline
>
> Program received signal SIGSEGV, Segmentation fault.
> 0x00007f0116aee5a2 in fprank_ ()
>    from /usr/lib64/python2.5/site-packages/scipy/interpolate/_fitpack.so
> (gdb) bt
> #0  0x00007f0116aee5a2 in fprank_ ()
>    from /usr/lib64/python2.5/site-packages/scipy/interpolate/_fitpack.so
> #1  0x00007f0116ad2c5d in fpsurf_ ()
>    from /usr/lib64/python2.5/site-packages/scipy/interpolate/_fitpack.so
> #2  0x00007f0116acafc7 in surfit_ ()
>    from /usr/lib64/python2.5/site-packages/scipy/interpolate/_fitpack.so
> #3  0x00007f0116ac7900 in splev_ ()
>    from /usr/lib64/python2.5/site-packages/scipy/interpolate/_fitpack.so
> #4  0x00000033338bde7d in PyEval_EvalFrameEx ()
>    from /usr/lib64/libpython2.5.so.1.0
> #5  0x00000033338bfa7d in PyEval_EvalCodeEx ()
>    from /usr/lib64/libpython2.5.so.1.0
> #6  0x00000033338be45c in PyEval_EvalFrameEx ()
>    from /usr/lib64/libpython2.5.so.1.0
> #7  0x00000033338bfa7d in PyEval_EvalCodeEx ()
>    from /usr/lib64/libpython2.5.so.1.0
> #8  0x00000033338bfcc2 in PyEval_EvalCode ()
>    from /usr/lib64/libpython2.5.so.1.0
> #9  0x00000033338db861 in ?? () from /usr/lib64/libpython2.5.so.1.0
> #10 0x00000033338db936 in PyRun_FileExFlags ()
>    from /usr/lib64/libpython2.5.so.1.0
> #11 0x00000033338dcf1d in PyRun_SimpleFileExFlags ()
>    from /usr/lib64/libpython2.5.so.1.0
> #12 0x00000033338e6bf1 in Py_Main () from /usr/lib64/libpython2.5.so.1.0
> #13 0x0000003319c1e32a in __libc_start_main () from /lib64/libc.so.6
> #14 0x0000000000400649 in _start ()
> }}}

New description:

 interpolate.bisplrep is causing a segfault when kx=3, ky=3, s=0 for
 reasonably smooth data. I've attached a data file, and I've pasted a test
 case and the backtrace from gdb.


 {{{
 import scipy,numpy
 from scipy import io, interpolate

 data = np.loadtxt('tmp.dat')

 print "scipy version:",scipy.__version__
 print "numpy version:",numpy.__version__

 print "Test 1 - smoothing spline"
 model = interpolate.bisplrep(data[:,0],data[:,1],data[:,2],kx=3,ky=3)
 print "Test 2 - kx=3, ky=1 interpolating spline"
 model = interpolate.bisplrep(data[:,0],data[:,1],data[:,2],kx=3,ky=1,s=0)
 print "Test 3 - kx=3, ky=3 interpolating spline"
 model = interpolate.bisplrep(data[:,0],data[:,1],data[:,2],kx=3,ky=3,s=0)
 }}}

 PROGRAM OUTPUT (w/ gdb backtrace)
 {{{
 scipy version: 0.6.0
 numpy version: 1.2.0
 Test 1 - smoothing spline
 Test 2 - kx=3, ky=1 interpolating spline
 Test 3 - kx=3, ky=3 interpolating spline

 Program received signal SIGSEGV, Segmentation fault.
 0x00007f0116aee5a2 in fprank_ ()
    from /usr/lib64/python2.5/site-packages/scipy/interpolate/_fitpack.so
 (gdb) bt
 #0  0x00007f0116aee5a2 in fprank_ ()
    from /usr/lib64/python2.5/site-packages/scipy/interpolate/_fitpack.so
 #1  0x00007f0116ad2c5d in fpsurf_ ()
    from /usr/lib64/python2.5/site-packages/scipy/interpolate/_fitpack.so
 #2  0x00007f0116acafc7 in surfit_ ()
    from /usr/lib64/python2.5/site-packages/scipy/interpolate/_fitpack.so
 #3  0x00007f0116ac7900 in splev_ ()
    from /usr/lib64/python2.5/site-packages/scipy/interpolate/_fitpack.so
 #4  0x00000033338bde7d in PyEval_EvalFrameEx ()
    from /usr/lib64/libpython2.5.so.1.0
 #5  0x00000033338bfa7d in PyEval_EvalCodeEx ()
    from /usr/lib64/libpython2.5.so.1.0
 #6  0x00000033338be45c in PyEval_EvalFrameEx ()
    from /usr/lib64/libpython2.5.so.1.0
 #7  0x00000033338bfa7d in PyEval_EvalCodeEx ()
    from /usr/lib64/libpython2.5.so.1.0
 #8  0x00000033338bfcc2 in PyEval_EvalCode ()
    from /usr/lib64/libpython2.5.so.1.0
 #9  0x00000033338db861 in ?? () from /usr/lib64/libpython2.5.so.1.0
 #10 0x00000033338db936 in PyRun_FileExFlags ()
    from /usr/lib64/libpython2.5.so.1.0
 #11 0x00000033338dcf1d in PyRun_SimpleFileExFlags ()
    from /usr/lib64/libpython2.5.so.1.0
 #12 0x00000033338e6bf1 in Py_Main () from /usr/lib64/libpython2.5.so.1.0
 #13 0x0000003319c1e32a in __libc_start_main () from /lib64/libc.so.6
 #14 0x0000000000400649 in _start ()
 }}}

--

Comment:

 I get the same as Pauli and Nils. The message disappears for s>=1e-12, so
 the warning message is correct. The docstring also indicates s has to be
 >0. So looks fine.

 <updated example, io.read_array doesn't exist anymore>

-- 
Ticket URL: <http://projects.scipy.org/scipy/ticket/783#comment:4>
SciPy <http://www.scipy.org>
SciPy is open-source software for mathematics, science, and engineering.


More information about the Scipy-tickets mailing list