[New-bugs-announce] [issue26617] Assertion failed in gc with __del__ and weakref
Guo, Jiahua
report at bugs.python.org
Wed Mar 23 02:08:59 EDT 2016
New submission from Guo, Jiahua:
$ 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()
----------
components: Interpreter Core
messages: 262242
nosy: Guo, Jiahua
priority: normal
severity: normal
status: open
title: Assertion failed in gc with __del__ and weakref
type: crash
versions: Python 3.4, Python 3.5
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue26617>
_______________________________________
More information about the New-bugs-announce
mailing list