Re: [DynInst_API:] closeSymtab() throws a ref count assert in 9.3.1


Date: Wed, 08 Mar 2017 16:16:55 -0600
From: "Mark W. Krentel" <krentel@xxxxxxxx>
Subject: Re: [DynInst_API:] closeSymtab() throws a ref count assert in 9.3.1
Ok, that seems to fix the problem.  At least, it doesn't throw an
assert running on complicated binaries (eg, hpcstruct analyzing
itself).

But I'm struggling to understand your fix.  Maybe I'm being dense or
missig something obvious.  It seems to me that your patch simply
changes the body of decrRefCount() from this:

void Type::decrRefCount()
{
    assert(refCount > 0);
    if (!--refCount) {
        delete this;
    }
}

to this:

void Type::decrRefCount()
{
    --refCount;
    if(refCount == 0) delete this;
}

So, of course, it doesn't throw an assert because the assert is gone.
But if the original conditions of bug still happen, ie refCount = 0,
then it seems to me that you've changed refCount to unsigned int with
value 0xffffffff.  That can't be right.

What am I missing?

And why does something want to decrement an object with refCount = 0
in the first place?  Doesn't that suggest that something is
miscounting the ref counts?

--Mark


On 03/07/17 15:43, Bill Williams wrote:
Should be fixed on the v9.3.x branch. This doesn't trigger on all binaries, interestingly enough, but it's decently common.

--bw

[← Prev in Thread] Current Thread [Next in Thread→]