[New-bugs-announce] [issue38037] Assertion failed: object has negative ref count

Ma Lin report at bugs.python.org
Thu Sep 5 07:14:08 EDT 2019


New submission from Ma Lin <malincns at 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 <report at bugs.python.org>
<https://bugs.python.org/issue38037>
_______________________________________


More information about the New-bugs-announce mailing list