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 1ioibW-00025j-RO for pgsql-bugs@arkaria.postgresql.org; Tue, 07 Jan 2020 06:44:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ioibV-0006Tb-AX for pgsql-bugs@arkaria.postgresql.org; Tue, 07 Jan 2020 06:44:37 +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 1ioibU-0006TU-VP for pgsql-bugs@lists.postgresql.org; Tue, 07 Jan 2020 06:44:37 +0000 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ioibS-0005x1-IW for pgsql-bugs@lists.postgresql.org; Tue, 07 Jan 2020 06:44:35 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 94754480; Tue, 7 Jan 2020 01:44:32 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Tue, 07 Jan 2020 01:44:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm3; bh=q2u9d4KHc7tJnPBzSU9+/8xujkU xDlKiOmIEDdyWark=; b=FnIptf9i9dlix57iCJbvmONz8VfXhh/jnDp4ATCd0R+ vGRESQFeGmuiqr7X8Nlko4Nw648dXf/j1xlVxLSEjxiy/QMJ7YTWegpLiLYKjmcx i3bX22He0HI93VHFBr/zlHZ0FSs+PJ//e8ekVte3JD9YEclF0JS+purDCkrfpzBC U9ZhN9dMSBAZRDfCjLtmGjcYbfjHpBobUf86eOKQFanvaWux7sX5eXr55KfA2YyM 9Z38mzd7INOejtchaJzDvmml46OsMYdlSnvd58Ri+Qx54QMIX3EEEGcFg4/67IHi HmhGGniZlCzxIKlKveOhAiY/wNCLJh3ztQpQszafSOw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=q2u9d4 KHc7tJnPBzSU9+/8xujkUxDlKiOmIEDdyWark=; b=L6BX/C6VCymDzldt5inp0v oKMwBiwgsJRxMz0yKG+TLtiWl8l92w5n8T4LpfJgJWi2E+ZFEmCEaipf+XWo1nzU pqPEOwl/K3ksti9wZcZ0JKQCcYWNxPmkpmxOXdhi0MDmXzAArc4la/OSKW6vJrfV YF5k7Ag06bQou0ADd0HztfEofgd9yeRXfTXhTxymmHuVQUNR+6gKqCBlRqnDlsIb KjPwNOPEcHT8GCKq035VjL2iNz8tMrHAmP2eeZRnM+Y0Bw/kvFS7WMladGvc+3CO JNYTIzafg616NXA3UPkIZcifQY+z3H3n2TpY2alb+XxaRuhNT5Z8CN8a2/ryB6Ag == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrvdehuddguddttdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enfghrlhcuvffnffculdejtddmnecujfgurhepfffhvffukfhfgggtuggjsehgtderredt tddvnecuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesph grqhhuihgvrhdrgiihiieqnecukfhppeduuddurddutddvrddukedtrddukeehnecurfgr rhgrmhepmhgrihhlfhhrohhmpehmihgthhgrvghlsehprghquhhivghrrdighiiinecuve hluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from paquier.xyz (ee0822lan1.rev.em-net.ne.jp [111.102.180.185]) by mail.messagingengine.com (Postfix) with ESMTPA id 8D47680061; Tue, 7 Jan 2020 01:44:25 -0500 (EST) Date: Tue, 7 Jan 2020 15:44:12 +0900 From: Michael Paquier To: Andres Freund Cc: Tom Lane , starbugs@qq.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #16190: The usage of NULL pointer in refint.c Message-ID: <20200107064412.GG2386@paquier.xyz> References: <16190-70181c803641c3dc@postgresql.org> <20200106051800.GL3598@paquier.xyz> <1234.1578291695@sss.pgh.pa.us> <20200106174443.3pwnmshbxrbwggrm@alap3.anarazel.de> <20200107012741.GD2386@paquier.xyz> <7984.1578363125@sss.pgh.pa.us> <20200107022654.vgfwx7hactiokcsa@alap3.anarazel.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="NzX0AQGjRQPusK/O" Content-Disposition: inline In-Reply-To: <20200107022654.vgfwx7hactiokcsa@alap3.anarazel.de> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --NzX0AQGjRQPusK/O Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jan 06, 2020 at 06:26:54PM -0800, Andres Freund wrote: > On 2020-01-06 21:12:05 -0500, Tom Lane wrote: >> WFM. There are probably more elegant ways to do it than to drop this >> stuff into TopMemoryContext, but this is surely better than unchecked >> malloc calls. >=20 > Yea, it's certainly better than the current situation. An incremental > improvement would be to do the allocations in a separate contect, for eas= ier > debugging should there ever be a leak... Sure. I am not sure if that's worth the extra work though, so I would just be tempted to commit the patch that moves the allocation to TopMemoryContext and call it a day. Any objections to that? -- Michael --NzX0AQGjRQPusK/O Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAl4UKLwACgkQnvQgOdby QH1x3A//f4dWGeLPy9xGv/VD/nbQPYLCzifrDwxpv7AHkjWx4I4p6M0yqUvX5wQG VDm4kYQzeWNXFeigkGpgLzXiTe/hF+wl+kc9p9Vk/s4fPHpT3tdu3HH2RTYHHhPh vwjLQ9uK/gHq1cz8bTz2jKX62VtIW50eWIcXqnXNeGBF1462AgXF7Uq7spwSIGNo lbYSTHzCNwBq7UThpegutr6Q4fKFbz5PI6lmSj+qk3EBSJvyoVE4I3W8C7N3dyfJ 1pepNeR9ajzojd9cSbLc46GkRR1U2CYP/H1m9nRktRBHM5Ej0YalM3iwEkP6wKrt OGAFJ9ZpVjfn4erpqqrEb6yVDnqJrutQo6SmcPRMM/JNljeS65qzf3kGIIwjDz1J txSSnlKPM7x051Laz6JttOdwM8kN6vJhRiEPQwkyl4aizcSRKzNM8Ocl79QzlsVe J7I/2y3luuOgAePO5PCmK0bMBsmfTOMElmH0TUmzkDNfeQW/Hjhi/evu92U7gaL+ ApJq6b25Dn9P4lWaIvNhATYkvITe9WYLbJQTXugQXpwjdXprPo5LNjdFyEuqfifs WGQbLdObaYf4N7fK58G3QHts0/NxLSi4pI0o8QrwxpP0g1fRPUH3NXEXSpJRQwck UJAVGrAWj7/Tqk2mO7I1YWbg/QxtmQ2oANapBP+KZSPV+z/FMlg= =XDz1 -----END PGP SIGNATURE----- --NzX0AQGjRQPusK/O--