Re: [PHP4BETA] ZTS stuff in main.c

From: Date: Wed, 18 Aug 1999 20:40:36 +0000
Subject: Re: [PHP4BETA] ZTS stuff in main.c
References: 1  Groups: php.version4 
Request: Send a blank email to php-version4+get-3561@lists.php.net to get a copy of this message
On Wed, 18 Aug 1999, Zeev Suraski wrote: > It's ok actually. The TSRM layer must be initialized before zend_startup() > is called, and has nothing to do with zend_startup(). You'd notice that > both the CGI main.c and ISAPI's php4isapi.c call tsrm_startup() right in > the very beginning, before calling the module startup. The reason for this > is simple - you may want to use globals before the PHP callback is called, > in places like DllMain(). zeev, - unless i'm overseeing something - you are wrong - or at least the cgi_main.c has a bug. i spend some time in gdb today (trying to get ZTS compiled on linux). if i try to compile php/ZTS as executable (ok, doesn't make much sense, but it's nice for debugging) - and start it the following happens: 1st resource gets allocated (sapi_globals) id is 0 - php_module_startup gets called and does a ELS_FETCH() executor_globals_id is still 0 (inited by the compiler) and the ELS_FETCH() loads the sapi_globals into executor_globals - few lines later (still in php_module_startup and *before* we call zend_startup - which would create the *real* executor_globals) we do a EG(error_reporting) = E_ALL & ~E_NOTICE; which writes into our sapi_globals -> which is wrong. please correct me if i'm wrong, tc > > Zeev > > At 19:10 18/08/99 , Thies C. Arntzen wrote: > > >in php_module_startup() > > > >we do a ELS_FETCH(); before zend_startup(..) is called - which is bad > >'cause the executor_globals are allocated in zend_startup. > > > >i'm not deep enough in that (yet) - zeev, andi what shall i do? > > > >tc > > > > > >Thies C. Arntzen "One Big-Mac, Small Fries and a Coke!" > >Digital Collections Phone +49 40 235350 Fax +49 40 23535180 > >Hammerbrookstr. 93 20097 Hamburg / Germany > > > > > >-- > >PHP 4 Beta > > -- > Zeev Suraski <zeev@zend.com> http://www.zend.com/ > For a PGP public key, finger bourbon@netvision.net.il > > Thies C. Arntzen "One Big-Mac, Small Fries and a Coke!" Digital Collections Phone +49 40 235350 Fax +49 40 23535180 Hammerbrookstr. 93 20097 Hamburg / Germany

« previous php.version4 (#3561) next »