Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ioLll-00078R-Tu for pgsql-bugs@arkaria.postgresql.org; Mon, 06 Jan 2020 06:21:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ioLlk-0004GG-6J for pgsql-bugs@arkaria.postgresql.org; Mon, 06 Jan 2020 06:21:40 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ioLlj-0004G9-RE for pgsql-bugs@lists.postgresql.org; Mon, 06 Jan 2020 06:21:39 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ioLlh-0002fs-Fe for pgsql-bugs@lists.postgresql.org; Mon, 06 Jan 2020 06:21:38 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id 0066LZ9o001235; Mon, 6 Jan 2020 01:21:35 -0500 From: Tom Lane To: Michael Paquier cc: starbugs@qq.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #16190: The usage of NULL pointer in refint.c In-reply-to: <20200106051800.GL3598@paquier.xyz> References: <16190-70181c803641c3dc@postgresql.org> <20200106051800.GL3598@paquier.xyz> Comments: In-reply-to Michael Paquier message dated "Mon, 06 Jan 2020 14:18:00 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <1233.1578291695.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Mon, 06 Jan 2020 01:21:35 -0500 Message-ID: <1234.1578291695@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Michael Paquier writes: > On Mon, Jan 06, 2020 at 03:39:36AM +0000, PG Bug reporting form wrote: >> We checked the code in file =E2=80=9Crefint.c=E2=80=9D and there is one= error occurring in >> line 636. > It could be better to switch all that to not use directly system > calls, and rely properly on a high-level memory context with > palloc-like allocations. Yeah, if somebody wanted to fix this, the right way is to replace these malloc calls with pallocs. Some investigation would be needed about which context to use. > ... There could be also an argument to just > remove the module per the lack of attention it is getting, though it > is still useful as an example of use for SPI, and the docs mention > it for that. The regression tests use refint too. Still, it's not production-grade code by any means, and I'm not sure if there's much point in making it so. I won't stand in the way if somebody else wants to ;-) regards, tom lane