[Numpy-discussion] possibly ctypes related segfault

Martin Wiechert martin.wiechert at gmx.de
Tue Aug 28 08:03:52 EDT 2007


Wow, thanks a lot for putting so much efffort!

Here's the test script. I'm using it via execfile from an interactive session, 
so I can inspect (and crash with readline) afterwards.

Here's how I compiled:
gcc 
solver.c -fPIC -ggdb -shared -llapack -lf77blas -lcblas -latlas -lgfortran -o 
librectify.so

Thanks, Martin


On Tuesday 28 August 2007 13:11, Stefan van der Walt wrote:
> Hi Martin
>
> On Mon, Aug 27, 2007 at 02:57:28PM +0200, Martin Wiechert wrote:
> > I'm suffering from a strange segfault and would appreciate your help.
> >
> > I'm calling a small C function using ctypes / numpy.ctypeslib. The
> > function works in the sense that it returns correct results. After
> > calling the function however I can reliably evoke a segfault by using
> > readline tab completion.
> >
> > I'm not very experienced, but this smells like a memory management bug to
> > me, which is strange, because I'm not doing any mallocing/freeing at all
> > in the C code.
> >
> > I could not reproduce the bug in a debug build of python
> > (--without-pymalloc) or on another machine. The crashing machine is an
> > eight-way opteron.
>
> I had to #include <unistd.h> in solver, and modify cMonteCarlo not to
> depend on GV.  Then, I used
>
> gcc -o solver.os -c -O2 -ggdb -Wall -ansi -pedantic -fPIC solver.c
> gcc -o librectify.so -shared solver.os -llapack
>
> to compile.
>
> Please send me the script that excercises the solver, then I will test
> on my machines here.
>
> > --16266-- DWARF2 CFI reader: unhandled CFI instruction 0:10
> > --16266-- DWARF2 CFI reader: unhandled CFI instruction 0:10
>
> This could be a valgrind issue.
>
> Cheers
> Stéfan
> _______________________________________________
> Numpy-discussion mailing list
> Numpy-discussion at scipy.org
> http://projects.scipy.org/mailman/listinfo/numpy-discussion
-------------- next part --------------
A non-text attachment was scrubbed...
Name: recttest.py
Type: application/x-python
Size: 389 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20070828/fda4a9f3/attachment.bin>


More information about the NumPy-Discussion mailing list