glibc detected *** python: corrupted double-linked list

David Cournapeau cournape at gmail.com
Wed Feb 25 08:06:37 EST 2009


On Wed, Feb 25, 2009 at 9:40 PM, Christian Meesters <meesters at gmx.de> wrote:
> Hoi,
>
> I have a problem using my software on my 64bit laptop, after an update of
> my system. The same code still runs on 32bit Intel, but on my laptop I
> provoke the crash in the title. The crash is caused - as narrowed down by
> me - by returning a static PyObject from a C-extension function.

Those errors are caused by writing in an invalid pointer, but not far
enough to cause a direct segfault - just enough to corrupt core data
structures of the runtime :)

>
> Well, now I wondering what to do? A web search delivered no relevant bug
> reports about glibc on my system (the recent Ubuntu 8.10). Is there a
> source for validated glibc for x86_64? Oh, and I'm using Ubuntu's ready-
> made Python package, version 2.5.2..

It is very unlikely the problem is in glibc - I would check your code
carefully first :) On Linux, the following are useful:
 - first, try to compile with as many warning flags as possible (-W
-Wall -Wextra is a pretty good baseline)
 - then, if you have a small reproducible crash, run the extension
under valgrind after having built the extension with -g. This will
give you more informations.
 - if the above does not help, using gdb can help too.

If the program works in 32 but not in 64, there are several things to
look at (long is 8 bytes, not 4 on Linux, so some long -> int
convertion may be broken). Sometimes, the program just happens to work
on 32 bits, but by accident (running valgrind on both 32 and 64 bits
may be helpful too).

cheers,

David



More information about the Python-list mailing list