[Numpy-discussion] possibly ctypes related segfault

Stefan van der Walt stefan at sun.ac.za
Tue Aug 28 07:11:38 EDT 2007

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.


More information about the NumPy-Discussion mailing list