From:             rorteu at arrakis dot es
Operating system: Red Hat Enterprise Linux ES rele
PHP version:      4.4.7
PHP Bug Type:     ODBC related
Bug description:  Double free and segmentation fault errors

Description:
------------
# php prueba.php
Content-type: text/html; charset=iso-8859-1
X-Powered-By: PHP/4.3.9

db:Resource id #1*** glibc detected *** double free or corruption (!prev):
0x09e09760 ***
Abortado
# export MALLOC_CHECK_=0
# php prueba.php
Content-type: text/html; charset=iso-8859-1
X-Powered-By: PHP/4.3.9

db:Resource id #1

# php demo.php 
Violación de segmento



Reproduce code:
---------------
# cat prueba.php
<?php
$db=odbc_connect('xxx','xxx','xxx');
echo "db:".$db;
odbc_close($db);
?>

# cat demo.php 
<?php
        $conexion = odbc_connect("xxx","xxx","xxx");
        $rs = odbc_do($conexion,"select * from id");
        while (odbc_fetch_row($rs))
        {
                $valor = odbc_result($rs,1);
                echo $valor."<br>";
        }
        odbc_free_result($rs);
?>



Actual result:
--------------
# gdb php
GNU gdb Red Hat Linux (6.3.0.0-0.31rh)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you
are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for
details.
This GDB was configured as "i386-redhat-linux-gnu"...(no debugging symbols
found)
Using host libthread_db library "/lib/tls/libthread_db.so.1".

(gdb) run demo.php
Starting program: /usr/bin/php demo.php
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
[Thread debugging using libthread_db enabled]
[New Thread -1208068416 (LWP 22317)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1208068416 (LWP 22317)]
0x005e1cf0 in my_SQLPrepare () from /usr/lib/libmyodbc.so
(gdb) where
#0  0x005e1cf0 in my_SQLPrepare () from /usr/lib/libmyodbc.so
#1  0x005df18e in SQLExecDirect () from /usr/lib/libmyodbc.so
#2  0x003c7ac2 in SQLExecDirect () from /usr/lib/libodbc.so.1
#3  0x001d1dc4 in zif_odbc_exec () from /usr/lib/php4/odbc.so
#4  0x08157014 in execute ()
#5  0x08146710 in zend_execute_scripts ()
#6  0x0811d9de in php_execute_script ()
#7  0x00000000 in ?? ()
(gdb) 


Thanks in advance.
Regards.

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

Reply via email to