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 1ioeaM-0003g2-7M for pgsql-bugs@arkaria.postgresql.org; Tue, 07 Jan 2020 02:27:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ioeaK-0005b8-LV for pgsql-bugs@arkaria.postgresql.org; Tue, 07 Jan 2020 02:27:08 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ioeaJ-0005TA-Ns for pgsql-bugs@lists.postgresql.org; Tue, 07 Jan 2020 02:27:08 +0000 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ioeaC-0001u3-59 for pgsql-bugs@lists.postgresql.org; Tue, 07 Jan 2020 02:27:04 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 7C341341; Mon, 6 Jan 2020 21:26:56 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Mon, 06 Jan 2020 21:26:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm3; bh=NZOyL+4yhKp9LCzJSqQPxI4i/KR fYzzPE+CfI3krnNU=; b=jDsYBKD6rb1bRqxDD+lxuh4Byp8gH6b/bB+QoPJEY+j Rrns8Preoum+ORHsG4KMBkuMXWq7Ask+1x3ktAoCZRkhCbtqSW5P7rbErypryFBs nJr05riYu5UHpsaGsBb6Rc6nxWsz3fy0PhdsPPRdR289Ys69GBP2wj77s+6D2aFP x6QLzAnURGvxo/IcYXXtbX7K7BOtn8awKJ1jQ7c09NZWKYJvsgr1DvR0NzFpgF8u WzIh8jSCNviv+ZUER3D4bSBLUZpFUY20ZAcySOMUPPdxQR0uEQg5D+DR6GkL1ELP +1aP5RhNST+YGVvTRDoqwSflvIQjsaClcJ18Qy+D9bA== 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=NZOyL+ 4yhKp9LCzJSqQPxI4i/KRfYzzPE+CfI3krnNU=; b=M/giYhAJZQSRs6jrdcgPY1 XayMd57qF7gcWVPa8OKKgWxcV5yIre3EI6Z46mzaOQXLklOush9rgv55s5bnMqA7 MkCWObVqqUfeYojArN3fRH7on/65iAg9eutcVLKbmomFKhoBDu+ZmcZSOKGjA9Bm H7n+LoaH+qa3u7Av4wQ9q1WxD8i2+saj4GPvxR6eA22kqgLxhd3+SzunxAUi0RsF DpNV901eIkHlJ1I+5vEU81hWDD6mXFq3JcdQNqHchSHRZvRzEe+AbPWjXYSEjh38 zufCgIjTjUHq/rMtS7YP4J8i0icA5szLu+j8ZZ6obLoheXDNNfkJ9RBknkFKlacQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrvdehuddggeeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdlfeehmdenucfjughrpeffhffvuffkfhggtggujgesthdtredttddt vdenucfhrhhomheptehnughrvghsucfhrhgvuhhnugcuoegrnhgurhgvshesrghnrghrrg iivghlrdguvgeqnecukfhppeeijedrudeitddrvddujedrvdehtdenucfrrghrrghmpehm rghilhhfrhhomheprghnughrvghssegrnhgrrhgriigvlhdruggvnecuvehluhhsthgvrh fuihiivgeptd X-ME-Proxy: Received: from intern.anarazel.de (c-67-160-217-250.hsd1.ca.comcast.net [67.160.217.250]) by mail.messagingengine.com (Postfix) with ESMTPA id 7561E8005B; Mon, 6 Jan 2020 21:26:55 -0500 (EST) Date: Mon, 6 Jan 2020 18:26:54 -0800 From: Andres Freund To: Tom Lane Cc: Michael Paquier , starbugs@qq.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #16190: The usage of NULL pointer in refint.c Message-ID: <20200107022654.vgfwx7hactiokcsa@alap3.anarazel.de> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7984.1578363125@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2020-01-06 21:12:05 -0500, Tom Lane wrote: > Michael Paquier writes: > > On Mon, Jan 06, 2020 at 09:44:43AM -0800, Andres Freund wrote: > >> I think we should consider either moving this out of contrib, or fixing > >> it up. test/example code is fine, but contrib gets installed by default > >> for a lot of people... And yea, this isn't just about contrib/spi. > > > No idea about moving that out of contrib/, but here is a patch to fix > > things that just moves the allocations to TopMemoryContext and removes > > the system calls. > > 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. Yea, it's certainly better than the current situation. An incremental improvement would be to do the allocations in a separate contect, for easier debugging should there ever be a leak... - Andres