Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Abort with "negative ref count" #37773

Closed
doerwalter opened this issue Jan 15, 2003 · 12 comments
Closed

Abort with "negative ref count" #37773

doerwalter opened this issue Jan 15, 2003 · 12 comments
Assignees
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs)

Comments

@doerwalter
Copy link
Contributor

BPO 668433
Nosy @gvanrossum, @tim-one, @smontanaro, @doerwalter
Files
  • m.py
  • neg.py: updated, slightly shorter test file
  • temp.py: Very short test case
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/gvanrossum'
    closed_at = <Date 2003-02-06.04:43:35.000>
    created_at = <Date 2003-01-15.12:23:39.000>
    labels = ['interpreter-core']
    title = 'Abort with "negative ref count"'
    updated_at = <Date 2003-02-06.04:43:35.000>
    user = 'https://github.com/doerwalter'

    bugs.python.org fields:

    activity = <Date 2003-02-06.04:43:35.000>
    actor = 'skip.montanaro'
    assignee = 'gvanrossum'
    closed = True
    closed_date = None
    closer = None
    components = ['Interpreter Core']
    creation = <Date 2003-01-15.12:23:39.000>
    creator = 'doerwalter'
    dependencies = []
    files = ['742', '743', '744']
    hgrepos = []
    issue_num = 668433
    keywords = []
    message_count = 12.0
    messages = ['14069', '14070', '14071', '14072', '14073', '14074', '14075', '14076', '14077', '14078', '14079', '14080']
    nosy_count = 5.0
    nosy_names = ['gvanrossum', 'tim.peters', 'skip.montanaro', 'doerwalter', 'nnorwitz']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue668433'
    versions = ['Python 2.3']

    @doerwalter
    Copy link
    Contributor Author

    Python 2.3a1 and the current CVS version abort with the
    following error message when executing the attached
    test script:
    Fatal Python error:
    D:\Python-current\dist\src\Objects\descrobject.c:10
    object at 007C3208 has negative ref count -1

    This happens only in the debug build, both on Linux
    (with configure --enable-unicode=ucs4 --with-pydebug
    and 2.3a1) and on Windows (with the debug build and
    current CVS).

    @doerwalter doerwalter added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Jan 15, 2003
    @doerwalter doerwalter added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Jan 15, 2003
    @nnorwitz
    Copy link
    Mannequin

    nnorwitz mannequin commented Jan 15, 2003

    Logged In: YES
    user_id=33168

    Walter, there's no file attached.

    @nnorwitz
    Copy link
    Mannequin

    nnorwitz mannequin commented Jan 15, 2003

    Logged In: YES
    user_id=33168

    I'm not running w/--enable-unicode=ucs4, but I still get the
    problem. I've simplified the test, but only a little so far.
    The problem did not affect 2.2.2, only 2.3.

    @nnorwitz
    Copy link
    Mannequin

    nnorwitz mannequin commented Jan 15, 2003

    Logged In: YES
    user_id=33168

    8/6/2002 works without complaints, 8/8/2002 breaks, 8/7/2002
    breaks with a different error message:
    Objects/typeobject.c:466: subtype_dealloc: Assertion
    `g->gc.gc_refs != (-2)' failed.

    All dates are American, ie, August, 6-8. The change
    corresponds to Object/typeobject.c:

    8/6 - 2.165 works
    8/7 - 2.166 assertion listed above
    8/8 - 2.167 assertion in bug report (current)

    Guido made all the changes, assigning to him. :-)

    @gvanrossum
    Copy link
    Member

    Logged In: YES
    user_id=6380

    Bah. Trashcan code. :-(

    OK, I'll look at it.

    When I have time.

    @tim-one
    Copy link
    Member

    tim-one commented Feb 5, 2003

    Logged In: YES
    user_id=31435

    Attached a very short test case.

    @gvanrossum
    Copy link
    Member

    Logged In: YES
    user_id=6380

    Fixed in CVS, typeobject.c 2.203. Much thanks to Tim, who
    understands the trashgcan code much better than I do.
    Explanation is in the code. I checked that none of the three
    examples breaks with the new code.

    @smontanaro
    Copy link
    Contributor

    Logged In: YES
    user_id=44345

    I'm still seeing a negative ref count error with a fresh debug build after
    cvs up...

    (gdb) p *old_value
    $1 = {
    _ob_next = 0xdbdbdbdb,
    _ob_prev = 0xdbdbdbdb,
    ob_refcnt = -606348326,
    ob_type = 0xdbdbdbdb
    }

    #0 0x9001b52c in kill ()
    #1 0x9005ceec in abort ()
    #2 0x00012ad8 in Py_AtExit (func=0x4bfe0 <_Py_NegativeRefcount+88>) at Python/pythonrun.c:1334
    #3 0x0004bfe0 in _Py_NegativeRefcount (fname=0x1266ac "Objects/dictobject.c", lineno=373, op=0x473258) at Objects/object.c:104
    #4 0x0006cd90 in insertdict (mp=0x4da428, key=0x54ba28, hash=1490138787, value=0x134aac) at Objects/dictobject.c:373
    #5 0x0006fddc in PyDict_Merge (a=0x4da428, b=0x4752d8, override=1) at Objects/dictobject.c:1142
    #6 0x0006fb3c in PyDict_Update (a=0x4da428, b=0x4752d8) at Objects/dictobject.c:1102
    #7 0x00051188 in merge_class_dict (dict=0x4da428, aclass=0x465ce0) at Objects/object.c:1641
    #8 0x0005131c in merge_class_dict (dict=0x4da428, aclass=0x465d28) at Objects/object.c:1665
    #9 0x00051ae4 in PyObject_Dir (arg=0x472278) at Objects/object.c:1796
    #10 0x000cfca0 in builtin_dir (self=0x0, args=0x4c89a0) at Python/bltinmodule.c:396
    #11 0x000c4470 in PyCFunction_Call (func=0x404df8, arg=0x4c89a0, kw=0x0) at Objects/methodobject.c:73
    #12 0x000b8630 in call_function (pp_stack=0xbfffbb50, oparg=1) at Python/ceval.c:3285
    #13 0x000b2e04 in eval_frame (f=0x4a1a38) at Python/ceval.c:2041
    ...

    @tim-one
    Copy link
    Member

    tim-one commented Feb 6, 2003

    Logged In: YES
    user_id=31435

    Skip, which program were you running? I don't see any
    calls to dir() in any of the programs attached to this bug
    report, so I doubt that this bug report has anything to do
    with what you're seeing.

    @smontanaro
    Copy link
    Contributor

    Logged In: YES
    user_id=44345

    I was running a unittest script for the nascent csv module. After posting,
    I noticed that there was a bug in the test code (at the Python level), but
    the C code underneath seems fairly solid. (Based on Object Craft's csv
    module which is pretty stable.)

    @tim-one
    Copy link
    Member

    tim-one commented Feb 6, 2003

    Logged In: YES
    user_id=31435

    Please open a new bug report then. The cause of what
    you're seeing almost certainly has nothing to do with this
    bug report (for starters, you're nowhere near
    subtype_dealloc()), so mixing it in here is just going to
    cause ongoing confusion (as it already has).

    @smontanaro
    Copy link
    Contributor

    Logged In: YES
    user_id=44345

    my apologies. too quick with the assumptions.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    interpreter-core (Objects, Python, Grammar, and Parser dirs)
    Projects
    None yet
    Development

    No branches or pull requests

    4 participants