Help! Python either hangs or core dumps when calling C malloc

Fredrik Lundh fredrik at
Thu Sep 8 19:43:53 CEST 2005

"Lil" <lily.poon at> wrote:

>      It's in the C code mainly because the buffer is an input to the
> driver. The driver takes a char* as input and I didn't want to pass a
> char* from python -> swig -> C since swig has memory leaks passing
> pointers.
> Do you think this is a Python issue or a Red Hat issue?

I think we would have noticed by now if Python or Red Hat weren't
able to allocate and read 20 bytes.  It's a bug in your program, and
you should concentrate on fixing it, not looking for bugs everywhere

(quick guess: did you perhaps type malloc(sizeof(bytes)) instead of
malloc(bytes), or something similar)


More information about the Python-list mailing list