Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:22503 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 1448 invoked by uid 1010); 17 Mar 2006 11:52:26 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 1433 invoked from network); 17 Mar 2006 11:52:26 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Mar 2006 11:52:26 -0000 X-Host-Fingerprint: 216.117.147.250 unknown Linux 2.4/2.6 Received: from ([216.117.147.250:58480] helo=ctindustries.net) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 05/BE-55982-9F2AA144 for ; Fri, 17 Mar 2006 06:52:26 -0500 Received: from [127.0.0.1] (dsta-aa203.pivot.net [66.186.171.203]) (authenticated bits=0) by ctindustries.net (8.12.8/8.12.8) with ESMTP id k2HAcq3w010536; Fri, 17 Mar 2006 05:38:53 -0500 Message-ID: <441AA4FB.9000209@ctindustries.net> Date: Fri, 17 Mar 2006 07:00:59 -0500 User-Agent: Thunderbird 1.5 (Windows/20051201) MIME-Version: 1.0 To: Dmitry Stogov CC: Wez Furlong , internals@lists.php.net References: <000001c649b6$8668abc0$6e02a8c0@thinkpad> In-Reply-To: <000001c649b6$8668abc0$6e02a8c0@thinkpad> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Antivirus: avast! (VPS 0611-1, 03/16/2006), Outbound message X-Antivirus-Status: Clean X-Virus-Scanned: ClamAV 0.88/1335/Wed Mar 15 23:58:43 2006 on ctindustries.net X-Virus-Status: Clean Subject: Re: [PHP-DEV] Problem with ext/libxml RINIT/RSHUTDOWN From: rrichards@ctindustries.net (Rob Richards) Dmitry Stogov wrote: > Hi Wez, > > I found a bad code in ext/libxml. > > On each request startup/shutdown it changing some libxml callbacks. > At first this slowdown each request, at second multi-threaded PHP may fail, > because different threads may set/clean the same callbacks in the same time. > > May be it is possible to setup these callbacks forever in MINIT/MSHUTDOWN, > set some flag (somthing like LIBXML(in_request)) in RINIT/RSHUTDOWN, and > check it in callbacks. > Which ones in particular? Each of the callbacks being utilized are thread safe. The reason why they need to be set per request is in order to play nice with any other modules that might be loaded and use libxml2. for example: prior to how the current callbacks are implemented it was possible to blow away PHP stream usage by any of the xml extensions using mod_perl and its xsl module (could do this whether or not PHP was running threaded). There are also many other ways to screw with the libxml2 globals and effect PHP extensions based on libxml2 as well using other modules so the only way to protect them is on each request. In short putting them into the MINIT/MSHUTDOWN will open security holes. Rob