Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:6218 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 63189 invoked by uid 1010); 4 Dec 2003 22:16:23 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 63109 invoked from network); 4 Dec 2003 22:16:23 -0000 Received: from unknown (HELO mail.kromann.info) (64.186.239.125) by pb1.pair.com with SMTP; 4 Dec 2003 22:16:23 -0000 Received: from Swwwing2000 (unknown [64.186.239.115]) by mail.kromann.info (Postfix) with SMTP id E55B52AE70 for ; Thu, 4 Dec 2003 14:33:53 -0800 (PST) To: X-Mailer: Swwwing 2000 Message-ID: <10705760774960000@9866357972520000.9866341568840000> MIME-Version: 1.0 Reply-To: "Frank M. Kromann" Date: Thu, 04 Dec 2003 14:14:38 -0800 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] efree() crash when used in a shutdown function (solved) From: frank@kromann.info ("Frank M. Kromann") Hi, It helps to break for lunch. Making this variable persistant solved the problem. - Frank > Hi, > > >From the pecl/printer extension: > > static void php_printer_shutdown(zend_printer_globals *printer_globals > TSRMLS_DC) { > if (printer_globals->default_printer) { > efree(printer_globals->default_printer); > } > } > > PHP_MINIT_FUNCTION(printer) > { > ZEND_INIT_MODULE_GLOBALS(printer, php_printer_init, > php_printer_shutdown); > .. > > > This code fails when the module is shutting down. The mudule is compiled > against PHP5, and it works fine with PHP4. > > If I change efree() to free() (and change the estrdup() to strdup()) the > code works fine. I have checked the string just before calling efree and > it is allocated and has a value. > > Is there any problem calling efree() from a shutdown function ? > > - Frank > > Hi, > > > > stdlib.h is included in line 106 of bindlib_w32\conf\portability.h. > This > > causes the linker to look for __pctype and __mb_cur_max. This is not a > > problem for the old style builds but with Wez' new build system it > causes > > a linking problem. > > > > Removing line 106 form this file solves the problem and as far as I can > > tell it does not cause any other problems. > > > > - Frank > > > > -- > > 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 >