Skip to content

Assertion fails on exit if namespace is present #6

@GoogleCodeExporter

Description

@GoogleCodeExporter
The following code will cause an assert to fail on python exit:
"""
namespace a {
  class Blah {
  };
}
"""

Python input/output:
"""
>>> import robin
>>> robin.loadLibrary("blah", "libblah.dylib")
>>> exit()
Assertion failed: (gc->gc.gc_refs != 0), function visit_decref, file 
Modules/gcmodule.c, line 276.
Abort trap
"""

This problem also happens in the current tests, and it doesn't happen on Linux.

Valgrind run (on linux, no valgrind for mac yet :( ), gave the following output 
(on exit). No such 
error was given on run without namespaces present:
"""
>>> import robin
>>> robin.loadLibrary("blah", "./libblah.so")
>>> 
==26374== Invalid read of size 8
==26374==    at 0x441F17: ??? in /usr/bin/python2.5
==26374==    by 0x44398D: PyDict_SetItem in /usr/bin/python2.5
==26374==    by 0x44573D: _PyModule_Clear in /usr/bin/python2.5
==26374==    by 0x49F573: PyImport_Cleanup in /usr/bin/python2.5
==26374==    by 0x4ABA71: Py_Finalize in /usr/bin/python2.5
==26374==    by 0x4140B7: Py_Main in /usr/bin/python2.5
==26374==    by 0x56ED1C3: (below main) in /lib/libc-2.7.so
==26374==  Address 0x5f3dd60 is 32 bytes inside a block of size 56 free'd
==26374==    at 0x4C24B0F: PyObject_Free 
/tmp/vg/coregrind/m_replacemalloc/vg_replace_malloc.c:325
==26374==    by 0x441F6C: ??? in /usr/bin/python2.5
==26374==    by 0x44398D: PyDict_SetItem in /usr/bin/python2.5
==26374==    by 0x49F323: PyImport_Cleanup in /usr/bin/python2.5
==26374==    by 0x4ABA71: Py_Finalize in /usr/bin/python2.5
==26374==    by 0x4140B7: Py_Main in /usr/bin/python2.5
==26374==    by 0x56ED1C3: (below main) in /lib/libc-2.7.so
==26374== 
==26374== Invalid write of size 8
==26374==    at 0x441F21: ??? in /usr/bin/python2.5
==26374==    by 0x44398D: PyDict_SetItem in /usr/bin/python2.5
==26374==    by 0x44573D: _PyModule_Clear in /usr/bin/python2.5
==26374==    by 0x49F573: PyImport_Cleanup in /usr/bin/python2.5
==26374==    by 0x4ABA71: Py_Finalize in /usr/bin/python2.5
==26374==    by 0x4140B7: Py_Main in /usr/bin/python2.5
==26374==    by 0x56ED1C3: (below main) in /lib/libc-2.7.so
==26374==  Address 0x5f3dd60 is 32 bytes inside a block of size 56 free'd
==26374==    at 0x4C24B0F: PyObject_Free 
/tmp/vg/coregrind/m_replacemalloc/vg_replace_malloc.c:325
==26374==    by 0x441F6C: ??? in /usr/bin/python2.5
==26374==    by 0x44398D: PyDict_SetItem in /usr/bin/python2.5
==26374==    by 0x49F323: PyImport_Cleanup in /usr/bin/python2.5
==26374==    by 0x4ABA71: Py_Finalize in /usr/bin/python2.5
==26374==    by 0x4140B7: Py_Main in /usr/bin/python2.5
==26374==    by 0x56ED1C3: (below main) in /lib/libc-2.7.so
==26374== 
==26374== malloc/free: in use at exit: 583,573 bytes in 2,593 blocks.
==26374== malloc/free: 28,238 allocs, 25,645 frees, 3,934,645 bytes allocated.
==26374== For counts of detected errors, rerun with: -v
==26374== searching for pointers to 2,593 not-freed blocks.
==26374== checked 1,359,600 bytes.
"""

Original issue reported on code.google.com by misha.seltzer on 6 Jun 2009 at 5:03

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions