Message362846
Below sample program, will raise "Modules/gcmodule.c:110: gc_decref: Assertion "gc_get_refs(g) > 0" failed: refcount is too small" on Python 3.8.2 debug build.
On 3.7.6 debug build, "Modules/gcmodule.c:277: visit_decref: Assertion `_PyGCHead_REFS(gc) != 0' failed." is raised.
```
import collections
import gc
import weakref
hooks_dict = collections.OrderedDict()
hooks_dict_ref = weakref.ref(hooks_dict)
gc.collect()
print('Hello world')
```
The complete error message on 3.8.2 debug build is
```
Modules/gcmodule.c:110: gc_decref: Assertion "gc_get_refs(g) > 0" failed: refcount is too small
Memory block allocated at (most recent call first):
File "/home/$USER/test.py", line 6
object : <weakref at 0x7ff788208a70; to 'collections.OrderedDict' at 0x7ff7881fab90>
type : weakref
refcount: 1
address : 0x7ff788208a70
Fatal Python error: _PyObject_AssertFailed
Python runtime state: initialized
Current thread 0x00007ff789f9c080 (most recent call first):
File "/home/$USER/test.py", line 7 in <module>
zsh: abort PYTHONTRACEMALLOC=1 python ~/test.py
``` |
|
Date |
User |
Action |
Args |
2020-02-27 21:52:09 | leezu | set | recipients:
+ leezu |
2020-02-27 21:52:09 | leezu | set | messageid: <1582840329.06.0.498356539569.issue39778@roundup.psfhosted.org> |
2020-02-27 21:52:09 | leezu | link | issue39778 messages |
2020-02-27 21:52:08 | leezu | create | |
|