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

Fredrik Lundh fredrik at pythonware.com
Thu Sep 8 13:43:53 EDT 2005


"Lil" <lily.poon at gmail.com> 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
else.

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

</F> 






More information about the Python-list mailing list