Bug #60591 [Opn->Csd]: Memory leak when access a non-exists file
| From: | laruence@php.net | Date: | Thu, 22 Dec 2011 07:40:44 +0000 |
| Subject: | Bug #60591 [Opn->Csd]: Memory leak when access a non-exists file | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-166040@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=60591&edit=1
ID: 60591
Updated by: laruence@php.net
Reported by: laruence@php.net
Summary: Memory leak when access a non-exists file
-Status: Open
+Status: Closed
Type: Bug
Package: Built-in web server
PHP Version: 5.4.0RC3
-Assigned To:
+Assigned To: laruence
Block user comment: N
Private report: N
New Comment:
This bug has been fixed in SVN.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
For Windows:
http://windows.php.net/snapshots/
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2011-12-22 07:39:21] laruence@php.net
Automatic comment from SVN on behalf of laruence
Revision: http://svn.php.net/viewvc/?view=revision&revision=321320
Log: Fix bug #60591 (Memory leak when access a non-exists file)
------------------------------------------------------------------------
[2011-12-22 07:18:43] laruence@php.net
Description:
------------
report by cjones
if built-in server start with a router:
<?php
if (preg_match('/\.(?:png|jpg|jpeg|gif)$/', $_SERVER["REQUEST_URI"]))
return false; // serve the requested resource as-is.
else {
echo "here";
}
?>
then accesss a non-exists file like(a.jpe) will result in mem leak.
Test script:
---------------
<?php
if (preg_match('/\.(?:png|jpg|jpeg|gif)$/', $_SERVER["REQUEST_URI"]))
return false; // serve the requested resource as-is.
else {
echo "here";
}
?>
Expected result:
----------------
cjones@mlt:~/w$ php54 -S localhost:8000 routing.php
PHP 5.4.0RC4-dev Development Server started at Mon Dec 19 18:55:25 2011
Listening on localhost:8000
Document root is /home/cjones/public_html
Press Ctrl-C to quit.
[Mon Dec 19 18:55:30 2011] ::1:48358 [200]: /oraclelogo.jpg
[Mon Dec 19 18:55:30 2011] Script: '/home/cjones/public_html/favicon.ico'
/home/cjones/phpsrc/php/php-src/branches/PHP_5_4/ext/filter/filter.c(451) :
Freeing 0xB493F0E4 (16 bytes), script=/home/cjones/public_html/favicon.ico
Last leak repeated 19 times
[Mon Dec 19 18:55:30 2011] Script: '/home/cjones/public_html/favicon.ico'
/home/cjones/phpsrc/php/php-src/branches/PHP_5_4/Zend/zend_execute.h(184) :
Freeing 0xB493F19C (65484 bytes), script=/home/cjones/public_html/favicon.ico
[Mon Dec 19 18:55:30 2011] Script: '/home/cjones/public_html/favicon.ico'
.....
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=60591&edit=1