Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:33585 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 8915 invoked by uid 1010); 3 Dec 2007 15:40:50 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 8900 invoked from network); 3 Dec 2007 15:40:50 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Dec 2007 15:40:50 -0000 Authentication-Results: pb1.pair.com smtp.mail=tony@daylessday.org; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=tony@daylessday.org; sender-id=pass Received-SPF: pass (pb1.pair.com: domain daylessday.org designates 89.208.40.236 as permitted sender) X-PHP-List-Original-Sender: tony@daylessday.org X-Host-Fingerprint: 89.208.40.236 mail.daylessday.org Linux 2.6 Received: from [89.208.40.236] ([89.208.40.236:54003] helo=daylessday.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C5/72-25012-08324574 for ; Mon, 03 Dec 2007 10:40:49 -0500 Received: from [192.168.3.87] (unknown [212.42.62.198]) by daylessday.org (Postfix) with ESMTP id 9AAA56401E5; Mon, 3 Dec 2007 18:40:45 +0300 (MSK) Message-ID: <4754237D.3060700@daylessday.org> Date: Mon, 03 Dec 2007 18:40:45 +0300 User-Agent: Thunderbird 2.0.0.9 (X11/20071114) MIME-Version: 1.0 To: "Rachmel, Nir (Nir)" CC: internals@lists.php.net References: <11486DD9B957EA488E21C44BC8737EFC54A3A4@307622ANEX5.global.avaya.com> <4749854D.4050809@daylessday.org> <11486DD9B957EA488E21C44BC8737EFC54A3CA@307622ANEX5.global.avaya.com> <47498878.1070500@daylessday.org> <11486DD9B957EA488E21C44BC8737EFC56FB8E@307622ANEX5.global.avaya.com> <474BBBD1.2030107@daylessday.org> <11486DD9B957EA488E21C44BC8737EFC594995@307622ANEX5.global.avaya.com> <11486DD9B957EA488E21C44BC8737EFC594E3B@307622ANEX5.global.avaya.com> In-Reply-To: <11486DD9B957EA488E21C44BC8737EFC594E3B@307622ANEX5.global.avaya.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] FW: [PHP] PHP 5.2.3 segfault with syslog standard extension From: tony@daylessday.org (Antony Dovgal) On 03.12.2007 18:19, Rachmel, Nir (Nir) wrote: > Hi, > > I have been doing some code-reading. Why is the RSHUTDOWN function for > syslog ext called only when run under win32? > Shouldn't the cleanup happen on linux as well? `man closelog` says it's not required. DESCRIPTION closelog() closes the descriptor being used to write to the system logger. The use of closelog() is optional. > Another question is for the use of zend_strndup instead of one of the > non-persistent memory allocation functions (i.e. estrndup() ) ? > There is no use for this variable after the request dies (as far as I > understand). Right, if you use estrndup(), the memory is freed at the end of request, while zend_strndup() bypasses Zend memory manager using malloc() directly. > However, so far, I can't seem to understand who/what corrupts my memory. Me neither :/ > What do you think about extending the RINIT function instead of: > PHP_RINIT_FUNCTION(syslog) > { > if (INI_INT("define_syslog_variables")) { > start_syslog(TSRMLS_C); > } else { > BG(syslog_started)=0; > BG(syslog_device)=NULL; /* This is the addition */ I think this would just create a memleak. BG(syslog_device) is checked for NULL and freed in openlog() and MSHUTDOWN. -- Wbr, Antony Dovgal