Message262242
$ 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() |
|
Date |
User |
Action |
Args |
2016-03-23 06:08:59 | guojiahua | set | recipients:
+ guojiahua |
2016-03-23 06:08:59 | guojiahua | set | messageid: <1458713339.87.0.171873505456.issue26617@psf.upfronthosting.co.za> |
2016-03-23 06:08:59 | guojiahua | link | issue26617 messages |
2016-03-23 06:08:59 | guojiahua | create | |
|