Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:9471 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 46626 invoked by uid 1010); 21 Apr 2004 21:35:49 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 46513 invoked from network); 21 Apr 2004 21:35:48 -0000 Received: from unknown (HELO utopia.in.force-elite.com) (216.255.199.145) by pb1.pair.com with SMTP; 21 Apr 2004 21:35:48 -0000 X-AuthUser: chip@force-elite.com Received: from [172.31.200.1] (206.127.79.51:59012) by utopia.in.force-elite.com with [XMail 1.17 (Linux/Ix86) ESMTP Server] id for from ; Wed, 21 Apr 2004 21:35:45 -0000 To: internals@lists.php.net Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-LNC65xPcQNE0avaSqJ0i" Message-ID: <1082583400.12577.19.camel@powah.cc.force-elite.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Wed, 21 Apr 2004 15:36:40 -0600 Subject: xmlSetGenericErrorFunc Abuse From: chip@force-elite.com (Paul Querna) --=-LNC65xPcQNE0avaSqJ0i Content-Type: text/plain Content-Transfer-Encoding: quoted-printable The libxml2 Extension in PHP5 uses=20 xmlSetGenericErrorFunc(NULL, php_libxml_error_handler); This globally(inside the process) sets the libxml2 error hander to PHP's own function. Why is this bad? It clobbers the processing done by anything else that uses libxml2 in the same process as PHP. For a simple example, I use mod_transform ( http://svn.outoforder.cc/svn/mod_transform ) with Apache 2 as a filter to process XML documents w/ XSLT into HTML. If there are _any_ errors in the transformation PHP attempts to take care of them. This causes Apache to crash because this is not even a PHP request and very quickly the Error Handler will crash when it tries to get a server context. This is not an issue isolated to Apache 2. It could happen in Apache 1.3 if any other module used libxml2. The proper way for PHP to handle this is to not set a Generic Error function, but rather check the return values of libxml2 functions. This is not like the local-mysql vs system-mysql problem that used to be more common. PHP is initializing libxml2 as if it was the only user, which is not always the case. I believe this is something that should be fixed before 5.0 is released. Thanks, Paul Querna --=-LNC65xPcQNE0avaSqJ0i Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQBAhulo94h19kJyHwARAhDuAJ4zsg+IuIzDoqj47tP4MI9Zqvrj3ACgyyAx mzYXHf2HoUK/CnCkpCJrSdU= =l5mk -----END PGP SIGNATURE----- --=-LNC65xPcQNE0avaSqJ0i--