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

Frithiof Andreas Jensen frithiof.jensen at die_spammer_die.ericsson.com
Tue Sep 20 08:09:18 EDT 2005


"Lil" <lily.poon at gmail.com> wrote in message
news:1126203439.152057.78210 at o13g2000cwo.googlegroups.com...
> I already double checked my C code. It runs perfectly fine in C without
> any errors.

Errr - It runs perfectly fine without *announcing* any errors (while
gleefully urinating all over its memory space).

The programming model for "C" is "*you* asked for it, you got it mate!" - so
you have to "tell" the program how to debug memory by rebuilding it with
f.ex. Electric Fence, or whatever memory debug lib is preferred for your
box, and running that again.

The tools will spot mistakes faster and more reliable than the developer who
wrote the code. Use them.

> So in my python program, I added a pdb.set_trace()
> and step through the program and it did not dump. But when i took out
> the tracing, the core dump came back. "sigh"

So??

You re-jiggled the bits, so something important got thrashed this time.

Run the C program trough with gdb and see what it does. It thrashes
something.





More information about the Python-list mailing list