[issue26617] Assertion failed in gc with __del__ and weakref

2016-03-22 Thread Guo, Jiahua

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 
<http://bugs.python.org/issue26617>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26617] Assertion failed in gc with __del__ and weakref

2016-03-22 Thread Guo Jiahua

Changes by Guo Jiahua :


--
nosy: +Guo Jiahua

___
Python tracker 
<http://bugs.python.org/issue26617>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26617] Assertion failed in gc with __del__ and weakref

2016-05-18 Thread Guo, Jiahua

Changes by Guo, Jiahua :


Added file: http://bugs.python.org/file42892/patch

___
Python tracker 
<http://bugs.python.org/issue26617>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com