[questing] [autopkgtest] Apache2 2.4.63-1ubuntu2 fails d/perl-framework test suites, thus fails autopkgtests

Bug #2112429 reported by Thomas Ward
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
apache2 (Ubuntu)
Status tracked in Questing
Questing
Fix Released
High
Thomas Ward

Bug Description

Discovered through update_excuses and confirmed locally in an LXD autopkgtest container (from https://github.com/canonical/ubuntu-maintainers-handbook/blob/main/PackageTests.md to create it), the autopkgtests on 2.4.63-1ubuntu2 fail for apache2's test suite.

It fails on debian/perl-framework/t/apache/pr64339.t, test #12 which makes sure certain content is rendered by xml2enc's backend components.

I followed every single step and reproduced in a pure LXD container with the apache2 binaries in proposed.

With this in mind, the following is the specific items in the test at fault:

EXPECTED: response from looking at http://localhost:8529/modules/xml2enc/front/doc.isohtml with a GET call is "<html><body><p>fóó\n</p></body></html>" and is UTF-8 encoded

ACTUAL: response from looking at http://localhost:8529/modules/xml2enc/front/doc.isohtml with a GET call is "<html><body>fóó\n</body></html>"

There is a changelog that introduces this test via a pull request:
  *) mod_xml2enc: Update check to accept any text/ media type
     or any XML media type per RFC 7303, avoiding
     corruption of Microsoft OOXML formats. PR 64339.
     [Joseph Heenan joseph.heenan fintechlabs.io, Joe Orton]

... in 2.4.59 in April 2024. At the time the test was written, Apache was using libxml2 and the 2.12 branch.

After examining the Apache code (modules/filters/mod_xml2enc.c), it calls htmlParser which is part of libxml2.

Using HTMLParser from python3-lxml (which is libxml2 wrappings for Python), I went through the decoding process of perl-framework/t/htdocs/modules/xml2enc/doc.isohtml which is what is used during the test suite during t/apache/pr64339.t, I was able to determine that libxml2's parser outputs the value observed in teh failing test - namely "<html><body>fóó\n</body></html>" - which indicates this is a libxml2 change.

I am unsure where the Ubuntu packaging gets its debian/perl-framework for its tests, but as this seems to be a libxml2 change, we can either modify debian/perl-framework/t/apache/pr64339.t to adjust its output, or look for an updated set of Apache2's test suites and perl-framework.

---

ProblemType: Bug
DistroRelease: Ubuntu 25.10
Package: apache2 2.4.63-1ubuntu2
ProcVersionSignature: Ubuntu 6.11.0-26.26~24.04.1-generic 6.11.11
Uname: Linux 6.11.0-26-generic x86_64
Apache2ConfdDirListing: False
Apache2Modules:
 AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 10.73.1.36. Set the 'ServerName' directive globally to suppress this message
 httpd (pid 2813) already running
ApportVersion: 2.32.0-0ubuntu5
Architecture: amd64
CasperMD5CheckResult: unknown
CloudArchitecture: x86_64
CloudBuildName: server
CloudID: lxd
CloudName: lxd
CloudPlatform: lxd
CloudSerial: 20250528
CloudSubPlatform: LXD socket API v. 1.0 (/dev/lxd/sock)
Date: Wed Jun 4 01:37:25 2025
ProcEnviron:
 LANG=C.UTF-8
 PATH=(custom, no user)
 TERM=xterm-256color
SourcePackage: apache2
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Thomas Ward (teward) wrote :
Thomas Ward (teward)
description: updated
summary: - [questing] [autopkgtest] Apache2 2.4.63-1ubuntu2 fails its own test
- suite
+ [questing] [autopkgtest] Apache2 2.4.63-1ubuntu2 fails d/perl-framework
+ test suites
Thomas Ward (teward)
summary: [questing] [autopkgtest] Apache2 2.4.63-1ubuntu2 fails d/perl-framework
- test suites
+ test suites, thus fails autopkgtests
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

I believe it comes from https://httpd.apache.org/test/

svn checkout http://svn.apache.org/repos/asf/httpd/test/framework/trunk/ httpd-framework

And there is this interesting commit:
"""
r1925450 | jorton | 2025-05-07 04:11:17 -0300 (Wed, 07 May 2025) | 5 lines

Be more flexible about HTML body content since libxml2 behaviour
has changed across versions.

See: https://lists.apache.org/thread/1gzcqm2mo4osrc8vvc0j6jmx8q70plvf
"""

Which corresponds to:
$ svn diff -c 1925450
Index: t/apache/pr64339.t
===================================================================
--- t/apache/pr64339.t (revision 1925449)
+++ t/apache/pr64339.t (revision 1925450)
@@ -18,7 +18,7 @@
     ['/doc.notxml', "application/notreallyxml", "f\xf3\xf3\n" ],

     # Sent with charset=ISO-8859-1 - should be transformed to utf-8
- ['/doc.isohtml', "text/html;charset=utf-8", "<html><body><p>fóó\n</p></body></html>" ],
+ ['/doc.isohtml', "text/html;charset=utf-8", "<html><body>.*fóó\n.*</body></html>" ],
 );

 # mod_xml2enc on trunk behaves quite differently to the 2.4.x version
@@ -42,5 +42,5 @@

     ok t_cmp($r->code, 200, "fetching ".$t->[0]);
     ok t_cmp($r->header('Content-Type'), $t->[1], "content-type header test for ".$t->[0]);
- ok t_cmp($r->content, $t->[2], "content test for ".$t->[0]);
+ ok t_cmp($r->content, qr/$t->[2]/, "content test for ".$t->[0]);
 }

tags: added: bite-size
Thomas Ward (teward)
Changed in apache2 (Ubuntu Questing):
assignee: nobody → Thomas Ward (teward)
Revision history for this message
Thomas Ward (teward) wrote :

Andreas:

Would it be prudent to just update the entire test suite and pull that in as an update and then patch the source of apache2 via the commit? While we're here I mean since we can get any other newer tests etc. made available in the test suite.

Thomas Ward (teward)
Changed in apache2 (Ubuntu Questing):
status: New → In Progress
importance: Undecided → High
Revision history for this message
Andreas Hasenack (ahasenack) wrote (last edit ):

According to d/changelog, debian every now and then updates it. If we update the whole thing now, that will be a big delta. I would just patch it with that fix, and file a bug with debian, since they have the same libxml2 in experimental and are bound to hit this issue as well sometime in the future.

Revision history for this message
Thomas Ward (teward) wrote :

Uploaded a fix to Questing. Accepted into the system for building. This should fix the autopkgtests of apache2 against itself. There are probably still other autopkgtests that'll fail.

Changed in apache2 (Ubuntu Questing):
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package apache2 - 2.4.63-1ubuntu3

---------------
apache2 (2.4.63-1ubuntu3) questing; urgency=medium

  * d/perl-framework/t/apache/pr64339.t: Fix tests per upstream testsuite
    revisions to address changes in libxml2 changes. (LP: #2112429)

 -- Thomas Ward <email address hidden> Wed, 04 Jun 2025 17:23:41 -0400

Changed in apache2 (Ubuntu Questing):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.