Bug #61785 [NEW]: Memory leak when access a non-exists file without router
From:
Operating system: ANY
PHP version: 5.4.0
Package: Built-in web server
Bug Type: Bug
Bug description:Memory leak when access a non-exists file without router
Description:
------------
When access a non exists file in builtin web server. with --enable-debug it
report
leaks.
When send error page, It call php_output_deactivate() it disabled the
sent_headers
callback but it will emalloc default_content-type. then it leaks.
So I think set SG(sapi_headers).send_default_content_type to 0 temporary
can avoid
leaking.
Test script:
---------------
NONE
Expected result:
----------------
no leaks
Actual result:
--------------
PHP 5.4.1RC1-dev Development Server started at Fri Apr 20 17:23:52 2012
Listening on localhost:9999
Document root is /Users/reeze/Opensource/php-src
Press Ctrl-C to quit.
[Fri Apr 20 17:24:05 2012] ::1:56664 [404]: /no-exist.png - No such file or
directory
[Fri Apr 20 17:24:05 2012] ::1:56665 [404]: /favicon.ico - No such file or
directory
^C[Fri Apr 20 17:24:07 2012] Script: '-'
/Users/reeze/Opensource/php-src/main/SAPI.c(839) : Freeing 0x10A6B0208 (24
bytes), script=-
[Fri Apr 20 17:24:07 2012] Script: '-'
/Users/reeze/Opensource/php-src/Zend/zend_llist.c(39) : Freeing
0x10A6B04A8 (39
bytes), script=-
[Fri Apr 20 17:24:07 2012] Script: '-'
/Users/reeze/Opensource/php-src/main/SAPI.c(321) : Freeing 0x10A6B4758 (10
bytes), script=-
=== Total 3 memory leaks detected ===
--
Edit bug report at https://bugs.php.net/bug.php?id=61785&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=61785&r=trysnapshot54
Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=61785&r=trysnapshot53
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=61785&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=61785&r=fixed
Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=61785&r=needdocs
Fixed in release: https://bugs.php.net/fix.php?id=61785&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=61785&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=61785&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=61785&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=61785&r=support
Expected behavior: https://bugs.php.net/fix.php?id=61785&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=61785&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=61785&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=61785&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=61785&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=61785&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=61785&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=61785&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=61785&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=61785&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=61785&r=mysqlcfg
Thread (3 messages)
- reeze dot xia at gmail dot com