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.96) (envelope-from ) id 1w638J-003ti1-1f for pgsql-bugs@arkaria.postgresql.org; Fri, 27 Mar 2026 09:05:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w638I-008fgR-07 for pgsql-bugs@arkaria.postgresql.org; Fri, 27 Mar 2026 09:05:34 +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.96) (envelope-from ) id 1w638H-008fgJ-2Z for pgsql-bugs@lists.postgresql.org; Fri, 27 Mar 2026 09:05:34 +0000 Received: from smtp.outgoing.loopia.se ([93.188.3.37]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1w638F-00000001Rvx-391R for pgsql-bugs@lists.postgresql.org; Fri, 27 Mar 2026 09:05:33 +0000 Received: from s807.loopia.se (localhost [127.0.0.1]) by s807.loopia.se (Postfix) with ESMTP id 8C8F0577FC4 for ; Fri, 27 Mar 2026 10:05:31 +0100 (CET) Received: from s981.loopia.se (unknown [172.22.191.6]) by s807.loopia.se (Postfix) with ESMTP id 7E4725784A3; Fri, 27 Mar 2026 10:05:31 +0100 (CET) Received: from localhost (unknown [172.22.191.6]) by s981.loopia.se (Postfix) with ESMTP id 70CCD22B17C8; Fri, 27 Mar 2026 10:05:31 +0100 (CET) X-Virus-Scanned: amavis at amavis.loopia.se X-Spam-Flag: NO X-Spam-Score: -1.2 X-Spam-Level: X-Spam-Status: No, score=-1.2 tagged_above=-999 required=6.2 tests=[ALL_TRUSTED=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1] autolearn=disabled Authentication-Results: s474.loopia.se (amavis); dkim=pass (2048-bit key) header.d=yesql.se Received: from s934.loopia.se ([172.22.191.5]) by localhost (s474.loopia.se [172.22.190.14]) (amavis, port 10024) with LMTP id VCQ7tjGEmMz6; Fri, 27 Mar 2026 10:05:31 +0100 (CET) X-Loopia-Auth: user X-Loopia-User: daniel@yesql.se X-Loopia-Originating-IP: 89.255.232.236 Received: from smtpclient.apple (customer-89-255-232-236.stosn.net [89.255.232.236]) (Authenticated sender: daniel@yesql.se) by s934.loopia.se (Postfix) with ESMTPSA id E62A67CEA8C; Fri, 27 Mar 2026 10:05:30 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yesql.se; s=loopiadkim1707475645; t=1774602331; bh=XRw9iHy84DOf2SdkpB412z0Xd3ML11WJ5HJmJ/AhlJA=; h=Subject:From:In-Reply-To:Date:Cc:References:To; b=RwOxAr1Xy3WP6/qhyGHY4TUxfJQ/l4evtpppHqC5OA50+WQEIyMnY4CJYty/wMMpH CvdvvOJ/3QxK9Fc9eDcu8lpxFAbo8t/u9El1e4ZPCdt7K1LTMG9P8QPLg24ivZccOw HeEqHOw7JJVnrt77CS0OSdeymLtRl38Sb+MmL7aKoEGdHZuAcEBiCWdXo3W1rAynz3 1jLr6Pa9wxhldCI3xCvYkHxYxSTlFbi5Tl7N/2YpwjjRvGh1OwJ84NbalU1pJm7cNW AtNSmDUx7yAfRwH9xHZSPwX7zF2cqmxhqb7lIxCO+jEtYau4BhQF2Q21jRuZJccT7n 7fUlXMp1Ti9XQ== Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3776.700.51.11.2\)) Subject: Re: Memory leak in pg_stat_statements when qtext file contains invalid encoding From: Daniel Gustafsson In-Reply-To: <178e0d90-26d9-4c3a-9448-2f64f0d35dc8@iki.fi> Date: Fri, 27 Mar 2026 10:05:18 +0100 Cc: Lukas Fittl , Gaurav Singh , pgsql-bugs@lists.postgresql.org Content-Transfer-Encoding: quoted-printable Message-Id: <56D5EAF1-1636-45EC-97FB-3A08260417D2@yesql.se> References: <178e0d90-26d9-4c3a-9448-2f64f0d35dc8@iki.fi> To: Heikki Linnakangas X-Mailer: Apple Mail (2.3776.700.51.11.2) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On 27 Mar 2026, at 09:59, Heikki Linnakangas wrote: > Hmm, perhaps. But there's a simpler, less invasive fix. When that code = was written, we didn't have MCXT_ALLOC_HUGE nor MCXT_ALLOC_NO_OOM. Now = that we do, we can just use palloc_extended(MCXT_ALLOC_HUGE | = MCXT_ALLOC_NO_OOM) instead of raw malloc(). Per attached. LGTM. -- Daniel Gustafsson