This is something that the engine should be aware of, perhaps by encoding it as an attribute in the module structure. I'll be looking into this for PHP 5 while looking at the dependency stuff that came up in the last couple of days, sometime over the weekend.
In the meantime, your patch looks "good" in that it should work and doesn't do anything particularly wrong, even if it is ugly :-) --Wez. ----- Original Message ----- From: "Ard Biesheuvel" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, January 20, 2004 11:04 PM Subject: [PHP-DEV] Re: #26968 [Fbk->Asn]: Segmentation fault > I've come up with a rather ugly workaround for this bug, but it does > work and it only touches interbase.c. > > It basically works in the following way: > - the module refuses to be loaded by dl() [MODULE_TEMPORARY], so > only loading from php.ini is allowed [MODULE_PERSISTENT], > - the module NULLs its dlopen() handle in its shutdown phase, so > module_destructor() will not dlclose() it. > > Feedback, anyone ? > > -- > Ard > > ---------------------------------------------------------------------------- ---- > Index: interbase.c > =================================================================== > RCS file: /repository/php-src/ext/interbase/interbase.c,v > retrieving revision 1.91.2.27 > diff -u -r1.91.2.27 interbase.c > --- interbase.c 7 Jan 2004 09:44:21 -0000 1.91.2.27 > +++ interbase.c 20 Jan 2004 22:58:57 -0000 > @@ -536,6 +536,12 @@ > > PHP_MINIT_FUNCTION(ibase) > { > + if (type == MODULE_TEMPORARY) > + { > + _php_ibase_module_error("Per request loading not supported by this module. Try loading it from php.ini instead"); > + return FAILURE; > + } > + > ZEND_INIT_MODULE_GLOBALS(ibase, php_ibase_init_globals, NULL); > > REGISTER_INI_ENTRIES(); > @@ -594,6 +600,12 @@ > > PHP_MSHUTDOWN_FUNCTION(ibase) > { > + zend_module_entry *ibase_entry; > + if (SUCCESS == zend_hash_find(&module_registry, ibase_module_entry.name, strlen(ibase_module_entry.name) +1, (void*) &ibase_entry)) > + { > + ibase_entry->handle = NULL; > + } > + > UNREGISTER_INI_ENTRIES(); > return SUCCESS; > } > > ---------------------------------------------------------------------------- ---- > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php