Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:57823 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 10550 invoked from network); 13 Feb 2012 09:38:11 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Feb 2012 09:38:11 -0000 Authentication-Results: pb1.pair.com header.from=yoram.b@zend.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=yoram.b@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 212.199.177.89 as permitted sender) X-PHP-List-Original-Sender: yoram.b@zend.com X-Host-Fingerprint: 212.199.177.89 il-mr1.zend.com Received: from [212.199.177.89] ([212.199.177.89:40022] helo=il-mr1.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 33/B3-27081-10AD83F4 for ; Mon, 13 Feb 2012 04:38:11 -0500 Received: from il-gw1.zend.com (unknown [10.1.1.22]) by il-mr1.zend.com (Postfix) with ESMTP id AD77C607CE; Mon, 13 Feb 2012 11:36:32 +0200 (IST) Received: from mandor.localnet (10.1.3.58) by il-ex2.zend.net (10.1.1.22) with Microsoft SMTP Server (TLS) id 14.1.255.0; Mon, 13 Feb 2012 11:37:55 +0200 To: Stas Malyshev Date: Mon, 13 Feb 2012 11:38:00 +0200 User-Agent: KMail/1.13.7 (Linux/2.6.37; KDE/4.7.2; i686; ; ) CC: Dmitry Stogov , PHP Internals , Alex Haiut , Zeev Suraski , Eran Ifrah , Lior Kaplan References: <201202121409.54891.yoram.b@zend.com> <4F38D3B8.6010304@zend.com> <4F38D4F9.2090808@sugarcrm.com> In-Reply-To: <4F38D4F9.2090808@sugarcrm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-ID: <201202131138.00917.yoram.b@zend.com> X-Originating-IP: [10.1.3.58] Subject: Re: [PHP-DEV] Re: restore user opcode handler in PHP From: yoram.b@zend.com (yoram bar haim) Here is a simple test program that reproduce the issue on mac: lib.h: #include "lib.h" void set_index(int index, int value); int get_index(int index); lib.c: #include "lib.h" static int glob_var[] = {0,0,0,0}; void set_index(int index, int value) { glob_var[index] = value; } int get_index(int index) { return glob_var[index]; } main.c: #include #include #include "lib.h" int main() { void *handle = dlopen ("lib.so",0); set_index(0,1); dlclose(handle); handle = dlopen ("lib.so",0); printf("%d\n",get_index(0)); return 0; } shell> gcc -o lib.so -shared lib.c shell> gcc -o main main.c lib.so shell> ./main On Monday, February 13, 2012 11:16:41 AM Stas Malyshev wrote: > Hi! > > > I'm not familiar with Mac, but I saw such behavior on Linux very long > > time ago, when on PHP restart static variables were still keep values > > from old process. > > That might happen if the shared library was not unloaded (dlopen will > not re-load library that is already loaded) however I don't understand > how it can happen on Apache - it's supposed to dlclose all modules. Is > it reproducible on any Apache version on Linux or Mac?