[SciPy-dev] missing Lib/__init__.py in newscipy?

Arnd Baecker arnd.baecker at web.de
Wed Oct 19 14:17:03 CDT 2005


Hi Travis,

On Wed, 19 Oct 2005, Travis Oliphant wrote:

> Arnd Baecker wrote:

> >In [2]: fblas.sger(1,[1,2],[3,4])
> >Segmentation fault
> >
> The first thing to do is to look for warnings in the compilation of
> fblasmodule.c that might  lead to int->intp problems.
>
> I did not see anything significant in the build log you last sent, but I
> might have missed something.
>
> The next thing to do is to track down where the segfault is happening.
> You could try running gdb
>
> gdb
> file <path>/<to>/<your>/<python>
> run
> from scipy.linalg import fblas
> fblas.sger(1,[1,2],[3,4])
>
> gdb will catch the segfault and show you where it died.
>
> As a last resort, I insert print statements to guide me where the code
> is dying and carefully inspect that section of code.
>
> -Travis

Alright, there are warnings:

Build
=====

gcc: build/src/fortranobject.c
gcc: build/src/build/src/scipy/linalg/fblasmodule.c
build/src/build/src/scipy/linalg/fblasmodule.c: In function
`f2py_rout_fblas_sger':
build/src/build/src/scipy/linalg/fblasmodule.c:8045: warning: passing arg
1 of `initforcomb' from incompatible pointer type
build/src/build/src/scipy/linalg/fblasmodule.c: In function
`f2py_rout_fblas_dger':
build/src/build/src/scipy/linalg/fblasmodule.c:8237: warning: passing arg
1 of `initforcomb' from incompatible pointer type
build/src/build/src/scipy/linalg/fblasmodule.c: In function
`f2py_rout_fblas_cgeru':
build/src/build/src/scipy/linalg/fblasmodule.c:8429: warning: passing arg
1 of `initforcomb' from incompatible pointer type
build/src/build/src/scipy/linalg/fblasmodule.c: In function
`f2py_rout_fblas_zgeru':
build/src/build/src/scipy/linalg/fblasmodule.c:8621: warning: passing arg
1 of `initforcomb' from incompatible pointer type
build/src/build/src/scipy/linalg/fblasmodule.c: In function
`f2py_rout_fblas_cgerc':
build/src/build/src/scipy/linalg/fblasmodule.c:8813: warning: passing arg
1 of `initforcomb' from incompatible pointer type
build/src/build/src/scipy/linalg/fblasmodule.c: In function
`f2py_rout_fblas_zgerc':
build/src/build/src/scipy/linalg/fblasmodule.c:9005: warning: passing arg
1 of `initforcomb' from incompatible pointer type
compiling Fortran sources
g77(f77) options: '-Wall -fno-second-underscore -fPIC -O3 -funroll-loops
-march=opteron -mmmx -msse2 -msse -m3dnow'
creating build/temp.linux-x86_64-2.4/Lib/linalg

Test
====

scipy.test(10,10)

check_ger (scipy.linalg.blas.test_blas.test_fblas2_simple)
Segmentation fault


gdb
file /scr/python/bin/python
run
from scipy.linalg import fblas
fblas.sger(1,[1,2],[3,4])

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 46912507335168 (LWP 1278)]
0x00002aaab298ce1b in f2py_rout_fblas_sger (capi_self=0x8a9ae0,
    capi_args=0x8a9ae0, capi_keywds=0x0, f2py_func=0x2aaab2997e10 <sger_>)
    at fblasmodule.c:8047
8047            a[capi_i++] = 0; /* fortran way */

(gdb) bt
#0  0x00002aaab298ce1b in f2py_rout_fblas_sger (capi_self=0x8a9ae0,
    capi_args=0x8a9ae0, capi_keywds=0x0, f2py_func=0x2aaab2997e10 <sger_>)
    at fblasmodule.c:8047
#1  0x0000000000417700 in PyObject_Call (func=0x8a9ae0, arg=0x0, kw=0x1)
    at abstract.c:1756
#2  0x00000000004777d9 in PyEval_EvalFrame (f=0x685990) at ceval.c:3766
#3  0x000000000047ad2f in PyEval_EvalCodeEx (co=0x2aaaaab20030,
globals=0x0,
    locals=0x1, args=0x685990, argcount=0, kws=0x0, kwcount=0, defs=0x0,
    defcount=0, closure=0x0) at ceval.c:2736
#4  0x000000000047af72 in PyEval_EvalCode (co=0x8a9ae0, globals=0x0,
    locals=0x1) at ceval.c:484
#5  0x00000000004a1c72 in PyRun_InteractiveOneFlags (fp=0x2aaaaab136b0,
    filename=0x4cbf24 "<stdin>", flags=0x7fffffa574dc) at pythonrun.c:1265
#6  0x00000000004a1e04 in PyRun_InteractiveLoopFlags (fp=0x2aaaab556b00,
    filename=0x4cbf24 "<stdin>", flags=0x7fffffa574dc) at pythonrun.c:695
#7  0x00000000004a2350 in PyRun_AnyFileExFlags (fp=0x2aaaab556b00,
    filename=0x0, closeit=0, flags=0x7fffffa574dc) at pythonrun.c:658
#8  0x0000000000410788 in Py_Main (argc=0, argv=0x7fffffa58a6c) at
main.c:484
#9  0x00002aaaab34d5aa in __libc_start_main () from /lib64/tls/libc.so.6
#10 0x000000000040fdfa in _start () at start.S:113
#11 0x00007fffffa575d8 in ?? ()
#12 0x00002aaaaabc19c0 in rtld_errno () from /lib64/ld-linux-x86-64.so.2
#13 0x0000000000000001 in ?? ()


fblasmodule.c is generated via f2py, so applying changes to
that file is presumably not the way to go, right?
Oh - looking at the header:

 /* Do not edit this file directly unless you know what you are doing!!!
 */

This definitively means that *I* should not edit that file ;-)

Of course I could try do the changes, but maybe you see
the problem straight away
(if not I will give it a try ...)

Best, Arnd




More information about the Scipy-dev mailing list