Thread
Commits
-
Fix possible future cache reference leak in ALTER EXTENSION ADD/DROP.
- 3125a5baec1c 13.0 landed
-
Possible cache reference leak by removeExtObjInitPriv
Kyotaro Horiguchi <horikyota.ntt@gmail.com> — 2020-04-17T06:18:31Z
Hello. 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. regards. [1] https://www.postgresql.org/message-id/BYAPR08MB5606D1453D7F50E2AF4D2FD29AD80@BYAPR08MB5606.namprd08.prod.outlook.com
-
Re: Possible cache reference leak by removeExtObjInitPriv
Tom Lane <tgl@sss.pgh.pa.us> — 2020-04-17T17:07:15Z
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
-
Re: Possible cache reference leak by removeExtObjInitPriv
Kyotaro Horiguchi <horikyota.ntt@gmail.com> — 2020-04-20T08:28:29Z
At Fri, 17 Apr 2020 13:07:15 -0400, Tom Lane <tgl@sss.pgh.pa.us> wrote in > 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. Thanks for commit it. > 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. Indeed. regards. -- Kyotaro Horiguchi NTT Open Source Software Center