Skip to content

Avoid libxml2 versions 2.9.11 and 2.9.12 in Windows builds #11089

@stronk7

Description

@stronk7

Description

There is an impacting bug in libxml2 libraries versions 2.9.11 and 2.9.12. It was fixed for version 2.9.13 (and older versions weren't affected either.

This is the issue: https://gitlab.gnome.org/GNOME/libxml2/-/issues/264
This is the fix (showing 2.9.13 as fixed version): https://gitlab.gnome.org/GNOME/libxml2/-/commit/3e1aad4fe584747fd7d17cc7b2863a78e2d21a77

While I've seen that neither Mac (macports), Ubuntu or the "official" PHP docker images are using those 2 buggy versions, it seems that, actually, at very least the Windows PHP 8.1 builds are using problematic libxml2 version 2.9.12. Just downloaded it from php.net and got:

$ php --re libxml
Extension [ <persistent> extension #20 libxml version 8.1.17 ] {

  - Constants [27] {
    Constant [ int LIBXML_VERSION ] { 20912 }
    Constant [ string LIBXML_DOTTED_VERSION ] { 2.9.12 }
    Constant [ string LIBXML_LOADED_VERSION ] { 20912 }
...
...

The issue reported above is really impacting and it makes PHP to emit a warning and fail to apply (relatively) complex XPath expressions that normally should work ok.

Warning: DOMXPath::query(): Recursion limit exceeded

I'm afraid it's not easy for me to provide a simple example, but we have a good number of Behat tests that are failing because of complex pages having complex XPaths to resolve. And they are only failing with the PHP 8.1 Windows build.

I've here old PHP 8.0 Windows build (using libxml2 2.9.10), Macs (using libxml2 2.10.0), various linux machines (2.9.13) and all them are passing ok.

Internally we are tracking the problem @ https://tracker.moodle.org/browse/MDL-73080

Ciao :-)

PHP Version

PHP 8.1.17

Operating System

Windows 10

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions