Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:4247 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 82148 invoked by uid 1010); 29 Aug 2003 16:49:11 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 82101 invoked from network); 29 Aug 2003 16:49:10 -0000 Received: from unknown (HELO jedi.webgate.bg) (212.50.2.189) by pb1.pair.com with SMTP; 29 Aug 2003 16:49:10 -0000 Received: (qmail 20228 invoked from network); 29 Aug 2003 16:47:26 -0000 Received: from nik.office.webgate.bg (HELO andreywin) (192.168.1.22) by jedi.webgate.bg with SMTP; 29 Aug 2003 16:47:26 -0000 Message-ID: <000c01c36e4d$7b7c0b90$1601a8c0@andreywin> To: "Robert Cummings" Cc: References: <001501c36e2f$db614890$1601a8c0@andreywin> <1062174412.417.42.camel@blobule.suds> Date: Fri, 29 Aug 2003 19:49:06 +0300 MIME-Version: 1.0 Content-Type: text/plain; charset="windows-1251" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2720.3000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Subject: Re: [PHP-DEV] Shared module problems (core dumps) (under apache 1.3) From: andrey@php.net ("Andrey Hristov") Yes, it serves me well now. However this is a way to workaround the problem. An the problem exists and I want to hear from core experts (the best will be if Zeev or Andi) tell their opinion. I am concerned about this problem. Cheers, Andrey ----- Original Message ----- From: "Robert Cummings" To: "Andrey Hristov" Cc: Sent: Friday, August 29, 2003 7:26 PM Subject: Re: [PHP-DEV] Shared module problems (core dumps) (under apache 1.3) > The extension_loaded() function might serve you better than > class_exists(). > > http://www.php.net/manual/en/function.extension-loaded.php > > Cheers, > Rob. > > > On Fri, 2003-08-29 at 09:17, Andrey Hristov wrote: > > Hi, > > till today I had a big problem with my Apache 1.3 segfaulting when I try to > > instantiate from a class. The class is declared in a C extesion (named > > xml_parser.so, class name WebgateXMLParser). Few week after the > > implementation it worked well since I just loaded the extension with dl() : > > dl('xml_parser.so'). > > At some point I decided to include a check whether the module is loaded > > (compiled statically) and in this case not to dl() it. Just around the time > > I > > implemented (in PHP) this check my Apache/PHP started to core. Sadly > > I found the reason just today. > > My check is this : > > if (!class_exists('WebgateXmlParser')) { // if it's built into the PHP > > binary don't load > > dl('xml_parser.so'); > > }// if > > What happens? After the request is finished the module is unloaded - this > > can easily be seen just > > by doing a var_dump(get_loaded_extensions()); before the "if". However > > PHP/Zend still thinks that > > there is WebgateXmlParser class. Briefly : Zend DOES NOT unregister classes > > on module unload. > > Now you may imagine what happens when the extension is not loaded since Zend > > Engine thinks that > > the class exists (but it does not) and the code tries to instantiate an > > object of the class - core dump. > > > > IMO IT IS a bug that the class entries are not unregistered when the module > > is unloaded after the request. I have not tried this but the same error may > > apply to functions exported by a C extension and thus leading > > to the same effect - crashes that are hard to explain. > > > > > > > > Regards, > > Andrey > > > > P.S. > > Yes, there is a workaround for my case : to check whether the module is > > loaded but not checking whether the class exists. > > > > -- > > PHP Internals - PHP Runtime Development Mailing List > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > -- > .---------------------------------------------. > | Worlds of Carnage - http://www.wocmud.org | > :---------------------------------------------: > | Come visit a world of myth and legend where | > | fantastical creatures come to life and the | > | stuff of nightmares grasp for your soul. | > `---------------------------------------------' > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > >