[Python-Dev] segfault (double free?) when '''-string crosses line

Guido van Rossum guido at python.org
Mon Apr 10 03:34:05 CEST 2006

On Linux, In HEAD 2.5, but only with the non-debug version, I get a
segfault when I do this:

>>> '''
... '''

It seems to occur for any triple-quoted string crossing a line
boundary. A bit of the stack trace:

#0  0x40030087 in pthread_mutex_lock () from /lib/i686/libpthread.so.0
#1  0x4207ad18 in free () from /lib/i686/libc.so.6
#2  0x08057990 in tok_nextc (tok=0x81c71d8) at ../Parser/tokenizer.c:809
#3  0x0805872d in tok_get (tok=0x81c71d8, p_start=0xbffff338, p_end=0xbffff33c)
    at ../Parser/tokenizer.c:1411
#4  0x08059042 in PyTokenizer_Get (tok=0x81c71d8, p_start=0xbffff338,
    p_end=0xbffff33c) at ../Parser/tokenizer.c:1514
#5  0x080568a7 in parsetok (tok=0x81c71d8, g=0x814a000, start=256,
    err_ret=0xbffff3a0, flags=0) at ../Parser/parsetok.c:135

Does this ring a bell? Is there already an SF bug open perhaps?

On OSX, I get an interesting error:

python2.5(12998) malloc: ***  Deallocation of a pointer not malloced:
0x36b460; This could be a double free(), or free() called with the
middle of an allocated block; Try setting environment variable
MallocHelp to see tools to help debug

--Guido van Rossum (home page: http://www.python.org/~guido/)

More information about the Python-Dev mailing list