C Extension Seg Faults

Daryl rts.cts at gmail.com
Tue Jul 10 20:24:12 CEST 2007

> It's not worth staring at code to try to figure out things like that.
> Run it under gdb, examine the relevant data objects when it crashes
> and see what's broken (e.g. some pointer is unexpectedly null), then
> set a conditional breakpoint that stops execution when that incorrect
> condition happens (e.g. the pointer gets set to null), run the program
> til the breakpoint triggers, see what other condition X caused the
> condition that caused the crash, set another breakpoint that triggers
> when X occurs, etc.  Work backwards systematically til you find the bug.

Yeah, not 30 seconds after I posted it I found the problem.  Under
some (funny) conditions the extension would be called with a list
instead of a tuple.  My debug case (of course) worked fine but the
full test would fail.

Sorry for the noise,

More information about the Python-list mailing list