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

Frithiof Andreas Jensen frithiof.jensen at
Tue Sep 20 14:21:29 CEST 2005

"Christian Stapfer" <nil at dev.nul> wrote in message
news:dfr3sr$7rj$1 at

> Check your program for _uninitialized_variables_.

good point.

> (Just a guess: but what other side-effect than
> changing the values of uninitialized variables
> - and the program's timing, of course - might
> the stepping through with a debugger have?)

that, f.ex. with some debuggers, all application memory is conveniently
zeroed so you might survive popping NOP's off the stack until you eventually
hit a valid return ...

I once traced through an embedded assembly program - that had been working
for years - with a logic analyser to re-create the source from the old flow
charts and the hundreds of patches that had been applied to the thing during
"comissioning", i.e. On Site Development.

I found that the "correct" program would somtimes get hit by an unitialised
interupt, the CPU would land between two instructions and start executing
garbage until it chrashed over something else and magically re-synchronised.
Fine stuff.

The reassembled program executed 40% faster without all the jump-to-patch
stuff so I had to re-adjust all the timers too.

More information about the Python-list mailing list