From:             v dot orlov at ulab dot ru
Operating system: FreeBSD 6.3
PHP version:      5.2.7
PHP Bug Type:     MSSQL related
Bug description:  memory leaks in mssql extension

Description:
------------
When exec simple queries to 'MS SQL 2000'  I encounter warnings about
memory leaks in apache error log, see below.

Versions:
System FreeBSD 6.3  i386
freetds-0.64_2 (from ports)
apache 1.3.41
php 5.2.6 (5.2.7 has been removed from distribution)
suhosin patch 5.2.6-0.9.6.2

apache & php builded manually (not from ports)

Note: without suhosin patch call mssql_query crashing apache (segfault).

Reproduce code:
---------------
./configure --with-mssql=/usr/local --with-unixODBC
--with-apxs=/www/bin/apxs --enable-session --with-iconv --with-mm
--with-pcre-regex   --with-pcre-dir --with-gd --with-png-dir --prefix=/www
--enable-debug

code like:
msql_connect("dbserver")
$res = mssql_query("select NewsID from News");


Expected result:
----------------
workable mssql module

Actual result:
--------------
error log with suhosin patch and --debug flag

/root/apache-install/php-5.2.6/Zend/zend_variables.h(35) : Block
0x08123528 status:
/root/apache-install/php-5.2.6/Zend/zend_variables.c(36) : Actual location
(location was relayed)
Beginning:      OK (allocated on
/root/apache-install/php-5.2.6/ext/mssql/php_mssql.c:980, 5 bytes)
    Start:      OK
      End:      Overflown (magic=0x00000000 instead of 0xFBA28207)
                1 byte(s) overflown
---------------------------------------
[Mon Dec  8 19:55:01 2008]  Script:  '/usr/local/www/infopin/index.php'
---------------------------------------
/root/apache-install/php-5.2.6/Zend/zend_variables.h(35) : Block
0x08123498 status:
/root/apache-install/php-5.2.6/Zend/zend_variables.c(36) : Actual location
(location was relayed)
Beginning:      OK (allocated on
/root/apache-install/php-5.2.6/ext/mssql/php_mssql.c:980, 5 bytes)
    Start:      OK
      End:      Overflown (magic=0x00000000 instead of 0xFBA28207)
                1 byte(s) overflown
---------------------------------------
[Mon Dec  8 19:55:01 2008]  Script:  '/usr/local/www/infopin/index.php'
/root/apache-install/php-5.2.6/ext/mssql/php_mssql.c(980) :  Freeing
0x0810F1B0 (5 bytes), script=/usr/local/www/infopin/index.php
Last leak repeated 16 times
=== Total 17 memory leaks detected ===

-- 
Edit bug report at http://bugs.php.net/?id=46798&edit=1
-- 
Try a CVS snapshot (PHP 5.2):        
http://bugs.php.net/fix.php?id=46798&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):        
http://bugs.php.net/fix.php?id=46798&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):        
http://bugs.php.net/fix.php?id=46798&r=trysnapshot60
Fixed in CVS:                        
http://bugs.php.net/fix.php?id=46798&r=fixedcvs
Fixed in CVS and need be documented: 
http://bugs.php.net/fix.php?id=46798&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=46798&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=46798&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=46798&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=46798&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=46798&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=46798&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=46798&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=46798&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=46798&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=46798&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=46798&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=46798&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=46798&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=46798&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=46798&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=46798&r=mysqlcfg

Reply via email to