Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:33638 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 19684 invoked by uid 1010); 4 Dec 2007 14:08:29 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 19668 invoked from network); 4 Dec 2007 14:08:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Dec 2007 14:08:29 -0000 Authentication-Results: pb1.pair.com smtp.mail=rachmel@avaya.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=rachmel@avaya.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain avaya.com from 198.152.13.100 cause and error) X-PHP-List-Original-Sender: rachmel@avaya.com X-Host-Fingerprint: 198.152.13.100 co300216-co-outbound.net.avaya.com Received: from [198.152.13.100] ([198.152.13.100:32675] helo=co300216-co-outbound.avaya.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 74/E0-09439-85F55574 for ; Tue, 04 Dec 2007 09:08:27 -0500 X-IronPort-AV: E=Sophos;i="4.23,248,1194238800"; d="scan'208";a="88713665" Received: from unknown (HELO nj300815-nj-erheast.avaya.com) ([198.152.6.5]) by co300216-co-outbound.avaya.com with ESMTP; 04 Dec 2007 09:08:19 -0500 X-IronPort-AV: E=Sophos;i="4.23,248,1194238800"; d="scan'208";a="130602200" Received: from unknown (HELO 307622ANEX5.global.avaya.com) ([135.64.140.16]) by nj300815-nj-erheast-out.avaya.com with ESMTP; 04 Dec 2007 09:07:38 -0500 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Date: Tue, 4 Dec 2007 15:07:00 +0100 Message-ID: <11486DD9B957EA488E21C44BC8737EFC595242@307622ANEX5.global.avaya.com> In-Reply-To: <4754237D.3060700@daylessday.org> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PHP-DEV] FW: [PHP] PHP 5.2.3 segfault with syslog standard extension Thread-Index: Acg1wu9+vpiV3vA3Rr+xzAs6UQA/wgAu9vPA 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> <4754237D.3060700@daylessday.org> To: "Antony Dovgal" Cc: Subject: RE: [PHP-DEV] FW: [PHP] PHP 5.2.3 segfault with syslog standard extension From: rachmel@avaya.com ("Rachmel, Nir (Nir)") Hi, Are there any tools you can recommend me for debugging my error? Standard gdb debugging doesn't seem to help, and using valgrind in a real-time webserver environment simply doesn't work on my device (or on anyone's device I guess.. :) ). Thanks, Nir.=20 -----Original Message----- From: Antony Dovgal [mailto:tony@daylessday.org]=20 Sent: Monday, December 03, 2007 5:41 PM To: Rachmel, Nir (Nir) Cc: internals@lists.php.net Subject: Re: [PHP-DEV] FW: [PHP] PHP 5.2.3 segfault with syslog standard extension On 03.12.2007 18:19, Rachmel, Nir (Nir) wrote: > Hi, >=20 > 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=20 > non-persistent memory allocation functions (i.e. estrndup() ) ? > There is no use for this variable after the request dies (as far as I=20 > 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. =20 > 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)=3D0; > BG(syslog_device)=3DNULL; /* 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