This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author guojiahua
Recipients guojiahua
Date 2016-03-23.06:08:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1458713339.87.0.171873505456.issue26617@psf.upfronthosting.co.za>
In-reply-to
Content
$ python3.5-dbg crash.py
python3.5-dbg: ../Modules/gcmodule.c:364: update_refs: Assertion `((gc)->gc.gc_refs >> (1)) != 0' failed.


$ python3.5-dbg crash-multithread.py
python3.5-dbg: ../Modules/gcmodule.c:364: update_refs: Assertion `((gc)->gc.gc_refs >> (1)) != 0' failed.


============ crash.py ==========
import weakref
import gc


def callback(o):
    gc.collect()


class C:
    def __del__(self):
        pass

def main():
    c = C()
    cref = weakref.ref(c, callback)
    del c


main()


============ crash-multithread.py ==========
import threading
import weakref
import gc


ei = threading.Event()
eo = threading.Event()


def gc_worker():
    ei.wait()
    gc.collect()
    eo.set()


def callback(o):
    ei.set()
    eo.wait()


class C:
    def __del__(self):
        pass


def main():
    t = threading.Thread(target=gc_worker)
    t.start()
    c = C()
    cref = weakref.ref(c, callback)
    del c
    t.join()


main()
History
Date User Action Args
2016-03-23 06:08:59guojiahuasetrecipients: + guojiahua
2016-03-23 06:08:59guojiahuasetmessageid: <1458713339.87.0.171873505456.issue26617@psf.upfronthosting.co.za>
2016-03-23 06:08:59guojiahualinkissue26617 messages
2016-03-23 06:08:59guojiahuacreate