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 1uO5x8-00Erxk-QX for pgsql-bugs@arkaria.postgresql.org; Sun, 08 Jun 2025 02:40:06 +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 1uO5x5-00GN8B-Gd for pgsql-bugs@arkaria.postgresql.org; Sun, 08 Jun 2025 02:40:04 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uO5x5-00GN83-83 for pgsql-bugs@lists.postgresql.org; Sun, 08 Jun 2025 02:40:03 +0000 Received: from fout-a8-smtp.messagingengine.com ([103.168.172.151]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uO5x4-000nqt-0E for pgsql-bugs@lists.postgresql.org; Sun, 08 Jun 2025 02:40:03 +0000 Received: from phl-compute-01.internal (phl-compute-01.phl.internal [10.202.2.41]) by mailfout.phl.internal (Postfix) with ESMTP id 5DB5A138012F; Sat, 7 Jun 2025 22:39:59 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-01.internal (MEProxy); Sat, 07 Jun 2025 22:39:59 -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:subject :subject:to:to; s=fm1; t=1749350399; x=1749436799; bh=QltawdAHkG okBuXAFmggFZ0hXIzuQ6/xsqLwv0Jf5NQ=; b=kQD62i24inRLQr9dzU7Axu8YS2 q7Xye2UJLiWweIOyFTXnTX6EzlcSA7i3ES0LHN6Y3xqjzJpP2xIvDCLfoPFwsa0K p+/OypZjzfV9kyf2wrMSbF81BKFiTRDiAXHFylI+sRc/BDnAxKC63QZa/zfBBuhW PlZFKFJ2MfMcB37pvSQBDEJbQZW8gZNf+g8l92gR15S8aEsNSRHt4X4MmpPDxSCM iPjBGDdfOalPgz6hykP6agL9VEjeZXIVHTaczYEfINHOcKORWtQPfhb2qieVAvEW KCQj4W6VLbkBxT0PWf8RXQgBLvyUBm5K2wWGiSa3N+vmkiRU3VawFGiIgruA== 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:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1749350399; x=1749436799; bh=QltawdAHkGokBuXAFmggFZ0hXIzuQ6/xsqL wv0Jf5NQ=; b=qgl0HKxx7Jv92k+OmYANioBA5BeB6KWUf0EtNY0znq5VqJzlRY7 GLprg5cmJ8aVOdlR7WXg6DN9/NP4hBlIzjSaOmiOEuXPnG9vCEpO4V53+9V+oxCI ICGkQ8mDcXxyqIqmP+/vYH6QSg3GQ84Dk3niYnE/0N9b8YdVgPOYrhnsXvxuTEji EgFyuFHyGp8jMJDRJk2XlN/KqhXXYM5L1raqAmBKJEd8b3uLm/AoAnw1BPKks/2N MfG+eJsUsATVHA3YycWEc2tdDYQrw3njADqyi/SxGV39ineSijstHNDB63xxpquT ZkufM8VpXpBX5vrTaDBxREstLxlruGHjMiA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtddugdejfeekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnegfrhhlucfvnfffucdljedtmdenucfjughrpeffhffvvefukfhf gggtuggjsehgtderredttddvnecuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruc eomhhitghhrggvlhesphgrqhhuihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepteel ieefudffhffhtdetleeggeegfffhkeeuveetiefgudduvedutefggeeivdejnecuvehluh hsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhes phgrqhhuihgvrhdrgiihiidpnhgspghrtghpthhtohepgedpmhhouggvpehsmhhtphhouh htpdhrtghpthhtohepughilhhiphgsrghlrghuthesghhmrghilhdrtghomhdprhgtphht thhopegrrdhkohiihhgvmhihrghkihhnsehpohhsthhgrhgvshhprhhordhruhdprhgtph htthhopehpghhsqhhlqdgsuhhgsheslhhishhtshdrphhoshhtghhrvghsqhhlrdhorhhg pdhrtghpthhtoheprghnthhhohhnihhnrdgsohhnnhgvfhhohiesuggrthgrughoghhhqh drtghomh X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 7 Jun 2025 22:39:56 -0400 (EDT) Date: Sun, 8 Jun 2025 11:39:44 +0900 From: Michael Paquier To: Dilip Kumar Cc: a.kozhemyakin@postgrespro.ru, pgsql-bugs@lists.postgresql.org, Anthonin Bonnefoy Subject: Re: BUG #18947: TRAP: failed Assert("len_to_wrt >= 0") in pg_stat_statements Message-ID: References: <18947-cdd2668beffe02bf@postgresql.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="4tmxXOHQfxRcS+oo" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --4tmxXOHQfxRcS+oo Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sat, Jun 07, 2025 at 10:19:53PM +0530, Dilip Kumar wrote: > I didn't get time to debug, I might look into it tomorrow if someone > doesn't do it before that, but I am able to reproduce the issue and > seems like problem is with respect to computing the quer_loc in below > loop, and due to that 'quer_loc' is becoming bigger than query_len and > hitting the assert. The loop in charge of assigning the constants in the queries needs to be smarter in terms of the new locations assigned to sub-queries, here the VALUES one. 499edb09741b is the origin of the regression, so open item assigned to me (will look into it later), adding Anthonin in CC. -- Michael --4tmxXOHQfxRcS+oo Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmhE9/AACgkQnvQgOdby QH0r+A/8C7pqki6zkVt3dx7YzteVHTGx0jrUA+q/WScktD7ipDaL/FMu3HovAVnk RNYbiHWPaYdbwvHqhYYOBbolwsKwPGmrD7JdFn6bQ65CQmDy5IdgW73iNkPSZmB2 wBcIEzaxujzm8IzXKrVrjHfuL+OlB1+xJJikHqQvZI6QSL4SHrTLI5cebkxF9dk2 4bivG95T+kpbj25PwyjO2GCqF1onXjVaHcEE9I095C24UyBh5vKod1BV9ndYRyCk 2N8WEWJlVeT29Sz6Df1Edv9k3f3TTJQHwCuBFC5zPLgrbAKrk36krslhfPcUlPdC jbiRwU1k9kW+9Sc+y/2yuStMx0Ac+ZRuA0/S57eT2CfKGBg9/D/IPJ/FjsUYzyxv pR6K03xq/knTkpAHo4hfhV0lSF4SwrgdLIx9mARE4menTm/1zH/+r6rnmY+79X9p 85hJY0onzA48O/Algzt4IBXz9bsq2xZ9K1+BTYApjmpdD2s+lYj5oaMTanBMz+GA PfvMjzmDqevgrpoC/FIgP3XXrDYl81L9O72/Cu2bWLBEvbY/ak6Tp6H4bEnMvY9b 2OqNgClbMoXeyJXoqxy6fL+I+Qr7sIhxfjxhNGQcH6Zp7mmlZ07rsmgaMcuohlRX K4Hdt35nPSMOJbpgTH19vtQpypX2PtrAerteMjbollJQ/m6ipGw= =+stb -----END PGP SIGNATURE----- --4tmxXOHQfxRcS+oo--