Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qZLTb-0050fA-5y for pgsql-hackers@arkaria.postgresql.org; Fri, 25 Aug 2023 01:19:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qZLTZ-00F06n-4J for pgsql-hackers@arkaria.postgresql.org; Fri, 25 Aug 2023 01:19:00 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qZLTX-00F06J-RN for pgsql-hackers@lists.postgresql.org; Fri, 25 Aug 2023 01:19:00 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qZLTT-000nuk-Tn for pgsql-hackers@postgresql.org; Fri, 25 Aug 2023 01:18:58 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 4BDAA5C027C; Thu, 24 Aug 2023 21:18:54 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Thu, 24 Aug 2023 21:18:54 -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=fm1; t=1692926334; x=1693012734; bh=cT W3yzKdm1UKTZ8X8VfmP0soXvNunGNhkeb6oJETtss=; b=nzaLOjDMGqEolwST+y 3PLN3+7uRoBA1QNrC18Bp/49AeJNNQPfk7isbOl42aWMKmt5+D6JaUqc9nn5LOAv hT/5NQmM+4yWvZK9CSlr0vJIoI6BArQydCLL7jY7w8nARyIfWuHz7eKnEKtIQKgm aJvbQVlkz23MPybXLDu9VD5czz9p8gqkMMce4tvsci3dLfeYOqmn0QNZzcQkMwAv AsEMuObn4egRV50Pzg6jjwpBIIhHJM3aReqmyK3t/1yzUsCrowqbZB4uVaAznL9Y bPTBFFaIQP0eSoR1F0jk2X1kja3Uj7e+BggefSOTT2BNTNvSxhI6nvWUPmu1MDlL IWvA== 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=fm1; t=1692926334; x=1693012734; bh=cTW3yzKdm1UKT Z8X8VfmP0soXvNunGNhkeb6oJETtss=; b=SxZB9cn6sQ4KnwUQA+fKY0UnkL+HR ozXUdQNr/U7jGSxAQY3uLJ8AUmPwP/HiIKMclMg8WhZ/+8tKLUBAGgCjwVYIDbjs sB+SP85YjK6vqcCvqdk3O4+gODCqtl0Ad9mAVUHpe4cq6bq7yiwWn7IB6cJRPHRp m5LqgrvxqKIjprYgRAahgPjDyLzGqgL6zLs987Ce9T9YQ2EE9FJLxi5wwku5L4NY MuVmNQs5VebTep6/TOi0cSDnjd3PlrbsaycahRBroXLmsMQGuJtFIHrstCFq3aU+ B15tThEN2In1vNav3ksA28W1ijIJMm+iim1b07gdADK3Hq8XAjOaLUgwg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedruddvjedggeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdlfeehmdenucfjughrpeffhffvvefukfhfgggtuggjsehgtderredt tddvnecuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesph grqhhuihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepgeffjeevgfevuddvjedtvddt ieejheduueelvddufedtgfefjedvkeevkeeivddvnecuffhomhgrihhnpehpohhsthhgrh gvshhqlhdrohhrghenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhl fhhrohhmpehmihgthhgrvghlsehprghquhhivghrrdighiii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 24 Aug 2023 21:18:52 -0400 (EDT) Date: Fri, 25 Aug 2023 10:18:48 +0900 From: Michael Paquier To: Peter Geoghegan Cc: Ranier Vilela , Pg Hackers Subject: Re: Avoid a possible overflow (src/backend/utils/sort/logtape.c) Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="7Fs5Vvo7rRvMaiJG" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --7Fs5Vvo7rRvMaiJG Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Aug 24, 2023 at 05:33:15PM -0700, Peter Geoghegan wrote: > I am in favor of fixing the problem. I don't quite recall what it was > that made the discussion stall last time around. I think that you mean this one: https://www.postgresql.org/message-id/CAH2-WznCscXnWmnj=STC0aSa7QG+BRedDnZsP=Jo_R9GUZvUrg@mail.gmail.com Still that looks entirely different to me. Here we have a problem where the number of free blocks stored may cause an overflow in the internal routine retrieving a free block, but your other thread is about long being not enough on Windows. I surely agree that there's an argument for improving this interface and remove its use of long in the long-term but that would not be backpatched. I also don't see why we cannot do the change proposed here until then, and it's backpatchable. There is a second thread related to logtape.c here, but that's still different: https://www.postgresql.org/message-id/flat/CAH2-Wzn5PCBLUrrds%3DhD439LtWP%2BPD7ekRTd%3D8LdtqJ%2BKO5D1Q%40mail.gmail.com -- Michael --7Fs5Vvo7rRvMaiJG Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmToAXgACgkQnvQgOdby QH2M+hAAi/pui6WPUbw8m08Pnbactjm+pv9TypRy7cD6wcxdmaxbsneNhuPh897H tW4l0L8dfJ+/c4jqIM0CFurhwrJAdRcwTdj5ObqSrDUvHteU+PhrCyCJvec460Kk puVUHXEWv1shIz8KvL8cR5EWfuQHSzQvoNLOUiRMAGfWFY465j2L2gV8MhOmUT7d GrCySt+ErKPF7og5FQZpGprNpKnA4KuTonftHIbV1DN6e511X06dsg+MEtPoPfj3 /IVOhzilX/rg+h/1QN1vFf78UQicUyFyxLEwaZtH5ACo8YGpXuez/QufrSasLTXK oPcLw1Dj1hUvoRt6G826FLe/sYtf5m6zL8smCWn0y/8l96rATtd7a1a7lLj3cpq7 ZBzqBKEUQrOeQ7ZZr9JIFcB56kw+aWxQnqiJehVAdfILfy8Jhttwiawu1oMs7Qfq vEtBywfLU4uIag3D1XBRV2Y0juEtQF++85Kz7BY1It2e2P8ebtXF+HbLaRxio9Wm Z6GDbYBZwa9W4uhcGWjMqu2oU0E9iCzLPAHvUy6BYDOM+PkTuDMenOsc5mbtjHde bK/MM2J5fZ1cvJdDZ/Rn7LbOMWoMSd9CT+CYiah5UcXdoBPTDLHXG//dy5OAoHlc XDmplA3YbjhOQ1IGvqK81CAFwRLRFqmADxxltFmh2EgBCRrcDy4= =C9ld -----END PGP SIGNATURE----- --7Fs5Vvo7rRvMaiJG--