#42338 [Opn-Fbk]: Memory leak in SAPI.c

2007-08-27 Thread jani
 ID:   42338
 Updated by:   [EMAIL PROTECTED]
 Reported By:  programatorfreez at gmail dot com
-Status:   Open
+Status:   Feedback
 Bug Type: *General Issues
 Operating System: Gentoo GNU/Linux
 PHP Version:  5.2.4RC2
 New Comment:

Ever heard about '--disable-all' ? That disables all the
enabled-by-default extensions and you can just enable those you
actually need. Please shorten the configure line to shortest possible.

And about threaded stuff: there are dozens of libraries PHP can be
linked with which are not thread-safe. Why do you insist on using the
much slower threaded one anyway when you could have much more reliable
and non-leaking, fast PHP running under non-threaded webserver?


Previous Comments:


[2007-08-27 21:37:25] programatorfreez at gmail dot com

'./configure' '--prefix=/usr/lib/php5' '--host=i686-pc-linux-gnu'
'--mandir=/usr/lib/php5/man' '--infodir=/usr/lib/php5/info'
'--sysconfdir=/etc' '--cache-file=./config.cache' '--disable-cli'
'--with-apxs2=/usr/sbin/apxs2'
'--with-config-file-path=/etc/php/apache2-php5'
'--with-config-file-scan-dir=/etc/php/apache2-php5/ext-active'
'--without-pear' '--disable-bcmath' '--with-bz2' '--disable-calendar'
'--without-curl' '--without-curlwrappers' '--disable-dbase'
'--disable-exif' '--without-fbsql' '--without-fdftk' '--disable-filter'
'--disable-ftp' '--with-gettext' '--without-gmp' '--disable-hash'
'--disable-ipv6' '--disable-json' '--without-kerberos'
'--enable-mbstring' '--with-mcrypt' '--without-mhash' '--without-msql'
'--without-mssql' '--with-ncurses' '--with-openssl'
'--with-openssl-dir=/usr' '--disable-pcntl' '--without-pgsql'
'--disable-posix' '--with-pspell' '--without-recode' '--disable-shmop'
'--without-snmp' '--enable-soap' '--enable-sockets' '--without-sybase'
'--without-sybase-ct' '--disable-sysvmsg' '--disable-sysvsem'
'--disable-sysvshm' '--without-tidy' '--disable-wddx' '--without-xmlrpc'
'--with-xsl' '--disable-zip' '--with-zlib' '--enable-debug'
'--enable-dba' '--without-cdb' '--with-db4' '--without-flatfile'
'--with-gdbm' '--without-inifile' '--without-qdbm'
'--with-freetype-dir=/usr' '--with-t1lib=/usr' '--disable-gd-jis-conv'
'--with-jpeg-dir=/usr' '--with-png-dir=/usr' '--without-xpm-dir'
'--with-gd' '--with-mysql=/usr'
'--with-mysql-sock=/var/run/mysqld/mysqld.sock' '--without-mysqli'
'--without-pdo-dblib' '--with-pdo-mysql=/usr' '--without-pdo-odbc'
'--without-pdo-pgsql' '--without-pdo-sqlite' '--with-readline'
'--without-libedit' '--without-mm' '--without-sqlite'



[2007-08-21 20:20:04] programatorfreez at gmail dot com

Jani: I don't understand you, what do you mean? There is *not* anything
broken in my system, that's why PHP 5.2.3 didn't report any memory leak
with the same code and (of course) with the same USE flags and I use
threaded apache for years without any problem (until now with PHP
5.2.4).



[2007-08-21 07:35:56] [EMAIL PROTECTED]

Uh..that comment causes immediate bogusing. Plus: You're using threaded
Apache, there's propably even more broken in your system than just that.



[2007-08-20 16:00:49] programatorfreez at gmail dot com

ACCEPT_KEYWORDS='~x86' USE=apache2 berkdb bzip2 cli crypt ctype debug
gd gdbm iconv mysql
ncurses nls pcre pdo readline reflection session simplexml soap
sockets
spell spl ssl suhosin tokenizer truetype unicode xml xmlreader
xmlwriter
xsl zlib emerge -av dev-lang/php5

If you are not able to use ./configure --apache2, --berkdb, --bzip2,
--cli, etc. than It's your problem, not my.



[2007-08-20 06:19:50] [EMAIL PROTECTED]

That's not your configure command... configure commands start with
./configure



The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/42338

-- 
Edit this bug report at http://bugs.php.net/?id=42338edit=1


#42338 [Opn-Fbk]: Memory leak in SAPI.c

2007-08-20 Thread derick
 ID:   42338
 Updated by:   [EMAIL PROTECTED]
 Reported By:  programatorfreez at gmail dot com
-Status:   Open
+Status:   Feedback
 Bug Type: *General Issues
 Operating System: Gentoo GNU/Linux
 PHP Version:  5.2.4RC2
 New Comment:

That's not your configure command... configure commands start with
./configure


Previous Comments:


[2007-08-19 21:12:12] programatorfreez at gmail dot com

Ok, next time I will remember. It was:
USE=apache2 berkdb bzip2 cli crypt ctype debug gd gdbm iconv mysql
ncurses nls pcre pdo readline reflection session simplexml soap sockets
spell spl ssl suhosin tokenizer truetype unicode xml xmlreader xmlwriter
xsl zlib



[2007-08-19 20:04:07] [EMAIL PROTECTED]

And what was the configure line you used to configure PHP?
This is #1 thing you should put in a bug report anybody wants to even
look at. (It's mentioned on the page you submitted the bug from..)



[2007-08-18 15:20:21] programatorfreez at gmail dot com

When i execute It without suhosin, the result is:
http://pastebin.ca/662282



[2007-08-18 15:10:52] programatorfreez at gmail dot com

Description:

[Sat Aug 18 16:24:38 2007]  Script: 
'/var/www/localhost/htdocs/weblog/test.php'
/var/tmp/portage/dev-lang/php-5.2.4_pre200708051230-r2/work/php5.2-200708051230/main/SAPI.c(940)
:  Freeing 0x082A9C38 (10 bytes), script=/var$
Last leak repeated 1 time
=== Total 2 memory leaks detected ===


Reproduce code:
---
?php
// save as test.php into directory weblog in your HTDOCS
if (!isset($_GET['test'])) {
for ($i = 0; $i  5; $i++) { // change $i  5 to $i  0 after first
running of this script
$query = str_repeat('[]', 1024);
$url = 'http://127.0.0.1/weblog/test.php?test' . $query .
'=1';
file_get_contents($url);
}
}

echo 'finished';
?

Expected result:

No memory leak =)

Actual result:
--
sh-3.2# USE_ZEND_ALLOC=0 valgrind --leak-check=full
--gen-suppressions=yes php -f /var/www/localhost/htdocs/weblog/
test.php

==31902== Memcheck, a memory error detector.
==31902== Copyright (C) 2002-2007, and GNU GPL'd, by Julian Seward et
al.
==31902== Using LibVEX rev 1732, a library for dynamic binary
translation.
==31902== Copyright (C) 2004-2007, and GNU GPL'd, by OpenWorks LLP.
==31902== Using valgrind-3.2.3, a dynamic binary instrumentation
framework.
==31902== Copyright (C) 2000-2007, and GNU GPL'd, by Julian Seward et
al.
==31902== For more details, rerun with: -v
==31902== 

Warning:
file_get_contents(http://127.0.0.1/weblog/test.php?test[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]!
 [][][][][][][][][][][][][][][][][][
in /var/www/localhost/htdocs/weblog/test.php on line 6
finished==31902== 
==31902== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 7 from
1)
==31902== malloc/free: in use at exit: 26,319 bytes in 1,505 blocks.
==31902== malloc/free: 17,148 allocs, 15,643 frees, 1,966,546 bytes
allocated.
==31902== For counts of detected errors, rerun with: -v
==31902== searching for pointers to 1,505 not-freed blocks.
==31902== checked 1,359,216 bytes.
==31902== 
==31902== LEAK SUMMARY:
==31902==definitely lost: 0 bytes in 0 blocks.
==31902==  possibly lost: 0 bytes in 0 blocks.
==31902==still reachable: 26,319 bytes in 1,505 blocks.
==31902== suppressed: 0 bytes in 0 blocks.
==31902== Reachable blocks (those to which a pointer was found) are not
shown.
==31902== To see them, rerun with: --leak-check=full
--show-reachable=yes
sh-3.2# USE_ZEND_ALLOC=0 valgrind --leak-check=full
--gen-suppressions=yes --show-reachable=yes php -f
/var/www/localhost/htdocs/weblog/test.php
==31907== Memcheck, a memory error detector.
==31907== Copyright (C) 2002-2007, and GNU GPL'd, by Julian Seward et
al.
==31907== Using LibVEX rev 1732, a library 

#42338 [Opn-Fbk]: Memory leak in SAPI.c

2007-08-19 Thread jani
 ID:   42338
 Updated by:   [EMAIL PROTECTED]
 Reported By:  programatorfreez at gmail dot com
-Status:   Open
+Status:   Feedback
 Bug Type: *General Issues
 Operating System: Gentoo GNU/Linux
 PHP Version:  5.2.4RC2
 New Comment:

And what was the configure line you used to configure PHP?
This is #1 thing you should put in a bug report anybody wants to even
look at. (It's mentioned on the page you submitted the bug from..)


Previous Comments:


[2007-08-18 15:20:21] programatorfreez at gmail dot com

When i execute It without suhosin, the result is:
http://pastebin.ca/662282



[2007-08-18 15:10:52] programatorfreez at gmail dot com

Description:

[Sat Aug 18 16:24:38 2007]  Script: 
'/var/www/localhost/htdocs/weblog/test.php'
/var/tmp/portage/dev-lang/php-5.2.4_pre200708051230-r2/work/php5.2-200708051230/main/SAPI.c(940)
:  Freeing 0x082A9C38 (10 bytes), script=/var$
Last leak repeated 1 time
=== Total 2 memory leaks detected ===


Reproduce code:
---
?php
// save as test.php into directory weblog in your HTDOCS
if (!isset($_GET['test'])) {
for ($i = 0; $i  5; $i++) { // change $i  5 to $i  0 after first
running of this script
$query = str_repeat('[]', 1024);
$url = 'http://127.0.0.1/weblog/test.php?test' . $query .
'=1';
file_get_contents($url);
}
}

echo 'finished';
?

Expected result:

No memory leak =)

Actual result:
--
sh-3.2# USE_ZEND_ALLOC=0 valgrind --leak-check=full
--gen-suppressions=yes php -f /var/www/localhost/htdocs/weblog/
test.php

==31902== Memcheck, a memory error detector.
==31902== Copyright (C) 2002-2007, and GNU GPL'd, by Julian Seward et
al.
==31902== Using LibVEX rev 1732, a library for dynamic binary
translation.
==31902== Copyright (C) 2004-2007, and GNU GPL'd, by OpenWorks LLP.
==31902== Using valgrind-3.2.3, a dynamic binary instrumentation
framework.
==31902== Copyright (C) 2000-2007, and GNU GPL'd, by Julian Seward et
al.
==31902== For more details, rerun with: -v
==31902== 

Warning:
file_get_contents(http://127.0.0.1/weblog/test.php?test[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]!
 [][][][][][][][][][][][][][][][][][
in /var/www/localhost/htdocs/weblog/test.php on line 6
finished==31902== 
==31902== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 7 from
1)
==31902== malloc/free: in use at exit: 26,319 bytes in 1,505 blocks.
==31902== malloc/free: 17,148 allocs, 15,643 frees, 1,966,546 bytes
allocated.
==31902== For counts of detected errors, rerun with: -v
==31902== searching for pointers to 1,505 not-freed blocks.
==31902== checked 1,359,216 bytes.
==31902== 
==31902== LEAK SUMMARY:
==31902==definitely lost: 0 bytes in 0 blocks.
==31902==  possibly lost: 0 bytes in 0 blocks.
==31902==still reachable: 26,319 bytes in 1,505 blocks.
==31902== suppressed: 0 bytes in 0 blocks.
==31902== Reachable blocks (those to which a pointer was found) are not
shown.
==31902== To see them, rerun with: --leak-check=full
--show-reachable=yes
sh-3.2# USE_ZEND_ALLOC=0 valgrind --leak-check=full
--gen-suppressions=yes --show-reachable=yes php -f
/var/www/localhost/htdocs/weblog/test.php
==31907== Memcheck, a memory error detector.
==31907== Copyright (C) 2002-2007, and GNU GPL'd, by Julian Seward et
al.
==31907== Using LibVEX rev 1732, a library for dynamic binary
translation.
==31907== Copyright (C) 2004-2007, and GNU GPL'd, by OpenWorks LLP.
==31907== Using valgrind-3.2.3, a dynamic binary instrumentation
framework.
==31907== Copyright (C) 2000-2007, and GNU GPL'd, by Julian Seward et
al.
==31907== For more details, rerun with: -v
==31907== 

Warning: