Core dump revisited

pythoncurious at gmail.com pythoncurious at gmail.com
Tue Dec 19 10:22:57 EST 2006


Sheldon wrote:
<snip>
>
> Program received signal SIGSEGV, Segmentation fault.
> [Switching to Thread 1077321856 (LWP 32710)]
> 0x40297b83 in mallopt () from /lib/tls/libc.so.6
> (gdb) bt
> #0  0x40297b83 in mallopt () from /lib/tls/libc.so.6
> #1  0x402958ba in free () from /lib/tls/libc.so.6
> #2  0x405e070a in MemoryFreeOrd () at msgppsmodule_area.c:1675
> #3  0x405dae0a in msgppsarea (self=0x0, args=0x4042aa7c, kwargs=0x0) at
> msgppsmodule_area.c:328
> #4  0x40073b16 in PyCFunction_Call () from /usr/lib/libpython2.3.so.1.0
>

>From my experience, segmentation faults in malloc/free is usually the
result of memory corruption.
My experience comes mostly from solaris and I realize the memory
allocator might work differently in Linux, but that would be my guess.

The cause for memory corruption can be writing outside arrays, using
deallocated memory or something like that.

Under Linux, there are tools like valgrind (free), electric fence
(free), purify (not for free last time I checked) and probably a few
more, that may help you track down memory corruption bugs. They are
often hard to find using just a debugger. 

HTH




More information about the Python-list mailing list