New submission from Ma Lin <malin...@163.com>:

Adding these two lines to /Objects/longobject.c will disable the "preallocated 
small integer pool":

    #define NSMALLPOSINTS  0
    #define NSMALLNEGINTS  0

Then run this reproduce code (attached):

    from enum import IntEnum
    import _signal

    class Handlers(IntEnum):
        A = _signal.SIG_DFL
        B = _signal.SIG_IGN

When the interpreter exits, will get this error:

    d:\dev\cpython\PCbuild\win32>python_d.exe d:\a.py
    d:\dev\cpython\include\object.h:541: _Py_NegativeRefcount: Assertion 
failed: object has negative ref count
    <object: freed>
    Fatal Python error: _PyObject_AssertFailed

    Current thread 0x0000200c (most recent call first):

3.8 and 3.9 branches are affected.
I'm sorry, this issue is beyond my ability.

----------
files: reproduce.py
messages: 351196
nosy: Ma Lin
priority: normal
severity: normal
status: open
title: Assertion failed: object has negative ref count
versions: Python 3.8, Python 3.9
Added file: https://bugs.python.org/file48594/reproduce.py

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue38037>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to