Re: Possible cache reference leak by removeExtObjInitPriv - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Possible cache reference leak by removeExtObjInitPriv
Date
Msg-id 10513.1587143235@sss.pgh.pa.us
Whole thread Raw
In response to Possible cache reference leak by removeExtObjInitPriv  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
Responses Re: Possible cache reference leak by removeExtObjInitPriv  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
Re: [PATCH] Fix buffer not null terminated on (ecpg lib)  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
List pgsql-hackers
Kyotaro Horiguchi <horikyota.ntt@gmail.com> writes:
> Recently a cache reference leak was reported then fixed [1].
> I happened to notice a similar possible leakage in
> removeEtObjInitPriv. I haven't found a way to reach the code, but can
> be forcibly caused by tweaking the condition.
> Please find the attached.

Ugh.  recordExtObjInitPriv has the same problem.

I wonder whether there is any way to teach Coverity, or some other
static analyzer, to look for code paths that leak cache refcounts.
It seems isomorphic to detecting memory leaks, which Coverity is
reasonably good at.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Race condition in SyncRepGetSyncStandbysPriority
Next
From: Robert Haas
Date:
Subject: Re: spin_delay() for ARM