From:             roberto dot valsania at mail dot wind dot it
Operating system: FEDORA 7
PHP version:      5CVS-2007-08-08 (snap)
PHP Bug Type:     Sybase (dblib) related
Bug description:  php crash when connect sybase DB

Description:
------------
php segmentation fault when try connect to sybase database


PHP Version:
[EMAIL PROTECTED] 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
[EMAIL PROTECTED] 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 :

[EMAIL PROTECTED] 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

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

Reply via email to