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 1vYjo6-00Cpui-2U for pgsql-hackers@arkaria.postgresql.org; Thu, 25 Dec 2025 11:47:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vYjo4-007Ybb-0H for pgsql-hackers@arkaria.postgresql.org; Thu, 25 Dec 2025 11:47:00 +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 1vYjo3-007YbT-2F for pgsql-hackers@lists.postgresql.org; Thu, 25 Dec 2025 11:47:00 +0000 Received: from mout-u-204.mailbox.org ([80.241.59.204]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vYjo0-002hzP-0O for pgsql-hackers@lists.postgresql.org; Thu, 25 Dec 2025 11:47:00 +0000 Received: from smtp102.mailbox.org (smtp102.mailbox.org [IPv6:2001:67c:2050:b231:465::102]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-u-204.mailbox.org (Postfix) with ESMTPS id 4dcRmW4qhtz9tgp; Thu, 25 Dec 2025 12:46:51 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ewie.name; s=MBO0001; t=1766663212; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=p6x5lZIXb8lR7s0pjc1oTorrj61mdEN2V9U6g6BDmSc=; b=BWRTuu5Z6LsnpbAMPatRXwQ2LXgK60o8KEttMOiloOZuzdj4oxzFSY/8yL8gTxs8oqQLfR iq86VyJHzGzvP/zyqpG9M1mK/8SKPB12k72+TrSfKDjodtV3GoQT75A2d+jihnWj9rSGtr J+kEl9CY6vVAPQdb6BetnMu4K3sG7enly77gTBRe2sm0Cl6SfuljJ9gIHUkwILsveENuYy h4YE+H8vL/VmTuwymH7earb2LW2/VXlt9WzqJNFcYAhaW3l2XxDZ/zAYNEvKr17PnxbxCl TjgRnZ7vhDKSpNEwr/zC9E7MaS62Jm5dHYK+sJxGGj/shIGyeNtyEoqu2YuZjg== Authentication-Results: outgoing_mbo_mout; dkim=none; spf=pass (outgoing_mbo_mout: domain of ewie@ewie.name designates 2001:67c:2050:b231:465::102 as permitted sender) smtp.mailfrom=ewie@ewie.name Date: Thu, 25 Dec 2025 12:46:47 +0100 From: Erik Wienhold To: zengman Cc: Michael Paquier , pgsql-hackers , Tom Lane Subject: Re: Regression with large XML data input Message-ID: <89bbd852-eea9-42e8-bab6-bb8df59685de@ewie.name> References: <586b74bb-8941-420f-82c4-ba93e5b42b20@ewie.name> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Rspamd-Queue-Id: 4dcRmW4qhtz9tgp List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2025-12-25 08:29 +0100, zengman wrote: > > The whitespace can be preserved by setting xmlKeepBlanksDefault before > > parsing. See attached v2. That function is deprecated, though. But > > libxml2 uses thread-local globals, so it should be safe. Other than > > that, I see no other way to set XML_PARSE_NOBLANKS with > > xmlParseBalancedChunkMemory. > > > > [1] https://gitlab.gnome.org/GNOME/libxml2/-/blob/408bd0e18e6ddba5d18e51d52da0f7b3ca1b4421/parserInternals.c#L2833 > > Hi everyone, > > I have a small issue that needs resolving. > > My environment: > ``` > postgres@zxm-VMware-Virtual-Platform:~$ uname -i -s -r -v > Linux 6.11.0-29-generic #29-Ubuntu SMP PREEMPT_DYNAMIC Fri Jun 13 20:29:41 UTC 2025 x86_64 > postgres@zxm-VMware-Virtual-Platform:~$ > postgres@zxm-VMware-Virtual-Platform:~$ xml2-config --version > 2.12.7 > ``` > > After setting COPT=-Werror, compilation fails with the following errors (warnings are enforced as errors): > ``` > xml.c: In function ‘xml_parse’: > xml.c:1919:25: error: ‘xmlKeepBlanksDefault’ is deprecated [-Werror=deprecated-declarations] > 1919 | save_keep_blanks = xmlKeepBlanksDefault(preserve_whitespace ? 1 : 0); > | ^~~~~~~~~~~~~~~~ > In file included from xml.c:51: > /usr/include/libxml2/libxml/parser.h:957:17: note: declared here > 957 | xmlKeepBlanksDefault (int val); > | ^~~~~~~~~~~~~~~~~~~~ > xml.c:1943:25: error: ‘xmlKeepBlanksDefault’ is deprecated [-Werror=deprecated-declarations] > 1943 | xmlKeepBlanksDefault(save_keep_blanks); > | ^~~~~~~~~~~~~~~~~~~~ > /usr/include/libxml2/libxml/parser.h:957:17: note: declared here > 957 | xmlKeepBlanksDefault (int val); > | ^~~~~~~~~~~~~~~~~~~~ > xml.c:1956:17: error: ‘xmlKeepBlanksDefault’ is deprecated [-Werror=deprecated-declarations] > 1956 | xmlKeepBlanksDefault(save_keep_blanks); > | ^~~~~~~~~~~~~~~~~~~~ > /usr/include/libxml2/libxml/parser.h:957:17: note: declared here > 957 | xmlKeepBlanksDefault (int val); > | ^~~~~~~~~~~~~~~~~~~~ > cc1: all warnings being treated as errors > ``` > > These deprecation warnings do not impact the test results in any way. > Therefore, I have attached a patch to suppress these specific warnings. The patch works when building with COPT=-Werror. I guess the change is okay since we already make use of -Wno-deprecated-declarations in src/backend/jit/llvm/Makefile: # LLVM 14 produces deprecation warnings. We'll need to make some changes # before the relevant functions are removed, but for now silence the warnings. ifeq ($(GCC), yes) LLVM_CFLAGS += -Wno-deprecated-declarations endif But do we need the same guard for GCC here as well? Alternatively, can you upgrade to libxml2 2.13.3+ which undeprecated xmlKeepBlanksDefault? -- Erik Wienhold