#42242 [Fbk->Opn]: sybase_connect() crashes

From: Date: Wed, 08 Aug 2007 09:31:44 +0000
Subject: #42242 [Fbk->Opn]: sybase_connect() crashes
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-115899@lists.php.net to get a copy of this message
 ID:               42242
 User updated by:  roberto dot valsania at mail dot wind dot it
 Reported By:      roberto dot valsania at mail dot wind dot it
-Status:           Feedback
+Status:           Open
 Bug Type:         Sybase (dblib) related
 Operating System: FEDORA 7
 PHP Version:      5CVS-2007-08-08 (snap)
 New Comment:

Yes , but it does not link .
Here the last lines ..

zend_exceptions.o Zend/zend_strtod.o Zend/zend_objects.o
Zend/zend_object_handle                                            rs.o
Zend/zend_objects_API.o Zend/zend_default_classes.o Zend/zend_execute.o
sap                                            i/cgi/cgi_main.o
sapi/cgi/getopt.o main/internal_functions.o -o sapi/cgi/php-cgi         
                                   -Wl,--export-dynamic 
-L/sbrdbms/sybase/OpenClient15//OCS-15_0/lib -lcrypt -lsy               
                            btcl -lintl -lcomn -lct -lcs -lcrypt -lrt
-lresolv -lm -ldl -lnsl -lxml2 -lz -lm                                  
          -lxml2 -lz -lm -lxml2 -lz -lm -lcrypt -lxml2 -lz -lm -lxml2
-lz -lm -lxml2 -lz                                             -lm
-lcrypt -Wl,--rpath -Wl,/sbrdbms/sybase/OpenClient15//OCS-15_0/lib
/usr/bin/ld: cannot find -lintl
collect2: ld returned 1 exit status
make: *** [sapi/cgi/php-cgi] Error 1
[root@dba-iv1 php-5.2.3]#


Previous Comments:
------------------------------------------------------------------------

[2007-08-08 09:02:14] jani@php.net

Have you tried using the sybase-ct extension instead?

------------------------------------------------------------------------

[2007-08-08 08:57:51] roberto dot valsania at mail dot wind dot it

The same crash and stacktrace with PHP compiled from official srpms
fedora 7 update (PHP 5.2.2 (cli) (built: May  8 2007 08:15:05))

------------------------------------------------------------------------

[2007-08-08 08:46:22] 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


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=42242&edit=1


Thread (6 messages)

« previous php.bugs (#115899) next »