#42642 [Opn-Fbk]: sybase_connect crashes when compiled with with-sybase and with-ldap

2007-09-13 Thread jani
 ID:   42642
 Updated by:   [EMAIL PROTECTED]
 Reported By:  roberto dot valsania at mail dot wind dot it
-Status:   Open
+Status:   Feedback
 Bug Type: Sybase (dblib) related
 Operating System: FEDORA CORE 7
 PHP Version:  5CVS-2007-09-12 (snap)
 New Comment:

Did you get these with same PHP version:
With fedora 5 and openldap 2.3.19-4 - works
With fedora 7 and openldap 2.3.34-3 - crash

??



Previous Comments:


[2007-09-12 14:06:27] roberto dot valsania at mail dot wind dot it

I made some another tests with the same environment ( Fedora core 7 and
openldap 2.3.34-3 and sybase ldap names resolution):
- perl with dbi/dbd modules works.
- php works if compiled with 
./configure --enable-debug
--with-sybase=/sbrdbms/sybase/OpenClient15/OCS-15_0/ 
( that means without phpldap extension)

It seems more some kind of incompatibility between php ldap and sybase
ldap



[2007-09-12 13:16:27] roberto dot valsania at mail dot wind dot it

New Tests with different openldap libs :

With fedora 5 and openldap 2.3.19-4 - works
With fedora 7 and openldap 2.3.34-3 - crash

All the other sybase utility works well in all the environments ( eg .
isql )



[2007-09-12 12:29:26] roberto dot valsania at mail dot wind dot it

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



[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



The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/42642

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


#42642 [Opn-Fbk]: sybase_connect crashes when compiled with with-sybase and with-ldap

2007-09-12 Thread jani
 ID:   42642
 Updated by:   [EMAIL PROTECTED]
 Reported By:  roberto dot valsania at mail dot wind dot it
-Status:   Open
+Status:   Feedback
 Bug Type: Sybase (dblib) related
 Operating System: FEDORA CORE 7
 PHP Version:  5CVS-2007-09-12 (snap)
 New Comment:

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..


Previous Comments:


[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='xx';
$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='xx';
$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