ID: 44875
Updated by: [EMAIL PROTECTED]
Reported By: hrichter at udec dot cl
-Status: Open
+Status: Bogus
Bug Type: Unknown/Other Function
Operating System: Linux 2.6.9-5.EL
PHP Version: 5.2.5
New Comment:
There is no mem. leak.
Says the documentation:
int memory_get_usage ([ bool $real_usage ] )
real_usage -- Set this to TRUE to get the real size of memory allocated
from system. If not set or FALSE only the memory used by emalloc() is
reported.
Using that parameter you will see what you expect.
Previous Comments:
------------------------------------------------------------------------
[2008-04-30 20:10:37] hrichter at udec dot cl
Description:
------------
The function addcslashes doesn't free memory when its first argument is
longer than 4
CONFIGURE LINE:
./configure --prefix=/opt/lampp --with-apxs2=/opt/lampp/bin/apxs
--with-config-file-path=/opt/lampp/etc --with-mysql=/opt/lampp
--enable-inline-optimization --disable-debug --enable-bcmath
--enable-calendar --enable-ctype --enable-dbase --enable-discard-path
--enable-exif --enable-filepro --enable-force-cgi-redirect --enable-ftp
--enable-gd-imgstrttf --enable-gd-native-ttf --with-ttf
--enable-magic-quotes --enable-memory-limit --enable-shmop
--enable-sigchild --enable-sysvsem --enable-sysvshm --enable-track-vars
--enable-trans-sid --enable-wddx --enable-yp --with-ftp
--with-gdbm=/opt/lampp --with-jpeg-dir=/opt/lampp
--with-png-dir=/opt/lampp --with-freetype-dir=/opt/lampp --without-xpm
--with-zlib=yes --with-zlib-dir=/opt/lampp --with-openssl=/opt/lampp
--with-expat-dir=/opt/lampp --enable-xslt=/opt/lampp
--with-xsl=/opt/lampp --with-dom=/opt/lampp --with-ldap=/opt/lampp
--with-ncurses=/opt/lampp --with-gd --with-imap-dir=/opt/lampp
--with-imap-ssl --with-imap=/opt/lampp --with-gettext=/opt/lampp
--with-mssql=/opt/lampp --with-sybase=/opt/lampp
--with-interbase=shared,/opt/interbase
--with-mysql-sock=/opt/lampp/var/mysql/mysql.sock
--with-oci8=shared,instantclient,/opt/lampp/lib/instantclient
--with-mcrypt=/opt/lampp --with-mhash=/opt/lampp --enable-sockets
--enable-mbstring=all --with-curl=/opt/lampp --enable-mbregex
--enable-zend-multibyte --enable-exif --with-bz2=/opt/lampp
--with-sqlite=shared,/opt/lampp --with-libxml-dir=/opt/lampp
--enable-soap --enable-pcntl --with-mysqli=/opt/lampp/bin/mysql_config
--with-mime-magic --with-pgsql=shared,/opt/lampp/postgresql --with-iconv
--enable-dio --with-pdo-mysql=/opt/lampp
--with-pdo-pgsql=/opt/lampp/postgresql --with-pdo-sqlite
--with-ming=shared,/opt/lampp
Reproduce code:
---------------
for($i=0 ; $i<5000 ; ++$i){
addcslashes("12345","'") ;
echo memory_get_usage(),"<br>\n" ;
}
Expected result:
----------------
The memory usage should be the same in every iteration.
Actual result:
--------------
The memory usage keeps growing and growing up to a certain maximum
which depends on the length of the first argument of addcslashes.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=44875&edit=1