From debian at iam.tj Fri May 5 11:51:05 2023
From: debian at iam.tj (Tj)
Date: Fri, 05 May 2023 11:51:05 +0100
Subject: [xml/sgml-pkgs] Bug#1035554: libxml2-utils: xmllint ignores
--output option and writes to stdout
Message-ID: <168328386578.483978.6162291118594579579.reportbug@localhost>
Package: libxml2-utils
Version: 2.9.10+dfsg-6.7+deb11u4
Severity: normal
Tags: upstream
xmllint is ignoring --output FILE option. I've done a debug run with gdb and it correctly reads the option and assigns its value to the 'output' variable but doesn't read that variable before writing the output. Confirmed with gdb's hardware watch `awatch output`. The final trace before the output is written to stdout is:
3701 if (repeat) {
(gdb) n
3724 nbregister = 0;
(gdb) n
3727 if (stream != 0)
(gdb) n
3731 if (sax) {
(gdb) n
3734 parseAndPrintFile(argv[i], NULL);
$ xmllint --output test.txt --html --xpath '//div[contains(@class, '\''test'\'')]/div/ul/li/a/@href' xmllint-test.html
href="test0.html"
href="test1.html"
href="test2.html"
href="test3.html"
href="test4.html"
href="test5.html"
href="test6.html"
href="test7.html"
href="test8.html"
href="test9.html"
$ cat xmllint-test.html
xmllint test --output
xmllint test --output
-- System Information:
Debian Release: 11.7
APT prefers stable-updates
APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 'stable-debug'), (500, 'proposed-updates-debug'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Versions of packages libxml2-utils depends on:
ii libc6 2.31-13+deb11u6
ii libxml2 2.9.10+dfsg-6.7+deb11u4
libxml2-utils recommends no packages.
libxml2-utils suggests no packages.
From debian at iam.tj Fri May 5 12:59:41 2023
From: debian at iam.tj (Tj)
Date: Fri, 5 May 2023 12:59:41 +0100
Subject: [xml/sgml-pkgs] Bug#1035558: libxml2-utils: xmllint ignores
--output option and writes to stdout
In-Reply-To: <168328386578.483978.6162291118594579579.reportbug@localhost>
Message-ID:
Package: libxml2-utils
I've done some follow-up debugging (on upstream git) to be sure the
problem seems to exist upstream - unless I'm severely misunderstanding
what --output is supposed to do. Anyhow; the trace shows it reaches
doXPathDump(). Note that 'buf' is hard-coded to use stdout. The call to
xmlOutputBufferClose(buf) causes the output to be sent. In gdb I confirm
'output' is set immediately after that:
$ gdb -directory /srv/NAS/Sunny/SourceCode/libxml2/libxml2 -args
/srv/NAS/Sunny/SourceCode/libxml2/libxml2/.libs/xmllint --output
test.txt --html --xpath '//div[contains(@class,
'\''test'\'')]/div/ul/li/a/@href' xmllint-test.html
2038 break;
(gdb) p output
$1 = 0x7fffffffe1d5 "test.txt"
xmllint.c:
static void doXPathDump(xmlXPathObjectPtr cur) {
switch(cur->type) {
case XPATH_NODESET: {
int i;
xmlNodePtr node;
#ifdef LIBXML_OUTPUT_ENABLED
xmlOutputBufferPtr buf;
if ((cur->nodesetval == NULL) || (cur->nodesetval->nodeNr
<= 0)) {
if (!quiet) {
fprintf(stderr, "XPath set is empty\n");
}
break;
}
buf = xmlOutputBufferCreateFile(stdout, NULL);
if (buf == NULL) {
fprintf(stderr, "Out of memory for XPath\n");
progresult = XMLLINT_ERR_MEM;
return;
}
for (i = 0;i < cur->nodesetval->nodeNr;i++) {
node = cur->nodesetval->nodeTab[i];
xmlNodeDumpOutput(buf, NULL, node, 0, 0, NULL);
xmlOutputBufferWrite(buf, 1, "\n");
}
xmlOutputBufferClose(buf);
From debian at iam.tj Fri May 5 15:23:21 2023
From: debian at iam.tj (Tj)
Date: Fri, 5 May 2023 15:23:21 +0100
Subject: [xml/sgml-pkgs] Bug#1035554: libxml2-utils: xmllint ignores
--output option and writes to stdout
In-Reply-To: <168328386578.483978.6162291118594579579.reportbug@localhost>
References: <168328386578.483978.6162291118594579579.reportbug@localhost>
<168328386578.483978.6162291118594579579.reportbug@localhost>
Message-ID: <1e5898f3-e907-5120-7109-9ec3dd38cab7@iam.tj>
I've done some follow-up debugging (on upstream git) to be sure the
problem seems to exist upstream - unless I'm severely misunderstanding
what --output is supposed to do. Anyhow; the trace shows it reaches
doXPathDump(). Note that 'buf' is hard-coded to use stdout. The call to
xmlOutputBufferClose(buf) causes the output to be sent. In gdb I confirm
'output' is set immediately after that:
$ gdb -directory /srv/NAS/Sunny/SourceCode/libxml2/libxml2 -args
/srv/NAS/Sunny/SourceCode/libxml2/libxml2/.libs/xmllint --output
test.txt --html --xpath '//div[contains(@class,
'\''test'\'')]/div/ul/li/a/@href' xmllint-test.html
2038 break;
(gdb) p output
$1 = 0x7fffffffe1d5 "test.txt"
xmllint.c:
static void doXPathDump(xmlXPathObjectPtr cur) {
switch(cur->type) {
case XPATH_NODESET: {
int i;
xmlNodePtr node;
#ifdef LIBXML_OUTPUT_ENABLED
xmlOutputBufferPtr buf;
if ((cur->nodesetval == NULL) || (cur->nodesetval->nodeNr
<= 0)) {
if (!quiet) {
fprintf(stderr, "XPath set is empty\n");
}
break;
}
buf = xmlOutputBufferCreateFile(stdout, NULL);
if (buf == NULL) {
fprintf(stderr, "Out of memory for XPath\n");
progresult = XMLLINT_ERR_MEM;
return;
}
for (i = 0;i < cur->nodesetval->nodeNr;i++) {
node = cur->nodesetval->nodeTab[i];
xmlNodeDumpOutput(buf, NULL, node, 0, 0, NULL);
xmlOutputBufferWrite(buf, 1, "\n");
}
xmlOutputBufferClose(buf);
From debian at iam.tj Fri May 5 15:24:38 2023
From: debian at iam.tj (Tj)
Date: Fri, 5 May 2023 15:24:38 +0100
Subject: [xml/sgml-pkgs] Bug#1035558: Acknowledgement (libxml2-utils:
xmllint ignores --output option and writes to stdout)
In-Reply-To:
References:
Message-ID:
Apologies - email client didn't fill the correct address. This was a
reply to bug #1035554
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1035554
This can be closed!
From noreply at release.debian.org Tue May 9 05:39:14 2023
From: noreply at release.debian.org (Debian testing watch)
Date: Tue, 09 May 2023 04:39:14 +0000
Subject: [xml/sgml-pkgs] xmlroff REMOVED from testing
Message-ID:
FYI: The status of the xmlroff source package
in Debian's testing distribution has changed.
Previous version: 0.6.2-3
Current version: (not in testing)
Hint: Package not in unstable
The script that generates this mail tries to extract removal
reasons from comments in the britney hint files. Those comments
were not originally meant to be machine readable, so if the
reason for removing your package seems to be nonsense, it is
probably the reporting script that got confused. Please check the
actual hints file before you complain about meaningless removals.
--
This email is automatically generated once a day. As the installation of
new packages into testing happens multiple times a day you will receive
later changes on the next day.
See https://release.debian.org/testing-watch/ for more information.