Hello,
I try to run maintenance/update.php. It always fails with this error:
Your system has a combination of PHP and libxml2 versions which is buggy and can cause hidden data corruption in MediaWiki and other web apps. Upgrade to PHP 5.2.9 or later and libxml2 2.7.3 or later! ABORTING (see http://bugs.php.net/bug.php?id=45996).
But my versions are quite new:
# php -v PHP 5.3.8 (cli) (built: Dec 7 2011 21:07:33) Copyright (c) 1997-2011 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies
and:
# ldd `which php`|grep xml2 libxml2.so.2 => /opt/ts/lib/libxml2.so.2
# ls -l /opt/ts/lib/libxml2.so.2 lrwxrwxrwx 1 root root 16 Dec 9 2010 /opt/ts/lib/libxml2.so.2 -> libxml2.so.2.7.8
Do you have any ideas what else could cause this output? Is it possible that PhpXmlBugTester() is not working simply because a PHP compile time option is not enabled?
Cheers Marlen
On Fri, Dec 9, 2011 at 5:36 AM, Marlen Caemmerer caemmerer@monoro.dewrote:
Hello,
I try to run maintenance/update.php. It always fails with this error:
Your system has a combination of PHP and libxml2 versions which is buggy and can cause hidden data corruption in MediaWiki and other web apps. Upgrade to PHP 5.2.9 or later and libxml2 2.7.3 or later! ABORTING (see http://bugs.php.net/bug.php?id=45996).
But my versions are quite new:
A number of folks on that PHP bug report have indicating seeing this bug even with newer versions of libxml2 etc; I don't know whether this is due to some deeper bug, or weird configurations where it didn't actually fully update or if some library version is embedded or what. :(
Just to make sure it's failing the way we expect, try this test script: <?php
class PhpXmlBugTester { private $parsedData = ''; public $ok = false; public function __construct() { $charData = '<b>c</b>'; $xml = '<a>' . htmlspecialchars( $charData ) . '</a>';
$parser = xml_parser_create(); xml_set_character_data_handler( $parser, array( $this, 'chardata' ) ); $parsedOk = xml_parse( $parser, $xml, true ); $this->ok = $parsedOk && ( $this->parsedData == $charData ); print "<pre>\n"; print "Got: " . htmlspecialchars($this->parsedData) . "\n"; print "Expected: " . htmlspecialchars($charData) . "\n"; print "</pre>\n"; } public function chardata( $parser, $data ) { $this->parsedData .= $data; } }
$a = new PhpXmlBugTester(); ?>
It should show:
Got: <b>c</b> Expected: <b>c</b>
if all is well.
If it shows "Got: bcb" then I believe that's an example of this particular bug. If it says something else, that's interesting. :)
-- brion
On Fri, 9 Dec 2011, Brion Vibber wrote:
Your system has a combination of PHP and libxml2 versions which is buggy and can cause hidden data corruption in MediaWiki and other web apps. Upgrade to PHP 5.2.9 or later and libxml2 2.7.3 or later! ABORTING (see http://bugs.php.net/bug.php?id=45996).
But my versions are quite new:
<?php class PhpXmlBugTester { private $parsedData = ''; public $ok = false; public function __construct() { $charData = '<b>c</b>'; $xml = '<a>' . htmlspecialchars( $charData ) . '</a>'; $parser = xml_parser_create(); xml_set_character_data_handler( $parser, array( $this, 'chardata' ) ); $parsedOk = xml_parse( $parser, $xml, true ); $this->ok = $parsedOk && ( $this->parsedData == $charData ); print "<pre>\n"; print "Got: " . htmlspecialchars($this->parsedData) . "\n"; print "Expected: " . htmlspecialchars($charData) . "\n"; print "</pre>\n"; } public function chardata( $parser, $data ) { $this->parsedData .= $data; } } $a = new PhpXmlBugTester(); ?>
It should show:
Got: <b>c</b> Expected: <b>c</b>
if all is well.
If it shows "Got: bcb" then I believe that's an example of this particular
Funny, the result is:
<pre> Got: bc/b Expected: <b>c</b> </pre>
Cheers, Marlen
On Fri, Dec 9, 2011 at 10:34 AM, Marlen Caemmerer caemmerer@monoro.dewrote:
On Fri, 9 Dec 2011, Brion Vibber wrote:
Your system has a combination of PHP and libxml2 versions which is buggy and can cause hidden data corruption in MediaWiki and other web apps. Upgrade to PHP 5.2.9 or later and libxml2 2.7.3 or later! ABORTING (see http://bugs.php.net/bug.php?id=45996).
Funny, the result is:
<pre> Got: bc/b Expected: <b>c</b> </pre>
Running on command-line that looks like you are indeed seeing the bug in its original form. (I forgot the / comes through too.) The htmlspecialchars() there escapes the < and > for HTML output, so that's why they come through as < and >
-- brion
mediawiki-l@lists.wikimedia.org