Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ppnoV-0000gw-4g for pgsql-hackers@arkaria.postgresql.org; Fri, 21 Apr 2023 10:16:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ppnoU-00040d-0f for pgsql-hackers@arkaria.postgresql.org; Fri, 21 Apr 2023 10:16:22 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ppnoS-00040U-Bk for pgsql-hackers@lists.postgresql.org; Fri, 21 Apr 2023 10:16:21 +0000 Received: from wout5-smtp.messagingengine.com ([64.147.123.21]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ppnoO-004DYw-Fl for pgsql-hackers@postgresql.org; Fri, 21 Apr 2023 10:16:19 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 2C4833200912; Fri, 21 Apr 2023 06:16:12 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Fri, 21 Apr 2023 06:16:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm3; t=1682072171; x=1682158571; bh=D6 f8yDDz3+x+D6SOYf02QUfXK6VZEU5QuNq6kBWT5gQ=; b=C56PuHtTrEWuZR/NMS vQ2NrAoeFuxHhfD+4R8SKwaOzmI7z//g0oU+Mu2ec03nYjlpJWrt/eMk22y3NLeX lGFZvjjBMHOBQZzi+B/PYmOpILWvSIGHhilTP35LZ1mkZ7xUlGKt7UM/1qemp6ei p8FfUKCJbgxdPRTCl0xRwbBEv+y9ohGUeDDh9OmP0nLdRQFlk/7gj9OvItZW5By9 /6go5jHjFPTUTMPrYAWrh0BN10TC1BfntqBnHWZ982KFhqpeJCErEODIB4rb6O1J y7FzuQjcRAaphy2w05NIsyvkIkEQ3EkaXXVfxh9HC3ppSJ3bVEBgBzUuWrvMa1nD 702Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1682072171; x=1682158571; bh=D6f8yDDz3+x+D 6SOYf02QUfXK6VZEU5QuNq6kBWT5gQ=; b=Bgn06fx05uDaVSCUKJTzeOQ4jCmMt bC85ZIpd8Ld6Op08AE2jMyrOjLEsNWU/qc7pE8aYzhjeFuJkRAAyBDrKJzNFglHD ktXXHyldpeflUT9bw2vmrzvPkwWizmH9wr9iHtOZ5jgLeyQt+7L4rfm86trKHTXc ixbJQcTzPq0dALxvLmrCwcoj97ao+oACdJvVHtZmtmgLB9ENxv9jFJC3qDMdahye EynHRQJdbNRGWEIhbdSkspaujr0kX0+7TmPll+lAFP4b8FnW5DiPMiZ9XZcDlXq2 eu9wEei5ii9nRfM4US0W0abHyyQAbjA/tf7Jahb4lZ45C3KypooS+GAaw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfedtgedgvdehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdljedtmdenucfjughrpeffhffvvefukfhfgggtuggjsehgtderredt tddvnecuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesph grqhhuihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepteelieefudffhffhtdetleeg geegfffhkeeuveetiefgudduvedutefggeeivdejnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiih ii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 21 Apr 2023 06:16:09 -0400 (EDT) Date: Fri, 21 Apr 2023 19:16:03 +0900 From: Michael Paquier To: Alexander Pyhalov Cc: pgsql-hackers@postgresql.org Subject: Re: buffer refcount leak in foreign batch insert code Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="CJstmqnczrgWsVAA" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --CJstmqnczrgWsVAA Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Apr 21, 2023 at 01:07:03PM +0300, Alexander Pyhalov wrote: > We've found that in cases like the one attached, when we insert into fore= ign > partition with batch_size set, buffer refcount leak is detected. >=20 > The above example we see a dozen of similar messages: >=20 > repro_small.sql:31: WARNING: buffer refcount leak: [14621] > (rel=3Dbase/16718/16732, blockNum=3D54, flags=3D0x93800000 Indeed, nice repro! That's obviously wrong, I'll look into that. -- Michael --CJstmqnczrgWsVAA Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmRCYmMACgkQnvQgOdby QH1oCQ//a82fG0OP5s+k9KPtSb7SSHsGZGqi+SLs0+VW/oozwbIUIHrSHZjvT0kY xkvUSiJ0lKgC9jTjZnS4Ko7BiKhICp1UE0wo84FlTECfktFneoQdIETt1m0ZQPPK 1mGB7Bze+e3UlnDnco4Q+t6O+SNQqqxo5pOseeDg+vh8lbldfP+UKmhae4dgmFR7 9sglZoWjTBYcjiYGc8ckFzRCyxX5R1X/YKj1hCLwaALTIvCJE4Npwzmgjc7/bH8u Lvt6BSg6dNDspN09nwfta0WqQ51iRWJxj9EPOWrAJK/k0IgfPa+BtxVCgGMmIeGH bcxpgb+2S3B788l9zY0yjt1/oMH2Z7/I8esJ/jzO2r+6CT7yGecBaBdUH/jrg3hb gvFMJQyzkEnyra0qRU2Nly6PAGE1UMWVjeOlVWhvPbCmwvSX7/E17W8gUS5QwWFZ DmfQ9maGk6pAS7Hv5eDrZlO35Ijuqj9SRxiDDAbeZeLxvlFjo4686edeIF9vNshC BrWQL8H1jzlv54+cdYtyMqUUsz+hIfiaLVztYS46iXzZ6C7y0d1Pk1nUixEUH131 BzukXog4MjEFbCm5ovyylMGWHTJ8RdE8GcaR++c4HCpWqB7YqlmiUqnzMtsm+Oh9 3V0kk2DgzDVV4fv1EmlNQh4y2gPeRToHL6yfgMonjVb2B9WHt4Y= =QNd0 -----END PGP SIGNATURE----- --CJstmqnczrgWsVAA--