[Scipy-tickets] [SciPy] #1333: fmin_slsqp segfault

SciPy Trac scipy-tickets@scipy....
Wed Nov 24 00:38:30 CST 2010


#1333: fmin_slsqp segfault
--------------------+-------------------------------------------------------
 Reporter:  mauger  |       Owner:  somebody
     Type:  defect  |      Status:  new     
 Priority:  normal  |   Milestone:  0.9.0   
Component:  Other   |     Version:  0.7.0   
 Keywords:          |  
--------------------+-------------------------------------------------------
 fmin_slsqp occasionally segfaults when I use it as a bounded value least
 squares solver. The problem appears to be associated with memory
 allocation; when I modify line 248 of slsqp.py (svn) to read
     mineq = m - meq + n1 + n1 + len(bounds) # Add len(bounds)
 the segfault is not reproduced, although I'm not sure if this is a robust
 fix. I'm using scipy version 0.7.0 on Fedora 12 (x86_64).

 Below is some sample code that will reproduce the segfault, and I'll
 attach the required datafile and the gdb backtrace.

 {{{
 import numpy
 from scipy.optimize import fmin_slsqp

 def objf(x,lhs,rhs):
     return ((numpy.dot(lhs,x)-rhs)**2).sum()
 def objdf(x,lhs,rhs):
     return numpy.dot(lhs.T,numpy.dot(lhs,x)-rhs)

 bounds = [[1e-11,1e11],[1e-11,1e11],[1e-11,1e11]]
 a,b = numpy.load('slsqp_bug.data')
 result =
 fmin_slsqp(objf,[1.,1.,1.],bounds=bounds,full_output=1,fprime=objdf,acc=1e-9,iter=800,args=[a,b],iprint=0)
 print result
 }}}

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


More information about the Scipy-tickets mailing list