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

Lil lily.poon at
Thu Sep 8 18:51:30 CEST 2005

Hi Everyone! I've been trying to figure out this weird bug in my
program. I have a python program that calls a C function that reads in
a binary file into a buffer. In the C program, buffer is allocated by
calling malloc. The C program runs perfectly fine but when I use python
to call the C function, it core dumps at malloc.
I've tried multiple binary files with different sizes and the result

if file size is < 20 bytes , works fine
if file size is > 20 bytes, it hangs or core dumps.

Please help!! 

More information about the Python-list mailing list