ID:               42642
 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 CORE 7
 PHP Version:      5CVS-2007-09-12 (snap)
 New Comment:

As i wrote i have the same sybase libs ( with ldap resolution) but the
old PHP 5.1.6 ( on FEDORA CORE 5) and it works.
I could try to compile this PHP with the FEDORA CORE 5 ( and the old
openldap libs ) and see what happen


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

[2007-09-12 11:05:23] [EMAIL PROTECTED]

Did you have same sybase libs in the other system too?
It seems to me that there's simply a conflict between openldap and
sybase's own ldap implementation and there's not much we can do about
that..

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

[2007-09-12 09:44:39] roberto dot valsania at mail dot wind dot it

Note that to have ldap support sybase client shuld be 12.5.1 or 15.
I made test with Sybase OpenClient 15
The same configuration ( enable ldap and sybase ) with php 5.1.6 and
fedora core 5 works

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

[2007-09-12 09:31:47] roberto dot valsania at mail dot wind dot it

Description:
------------
PHP sybase_conect Crash when compiled with –with-sybase and –with-ldap
and sybase name resolution is done via LDAP

If PHP is compiled without ldap extension all works. 
If Sybase resolution is done via interface file and not via LDAP all
works

To reproduce :

1)      Compile php with :
./configure --enable-debug
--with-sybase=/sbrdbms/sybase/OpenClient15/OCS-15_0/ --with-ldap  

Enable ldap sybase resolution by uncomment the following line in
$SYBASE/$SYBASE_OCS/config/libctl.cfg
ldap=libdldap.so ldap://ldaphost/dc=sybase,dc=com 

Please note that in this example the ldap server is only the default
example. In this situation the sybase_connect should return error
instead of a stack trace

2)      Run the following simple php script
<?php

$my_server='DBA_SUN_TEST' ;
$passwd='xxxxxx';
$login='sa';


$db=sybase_connect($my_server,$login, $passwd) ;
sybase_close($db);

?>





Reproduce code:
---------------
To reproduce :

1)      Compile php with :
./configure --enable-debug
--with-sybase=/sbrdbms/sybase/OpenClient15/OCS-15_0/ --with-ldap  

Enable ldap sybase resolution by uncomment the following line in
$SYBASE/$SYBASE_OCS/config/libctl.cfg
ldap=libdldap.so ldap://ldaphost/dc=sybase,dc=com 

Please note that in this example the ldap server is only the default
example. In this situation the sybase_connect should return error
(because it don't find the ldap server correct configuration) instead of
a stack trace

2)      Run the following simple php script
<?php

$my_server='DBA_SUN_TEST' ;
$passwd='xxxxxx';
$login='sa';


$db=sybase_connect($my_server,$login, $passwd) ;
sybase_close($db);

?>

Expected result:
----------------
an error or a sucessfull connection

Actual result:
--------------
A segmentation fault .
Here the backtrace :

[EMAIL PROTECTED] php5.2-200709120830]# gdb sapi/cli/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".
warning: not using untrusted file
"/root/Development/php5.2-200709120830/.gdbinit"
(gdb) run ../../TEST_PHP/test_sybase.php
Starting program: /root/Development/php5.2-200709120830/sapi/cli/php
../../TEST_PHP/test_sybase.php
[Thread debugging using libthread_db enabled]
[New Thread -1208449344 (LWP 23841)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1208449344 (LWP 23841)]
0x00472dc2 in ldap_send_server_request () from
/usr/lib/libldap-2.3.so.0
(gdb) bt
#0  0x00472dc2 in ldap_send_server_request () from
/usr/lib/libldap-2.3.so.0
#1  0x00473092 in ldap_send_initial_request () from
/usr/lib/libldap-2.3.so.0
#2  0x00468248 in ldap_sasl_bind () from /usr/lib/libldap-2.3.so.0
#3  0x0066bc75 in ldap_simple_bind ()
   from /sbrdbms/sybase/OpenClient15/OCS-15_0/lib3p/libsybaseldap.so
#4  0x00267473 in gdd_bind ()
   from
/sbrdbms/sybase/OpenClient15/OCS-15_0//lib/libsybdldap.so.15.0.3
#5  0x00153f5d in drv_bind ()
   from /sbrdbms/sybase/OpenClient15/OCS-15_0//lib/libsybdb.so
#6  0x00153ab3 in dcl___bind ()
   from /sbrdbms/sybase/OpenClient15/OCS-15_0//lib/libsybdb.so
#7  0x00153b7a in dcl__bind_sync ()
   from /sbrdbms/sybase/OpenClient15/OCS-15_0//lib/libsybdb.so
#8  0x0015a11f in dcl_sess_bind ()
   from /sbrdbms/sybase/OpenClient15/OCS-15_0//lib/libsybdb.so
#9  0x00145663 in db__initnet ()
   from /sbrdbms/sybase/OpenClient15/OCS-15_0//lib/libsybdb.so
#10 0x0013077b in dbopen ()
   from /sbrdbms/sybase/OpenClient15/OCS-15_0//lib/libsybdb.so
#11 0x082ac4e4 in php_sybase_do_connect (ht=3, return_value=0xa2c6ed8,
    return_value_ptr=0x0, this_ptr=0x0, return_value_used=1,
persistent=0)
    at
/root/Development/php5.2-200709120830/ext/sybase/php_sybase_db.c:520
#12 0x082ac73f in zif_sybase_connect (ht=3, return_value=0xa2c6ed8,
---Type <return> to continue, or q <return> to quit---
    return_value_ptr=0x0, this_ptr=0x0, return_value_used=1)
    at
/root/Development/php5.2-200709120830/ext/sybase/php_sybase_db.c:571
#13 0x08338f4c in zend_do_fcall_common_helper_SPEC
(execute_data=0xbff1e474)
    at
/root/Development/php5.2-200709120830/Zend/zend_vm_execute.h:200
#14 0x0833e81d in ZEND_DO_FCALL_SPEC_CONST_HANDLER
(execute_data=0xbff1e474)
    at
/root/Development/php5.2-200709120830/Zend/zend_vm_execute.h:1681
#15 0x08338aad in execute (op_array=0xa2c60b8)
    at /root/Development/php5.2-200709120830/Zend/zend_vm_execute.h:92
#16 0x08313d1b in zend_execute_scripts (type=8, retval=0x0,
file_count=3)
    at /root/Development/php5.2-200709120830/Zend/zend.c:1134
#17 0x082c2773 in php_execute_script (primary_file=0xbff20810)
    at /root/Development/php5.2-200709120830/main/main.c:1983
#18 0x0838db78 in main (argc=2, argv=0xbff20964)
    at /root/Development/php5.2-200709120830/sapi/cli/php_cli.c:1140
(gdb)





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


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

Reply via email to