[SciPy-dev] Segfault problems on Mandrake 8.2 -- Python2.2

Travis Oliphant oliphant.travis at ieee.org
Mon Apr 8 17:30:26 CDT 2002


On Mon, 2002-04-08 at 15:56, pearu at scipy.org wrote:
> 
> 
> On 8 Apr 2002, Travis Oliphant wrote:
> 
> > I've had a broken SciPy installation for the past couple of days due to
> > a pretty obnoxious bug.  I'm not sure which package is to blame (could
> > be the Mandrake 8.2 toolchain???
> > 
> > But, I've finally isolated the problem to an -fPIC flag given when
> > compiling _minpackmodule.c
> 
> Is minpack the only module with this problem? If you disable it, will
> scipy load without segfault? Can you send the output when minpack
> extension is build?

Yes, when I disabled minpack it loaded.  I could repeatedly compile
manually the minpack module with and without -fPIC and get segfaults on
import with -fPIC and normal operation without it.

> 
> > If I don't add this flag and compile the module manually then I get a
> > module that loads and seems to work fine.  The default SciPy install
> > adds this flag and results in a module that segfaults when Python tries
> > to open it.
> 
> This flag is added by Python distutils.

I went to the config directory and modifed the Makefile to remove the
-fPIC flag from CCSHARED.  Now, I can just build using the setup script
and not get the normal segfault.

However, I'm still getting a segfault on a level 10 test (during weave?)

Here is the output I'm getting.

test printing a value:2
../home/travis/.python22_compiled/sc_9a25bc84add18fe6c75501f6b01bd84e1.cpp: In function `PyObject
*compiled_func (PyObject *, PyObject *)':
/home/travis/.python22_compiled/sc_9a25bc84add18fe6c75501f6b01bd84e1.cpp:418: no match for `Py::String
& < int'
/usr/lib/python2.2/site-packages/scipy/weave/CXX/Objects.hxx:390:
candidates are: bool
Py::Object::operator< (const Py::Object &) const
/usr/lib/python2.2/site-packages/scipy/weave/CXX/Objects.hxx:1433:                 bool Py::operator<
(const Py::SeqBase<Py::Object>::const_iterator &, const
Py::SeqBase<Py::Object>::const_iterator &)
/usr/lib/python2.2/site-packages/scipy/weave/CXX/Objects.hxx:1426:                 bool Py::operator<
(const Py::SeqBase<Py::Object>::iterator &, const
Py::SeqBase<Py::Object>::iterator &)
............................................Segmentation fault

> 
> This flag -fPIC is generally needed for shared objects. In principle, it
> is possible to change this flag using similar hack as weave uses for 
> changing gcc  to g++ in LDSHARED (see weave build_tools.py). -fPIC is
> defined by CCSHARED variable, I believe.

I know I've compiled extensions successfully without -fPIC using gcc.  I
just did and I've done it previously. 

> 
> Now I see that scipy_distutils uses -fpic instead of -fPIC when compiling
> Fortran sources. I am not sure if it matters but you can try changing
> -fpic to -fPIC in scipy_distutils/command/build_flib.py (look for gnu
> compiler switches).

I'm going to change this to see if it has any effect on the remaining
segfault, but I don't suspect it will. 

Thanks for your help.  I'm thinking of just switching to a different
distribution....

-Travis





More information about the Scipy-dev mailing list