gc assertion failure

Todd Miller jmiller at stsci.edu
Wed Oct 29 12:26:03 EST 2003


Hi,

I recently discovered an assertion failure in the Python garbage 
collection system when scripts using our C extension (numarray) exit. 
The assertion is activated for Pythons configured using --with-pydebug. 
  I have a feeling I may be doing something wrong with garbage 
collection support for some of our c types,  but I'm not sure exactly 
what.

Here is the assertion output:

python: Modules/gcmodule.c:231: visit_decref: Assertion `gc->gc.gc_refs 
!= 0' failed.
Abort (core dumped)


Here's the traceback from gdb:

#0  0x4017dfd1 in kill () from /lib/libc.so.6
#1  0x4002d762 in raise () from /lib/libpthread.so.0
#2  0x4017dca2 in raise () from /lib/libc.so.6
#3  0x4017f04d in abort () from /lib/libc.so.6
#4  0x40177695 in __assert_fail () from /lib/libc.so.6
#5  0x080e9222 in visit_decref (op=0x405adc74, data=0x0) at 
Modules/gcmodule.c:231
#6  0x0808cebf in tupletraverse (o=0x40a62f74, visit=0x80e9194 
<visit_decref>, arg=0x0) at Objects/tupleobject.c:398
#7  0x080e9275 in subtract_refs (containers=0x813d2e8) at 
Modules/gcmodule.c:250
#8  0x080e9a9e in collect (generation=2) at Modules/gcmodule.c:582
#9  0x080ea342 in PyGC_Collect () at Modules/gcmodule.c:993
#10 0x080e1bf6 in Py_Finalize () at Python/pythonrun.c:335
#11 0x08055543 in Py_Main (argc=4, argv=0xbffff6d4) at Modules/main.c:435
#12 0x08054cae in main (argc=4, argv=0xbffff6d4) at Modules/python.c:23
#13 0x4016c4ed in __libc_start_main () from /lib/libc.so.6

Can anyone give me any insight into what needs fixing?

Thanks,
Todd





More information about the Python-list mailing list