Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:31494 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 19997 invoked by uid 1010); 8 Aug 2007 19:13:58 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 19982 invoked from network); 8 Aug 2007 19:13:57 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Aug 2007 19:13:57 -0000 Authentication-Results: pb1.pair.com header.from=stas@zend.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=stas@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 63.205.162.114 as permitted sender) X-PHP-List-Original-Sender: stas@zend.com X-Host-Fingerprint: 63.205.162.114 unknown Windows 2000 SP4, XP SP1 Received: from [63.205.162.114] ([63.205.162.114:61858] helo=us-ex1.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 1F/86-06402-4F51AB64 for ; Wed, 08 Aug 2007 15:13:57 -0400 Received: from [127.0.0.1] ([192.168.16.180]) by us-ex1.zend.com with Microsoft SMTPSVC(6.0.3790.1830); Wed, 8 Aug 2007 12:13:53 -0700 Message-ID: <46BA15E9.10802@zend.com> Date: Wed, 08 Aug 2007 12:13:45 -0700 Organization: Zend Technologies User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) MIME-Version: 1.0 To: 'PHP Internals' Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 08 Aug 2007 19:13:53.0750 (UTC) FILETIME=[42AF1F60:01C7D9F0] Subject: tsrm in CLI From: stas@zend.com (Stanislav Malyshev) Hi! I looked at CLI SAPI and found this code, around line 719: #ifdef ZTS compiler_globals = ts_resource(compiler_globals_id); executor_globals = ts_resource(executor_globals_id); core_globals = ts_resource(core_globals_id); sapi_globals = ts_resource(sapi_globals_id); tsrm_ls = ts_resource(0); #endif /* startup after we get the above ini override se we get things right */ if (cli_sapi_module.startup(&cli_sapi_module)==FAILURE) { The problem here is that compiler/executor globals are allocated in zend_startup, which is called from cli_sapi_module.startup. So what is actually in compiler_globals and executor_globals is either tsrm_ls if they are initialized to 0 or random crap if they aren't. Can anybody explain me where I'm wrong and why this code works? -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com