[Python-Dev] segmentation fault in Python 2.5b3 (trunk:51066)

Ralf Schmitt ralf at brainbot.com
Thu Aug 3 15:02:11 CEST 2006


Hi all,

I've been trying to port our software to python 2.5.
unfortunately I'm getting constantly hit by segfaults.

I've boiled it down to the following code:

rs at schrotti:~/bug$ cat t.py
import array

class Indexer(object):
     maximumForwardSize = property(array.array.fromstring)
rs at schrotti:~/bug$ python t.py
Segmentation fault
rs at schrotti:~/bug$ python
Python 2.5b3 (trunk:51066, Aug  3 2006, 13:18:16)
[GCC 4.0.3 (Ubuntu 4.0.3-1ubuntu5)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
 >>>
[18733 refs]
[7182 refs]
rs at schrotti:~/bug$ gdb python
GNU gdb 6.4-debian
Copyright 2005 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain 
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i486-linux-gnu"...Using host libthread_db 
library "/lib/tls/i686/cmov/libthread_db.so.1".

(gdb) r t.py
Starting program: /home/rs/exp/bin/python t.py
[Thread debugging using libthread_db enabled]
[New Thread -1210304832 (LWP 21660)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1210304832 (LWP 21660)]
0x0811b68a in visit_decref (op=0xb7db21d8, data=0x0) at 
Modules/gcmodule.c:270
270		if (PyObject_IS_GC(op)) {
(gdb) bt
#0  0x0811b68a in visit_decref (op=0xb7db21d8, data=0x0) at 
Modules/gcmodule.c:270
#1  0x0814043d in property_traverse (self=0xb7d7b5b4, visit=0x811b654 
<visit_decref>, arg=0x0) at Objects/descrobject.c:1235
#2  0x0811b753 in subtract_refs (containers=0x8197d88) at 
Modules/gcmodule.c:295
#3  0x0811c453 in collect (generation=2) at Modules/gcmodule.c:790
#4  0x0811cf76 in PyGC_Collect () at Modules/gcmodule.c:1264
#5  0x0810d5da in Py_Finalize () at Python/pythonrun.c:377
#6  0x08057556 in Py_Main (argc=2, argv=0xbfb5a6f4) at Modules/main.c:516
#7  0x080565ba in main (argc=2, argv=0xbfb5a6f4) at ./Modules/python.c:23
(gdb)



More information about the Python-Dev mailing list