Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:24371 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 82344 invoked by uid 1010); 14 Jul 2006 01:08:49 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 82329 invoked from network); 14 Jul 2006 01:08:49 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Jul 2006 01:08:49 -0000 X-PHP-List-Original-Sender: mv-php@binarysec.com X-Host-Fingerprint: 193.252.23.111 smtp17.orange.fr Linux 2.4/2.6 Received: from ([193.252.23.111:48655] helo=smtp17.orange.fr) by pb1.pair.com (ecelerity 2.1.1.3 r(11751M)) with ESMTP id 98/72-41830-D9EE6B44 for ; Thu, 13 Jul 2006 21:08:47 -0400 Received: from binarysecfb111 (AStDenis-104-1-5-100.w81-248.abo.wanadoo.fr [81.248.240.100]) by mwinf1704.orange.fr (SMTP Server) with SMTP id B41967000082 for ; Fri, 14 Jul 2006 03:08:42 +0200 (CEST) X-ME-UUID: 20060714010842737.B41967000082@mwinf1704.orange.fr Message-ID: <000f01c6a6e1$dab204f0$6400a8c0@binarysecfb111> To: "PHPdev" Date: Fri, 14 Jul 2006 03:07:17 +0200 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_000C_01C6A6F2.9D4EC740" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2869 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869 Subject: Fights memories leaks From: mv-php@binarysec.com ("Michael Vergoz") ------=_NextPart_000_000C_01C6A6F2.9D4EC740 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hello, =20 That made one week that I fights against mem leaks in PHP and I already = made a patch which corrects one of them.=20 =20 The biggest problem to which I face is to explain these leaks bus makes = some I use my own SAPI prepared for an unknown HTTPd which is itself = Fully-threaded and these leaks are visibles only in threaded = environment.=20 =20 To regulate my problem I decided to make a program which insulates and = tests any PHP scripts and makes it possible to see whether this one = generates a leak in an threaded environment.=20 =20 The program consists of a modification of the SAPI embed (which I had = already modified but there I still improved it without wanting it :d) = and a small program which emulates the operation of a fully-threaded = httpd server.=20 I had posted a mail in connection with a leak in PG(last_error_message) = & PG(last_error_file). Now you can reproduce the leak.=20 =20 I identified 4 others but it is necessary that I arrive has to find the = exact script which reproduces the leak. I keep you informed. =20 In some case you can have a leak information coming from = pthread_create() do not take care, that depends of your NPTL (Native = Posix Thread Library) version. =20 If you have any questions or advises i am available thanks. The source code http://badcode.be/~descript/PHP/php_leak_tester.tar.gz Installation : http://badcode.be/~descript/PHP/php_leak_tester/README The patch for the first leak you can see with test/constant.php : = http://badcode.be/~descript/PHP/PHP_5_2-php-main.diff Michael Vergoz ------=_NextPart_000_000C_01C6A6F2.9D4EC740--