PHP :: Bug #42242 :: sybase_connect() crashes
| Bug #42242 | sybase_connect() crashes | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Submitted: | 2007-08-08 08:46 UTC | Modified: | 2007-08-10 00:43 UTC |
|
||||||
| From: | roberto dot valsania at mail dot wind dot it | Assigned: | ||||||||
| Status: | Closed | Package: | Sybase (dblib) related | |||||||
| PHP Version: | 5CVS-2007-08-08 (snap) | OS: | FEDORA 7 | |||||||
| Private report: | No | CVE-ID: | None | |||||||
[2007-08-08 08:46 UTC] roberto dot valsania at mail dot wind dot it
Description:
------------
php segmentation fault when try connect to sybase database
PHP Version:
[root@dba-iv1 cli]# php -v
PHP 5.2.3 (cli) (built: Aug 8 2007 09:49:36)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
[root@dba-iv1 cli]#
Configure Option :
./configure --with-sybase=$SYBASE/OCS-15_0 --enable-debug
Reproduce code:
---------------
<?php
$db = sybase_connect("DBA_SUN_TEST","sa","dba_sun_test") ;
print sybase_get_last_message () ;
sybase_close($db);
?>
Expected result:
----------------
Connect and disconect to Sybase DB
Actual result:
--------------
segmentation fault
Here the stacktrace :
[root@dba-iv1 cli]# gdb php
GNU gdb Red Hat Linux (6.6-15.fc7rh)
Copyright (C) 2006 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"...
Using host libthread_db library "/lib/libthread_db.so.1".
(gdb) run /root/test_sybase.php
Starting program: /root/Development/php-5.2.3_Develop_valsa/php-5.2.3/sapi/cli/php /root/test_sybase.php
[Thread debugging using libthread_db enabled]
[New Thread -1208444720 (LWP 13659)]
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1208444720 (LWP 13659)]
zend_hash_find (ht=0x83afa00,
arKey=0x8be2e5c "sybase_DBA_SUN_TEST_sa_dba_sun_test__",
nKeyLength=146298445, pData=0xbfc69420)
at /root/Development/php-5.2.3_Develop_valsa/php-5.2.3/Zend/zend_hash.h:264
264 hash = ((hash << 5) + hash) + *arKey++;
(gdb) bt
#0 zend_hash_find (ht=0x83afa00,
arKey=0x8be2e5c "sybase_DBA_SUN_TEST_sa_dba_sun_test__",
nKeyLength=146298445, pData=0xbfc69420)
at /root/Development/php-5.2.3_Develop_valsa/php-5.2.3/Zend/zend_hash.h:264
#1 0x0821a60b in php_sybase_do_connect (ht=<value optimized out>,
return_value=0x8be2e44, return_value_ptr=<value optimized out>,
this_ptr=0x0, return_value_used=1, persistent=0)
at /root/Development/php-5.2.3_Develop_valsa/php-5.2.3/ext/sybase/php_sybase_db.c:495
#2 0x08292738 in zend_do_fcall_common_helper_SPEC (execute_data=0xbfc695b0)
at /root/Development/php-5.2.3_Develop_valsa/php-5.2.3/Zend/zend_vm_execute.h:200
#3 0x08283f4d in execute (op_array=0x8be28d0)
at /root/Development/php-5.2.3_Develop_valsa/php-5.2.3/Zend/zend_vm_execute.h:92
#4 0x08266cf2 in zend_execute_scripts (type=8, retval=<value optimized out>,
file_count=3)
at /root/Development/php-5.2.3_Develop_valsa/php-5.2.3/Zend/zend.c:1134
#5 0x08227d63 in php_execute_script (primary_file=0xbfc6b96c)
at /root/Development/php-5.2.3_Develop_valsa/php-5.2.3/main/main.c:1794
#6 0x082df307 in main (argc=2, argv=0xbfc6ba84)
at /root/Development/php-5.2.3_Develop_valsa/php-5.2.3/sapi/cli/php_cli.c:1138
(gdb)
Please Note : Compile with freetds and mssql the connect is ok
Patches
Pull Requests
History
AllCommentsChangesGit/SVN commits
[2007-08-08 08:57 UTC] roberto dot valsania at mail dot wind dot it
[2007-08-08 09:02 UTC] jani@php.net
[2007-08-08 09:31 UTC] roberto dot valsania at mail dot wind dot it
[2007-08-08 10:21 UTC] roberto dot valsania at mail dot wind dot it
[2007-08-10 00:43 UTC] iliaa@php.net