Re: [PHP4BETA] ZTS stuff in main.c
| From: | Zeev Suraski | Date: | Wed, 18 Aug 1999 21:50:31 +0000 |
| Subject: | Re: [PHP4BETA] ZTS stuff in main.c | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-3562@lists.php.net to get a copy of this message | ||
At 22:40 18/08/99 , Thies C. Arntzen wrote:
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,You could be right - we checked TSRM mostly on ISAPI and not he CGI module. We'll take a look at it. Zeev -- Zeev Suraski <zeev@zend.com> http://www.zend.com/ For a PGP public key, finger bourbon@netvision.net.il