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 1ml58c-0004AG-W9 for pgsql-bugs@arkaria.postgresql.org; Thu, 11 Nov 2021 08:08:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ml58b-0003Ib-Ql for pgsql-bugs@arkaria.postgresql.org; Thu, 11 Nov 2021 08:08:49 +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 1ml58a-0003IS-Fp for pgsql-bugs@lists.postgresql.org; Thu, 11 Nov 2021 08:08:49 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ml58V-0007gH-LI for pgsql-bugs@lists.postgresql.org; Thu, 11 Nov 2021 08:08:47 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 08CA35C0135; Thu, 11 Nov 2021 03:08:41 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Thu, 11 Nov 2021 03:08:41 -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=gt33RBkzMFY8+kpuINxOUmZVHda yZ8UcUEA1KikaxIA=; b=GiiEpHz94JDyKcW1HHXXP0MwuzcjD1lUumCV5qTsYZD 6QIy9P2Y63f+LuVqAKN8KhmEoJ1c6lc+EHdLzuy4r9r19qQ/GSaq4eJNsOujsZRN SPZQUw3eHOUdm0qE0Z22atN9lsuVavsXCtXJYEO0ba8zsEoRR04dYimH62SwfRza O11t4u1afc8qbGFaAmh/N9Os38Fna4dqU3NgDG+QZVbwV/HWi4586DmI5yE3OsmJ vjWxUo+K7WkP9uodtX0MvnA6QQ+IuOGMkjehcXCFffowKs5b2UPS2mziRQH9vrnX fa5/4fl6xB4GPFi9CDUtMIgbBfBtcUxW7LH7wfJQDFQ== 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=gt33RB kzMFY8+kpuINxOUmZVHdayZ8UcUEA1KikaxIA=; b=A95raVqXp3I/R9REz4i5Rc T3XVZ+ydv5e+8oJ3R5Iv1Au/vSZOeTsfPYhpWAR1N9qDBtbdcNeSJZXY+JJcLm2K mPww+diak0NMtd5j9D5FN5GuND8wrcj3OIy1wZAgyDDeFvICGuLBwMDu2WMd2AZo ozXmOGelPHXNSscSvQNreAQVApedoog9dAZniehNADyohUcueu9kk51XGHolCW3x gpNsC2UwcDQ6ABF1XavxtudUrzsCycMhtCT/NXUd9L3ais3emqVw6Wq6PvbNYKCI caa8Mq1vRGA7amh5s5QtgJrBvtDK8ZNOoTYBsh2o6akb0GLS0iqh84Q3S6yggN8w == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrvddtgdduudduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucgfrhhlucfvnfffucdljedtmdenucfjughrpeffhf fvuffkfhggtggujgesghdtreertddtvdenucfhrhhomhepofhitghhrggvlhcurfgrqhhu ihgvrhcuoehmihgthhgrvghlsehprghquhhivghrrdighiiiqeenucggtffrrghtthgvrh hnpedvgeduuefhtdeuleettdevjeehheeiveeuieegleetgeeljeelieeuieehgeevhfen ucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmihgthh grvghlsehprghquhhivghrrdighiii X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 11 Nov 2021 03:08:37 -0500 (EST) Date: Thu, 11 Nov 2021 17:08:34 +0900 From: Michael Paquier To: Kyotaro Horiguchi Cc: a.kozhemyakin@postgrespro.ru, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #17280: global-buffer-overflow on select from pg_stat_slru Message-ID: References: <17280-37da556e86032070@postgresql.org> <20211111.103923.2138998724021170559.horikyota.ntt@gmail.com> <20211111.121909.1128935906296628969.horikyota.ntt@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="C3gyjxWXq0iJ9JOC" Content-Disposition: inline In-Reply-To: <20211111.121909.1128935906296628969.horikyota.ntt@gmail.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --C3gyjxWXq0iJ9JOC Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Nov 11, 2021 at 12:19:09PM +0900, Kyotaro Horiguchi wrote: > I'm not sure which is easier to read, but it might be a bit hard since > the conditino term in not mention counter itself. I don't object to > that way. And, yes SLRU_NUM_ELEMENTS cannot be used here:p >=20 > The attached is the first way in the choices. That looks fine. Also, what do you think about adding a test in sysviews.sql? This could be as simple as that: SELECT count(*) > 0 AS ok FROM pg_stat_slru; I am not sure if the buildfarm animals running valgrind would have caught this issue, but having something would be better than nothing for this case. -- Michael --C3gyjxWXq0iJ9JOC Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmGMz4IACgkQnvQgOdby QH0sJQ//UxpjMIyUcRjtG863q1xnatynJJ+oSks/TjajnK1G3x+cV1PGDDQlZ8Z1 10oH0grvlWgKPsws8wiZfiXUDB6m771Fxpin8YmSUfNhSiwKHiKELWaWB4sJ1rE9 G0bOs2XMCGmbVC4LM7n+gieJyD/qwYCgTLrO6RTfOfcB+Brmh5TXHxolvs+O7gK/ GorezX6lp9j/aPXagpeRU6wDkgkuupmuraOEcjVNvm3jSxz6GkzMHq71sr/ow/0T RlNGIOQVXLLINkGR+KwFahzPOGk/xE0zcHNhXOHoAma+732DMxfIML+JQqEco1jG 2imdRPDNu+qE8ho7O3Zkzn/zzW9Ck8fkaNYTJwUlVXXG4dZch27UpQERlGUqCt0q 01tCUyW+XmiQVwj1iCFkm3bOKjxQZfFGcdvrgJ/6aHat2H+W00+86yfigR9dpEhk AmBDeoWM+SzAIxU3sUVmSuRpxVRo29sxNeA9jXkgs6GmJ3e5AlltBrA8jjK2hcX+ v4DxOqFAV/iESfITtj+41ni2xfQfg+OytfQ6ZOGMYOq9Bcw3XSjFWPlikMCap31C Vl3L+Noos1/CMDA5ClXXsCoaaa+Y9MOsPEZDWGnSB8kNA12zvT9jNdQ33lUSQE1N NUrz931doAtduuaYJ0p5x9pDinj1EVSTl4D6Q9lY5sKGig3r2Ng= =U+8Z -----END PGP SIGNATURE----- --C3gyjxWXq0iJ9JOC--