[SciPy-dev] Segmentation fault triggered by optimize/lbfgsb.py

Ed Schofield schofield at ftw.at
Tue Oct 25 12:31:33 CDT 2005


The code in optimize/lbfgsb.py raises an exception and then dumps core:

Traceback (most recent call last):
  ...
  File
"/home/schofield/Test/lib/python2.4/site-packages/scipy/optimize/lbfgsb.py",
line 182, in fmin_l_bfgs_b
    isave, dsave)
ValueError: string_from_pyobj failed in converting 14th argument `csave'
of _lbfgsb.setulb to C string
Segmentation fault (core dumped)


What is interesting is that I can get a segfault with the same backtrace
even *before* the call to the Fortran function, just by executing some
of the statements up to line 182 and exiting the python interpreter with
^D, implying that the interpreter is no longer in a stable state.


# scipy.base.__version__    gives '0.4.3.1343'

>>> import scipy

>>> task = scipy.zeros((60,), scipy.Character)
>>> task[:] = 'blah'
>>> ^D
Segmentation fault

Here's a backtrace from gdb:
#0  0x080de87d in Py_GetPath ()
#1  0x08087860 in PyTuple_Pack ()
#2  0x080df0c0 in _PyObject_GC_Track ()
#3  0x080df897 in PyGC_Collect ()
#4  0x080d88f9 in Py_Finalize ()
#5  0x080556f0 in Py_Main ()
#6  0x4938dea2 in __libc_start_main () from /lib/tls/i686/cmov/libc.so.6
#7  0x08054f21 in _start ()

Anyone want to take the baton? ;)

-- Ed




More information about the Scipy-dev mailing list