|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #19434 oci8 + ldap -> crash
Submitted: 2002-09-16 06:49 UTC Modified: 2003-10-19 10:24 UTC
Avg. Score:5.0 ± 0.0
Reproduced:3 of 3 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: ronan dot salmon at staff dot ittralee dot ie Assigned:
Status: No Feedback Package: OCI8 related
PHP Version: 4.3.3RC4-dev OS: redhat 7.3
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: ronan dot salmon at staff dot ittralee dot ie
New email:
PHP Version: OS:


 [2002-09-16 06:49 UTC] ronan dot salmon at staff dot ittralee dot ie
redhat 7.3
kernel 2.4.18-10 i686
oracle 9.0.1
openldap 2.0.23

Configure command :
 './configure' 'i386-redhat-linux' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--prefix=/usr' '--with-config-file-path=/etc' '--enable-force-cgi-redirect' '--disable-debug' '--enable-pic' '--disable-rpath' '--enable-inline-optimization' '--with-bz2' '--with-db3' '--with-curl' '--with-dom=/usr' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--with-gd' '--enable-gd-native-ttf' '--with-ttf' '--with-gdbm' '--with-gettext' '--with-ncurses' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-png' '--with-pspell' '--with-regex=system' '--with-xml' '--with-expat-dir=/usr' '--with-zlib' '--with-layout=GNU' '--enable-bcmath' '--enable-debugger' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-safe-mode' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-discard-path' '--enable-track-vars' '--enable-trans-sid' '--enable-yp' '--enable-wddx' '--without-oci8' '--with-imap=shared' '--with-imap-ssl' '--with-kerberos=/usr/kerberos' '--with-ldap=shared' '--with-mysql=shared,/usr' '--with-oci8=shared,/home/oracle/Oracle-9.0.1' '--enable-sigchild' '--with-pgsql=shared' '--with-snmp=shared,/usr' '--with-snmp=shared' '--enable-ucd-snmp-hack' '--with-unixODBC=shared' '--enable-memory-limit' '--enable-bcmath' '--enable-shmop' '--enable-versioning' '--enable-calendar' '--enable-dbx' '--enable-dio' '--enable-mcal' '--enable-mbstring' '--enable-mbstr-enc-trans' '--with-apxs=/usr/sbin/apxs'

If I use ldap functions only, everything is fine.
If I use oci8 functions only, everything is fine.

If in the same script I use oci8 and ldap functions, apache crashes :
[Mon Sep 16 12:44:39 2002] [notice] child pid 31257 exit signal Segmentation fault (11)

here the script :

	$strLogin = "test";
	$strPasswd = "test";

	$connLDAP = ldap_connect(DEFAULT_LDAP_HOSTNAME);
	if (!$connLDAP)
		echo "Failed to connect to " . DEFAULT_LDAP_HOSTNAME;

	if (!$strPasswd)
		// generate a bogus password to pass if the user doesn't give us one
		// this gets around systems that are anonymous search enabled
		$strPasswd = crypt(microtime());
	// Lookup user
   	$arrInfo = ldap_get_entries($connLDAP, ldap_search($connLDAP, DEFAULT_STAFF_EMAIL_PEOPLE, "uid=$strLogin"));
	$strDN = $arrInfo[0]["dn"];

	$boolLogin = @ldap_bind($connLDAP, $strDN, $strPasswd);
	if (!$boolLogin)
		echo "<BR>Wrong username or password!<P>\n";

	// Logged in successfully
	$DB =  ocilogon($strUser, $strPassword, $strDB);
	if (! $DB)
		$err = OCIError();
		echo "Can not connect to $strDB : $err<B>\n";

	$strSQL = "SELECT * FROM Account_Users WHERE ID = '$strLogin'";
	$stmt = ociparse($DB, $strSQL);
	ociexecute($stmt, OCI_DEFAULT);

	if (ocifetch($stmt))
		echo "Success";
	} else {
		echo "Failed";



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-09-16 07:13 UTC]
Oracle has it's own ldap stuff. You can't compile both openldap and oracle together. But you don't need to:


works too.

 [2002-09-26 20:22 UTC]
Please try using this CVS snapshot:
For Windows:

Reduce your configure options to bare minimum,
only use --with-apxs, --with-oci8 and --with-ldap and
don't compile them as shared!

Do this using the latest snapshot above.

 [2003-07-16 14:31 UTC]
Can you try and reduce your script to smallest possible that causes the crash? (like with only the ldap stuff?)

 [2003-07-17 03:40 UTC] ronan dot salmon at staff dot ittralee dot ie
Sorry, I don't know what I've done yesterday but in fact LDAP doesn't work alone anymore.

Here the script :

	$connLDAP = ldap_connect('');
	if (!$connLDAP)
		echo 'Failed to connect to';

	// Lookup user
	$ldapsearch = ldap_search($connLDAP, 'ou=people,ou=staff,dc=ittralee,dc=ie', "uid=$strLogin");
   	$arrInfo = ldap_get_entries($connLDAP, $ldapsearch);

	$boolLogin = @ldap_bind($connLDAP, $strDN, $strPasswd);
	if (!$boolLogin)
		echo "<BR>Wrong username or password!<P>\n";

I'm using the same php as yesterday.

[~/php]# gdb ./php4-STABLE-200307160330/sapi/cgi/php login.php
(gdb) run login.php
Starting program: /root/php/php4-STABLE-200307160330/sapi/cgi/php login.php
[New Thread 16384 (LWP 23469)]
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 16384 (LWP 23469)]
0x40a71a34 in _int_free () from /lib/
(gdb) bt
#0  0x40a71a34 in _int_free () from /lib/
#1  0x40a709cc in free () from /lib/
#2  0x08065d81 in zif_ldap_get_entries (ht=2, return_value=0x8208040,
    this_ptr=0x0, return_value_used=1, tsrm_ls=0x40d76440)
    at /root/php/php4-STABLE-200307160330/ext/ldap/ldap.c:953
#3  0x0813ce45 in execute (op_array=0x8203028, tsrm_ls=0x81876b0)
    at /root/php/php4-STABLE-200307160330/Zend/zend_execute.c:1616
#4  0x0812f7f1 in zend_execute_scripts (type=8, tsrm_ls=0x81876b0, retval=0x0,
    file_count=3) at /root/php/php4-STABLE-200307160330/Zend/zend.c:886
#5  0x08106305 in php_execute_script (primary_file=0xbffff980,
    tsrm_ls=0x81876b0) at /root/php/php4-STABLE-200307160330/main/main.c:1685
#6  0x08142609 in main (argc=2, argv=0xbffffa14)
    at /root/php/php4-STABLE-200307160330/sapi/cgi/cgi_main.c:1542
#7  0x40a195cd in __libc_start_main () from /lib/
 [2003-10-19 10:24 UTC]
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.

 [2003-11-25 11:29 UTC] pyrox_pro at hotmail dot com
Similar issue, mine happens on Bind.

echo "<BR>Connecting...";
$ds=ldap_connect("ldaps://".$ldap['SERV']."/") or die("<BR>Died.");
echo "<BR> Connection Established: $ds";
echo "<BR> BINDING...";

This results in a page cannot be found.

If I comment this out:
echo "<BR>Connecting...";
$ds=ldap_connect("ldaps://".$ldap['SERV']."/") or die("<BR>Died.");
echo "<BR> Connection Established: $ds";
echo "<BR> BINDING...";

The page comes up and it seems to work fine.

I have let the thing spin forever with no response.

I am using php 4.3.4 and LDAP:

LDAP Support  enabled  
RCS Version  $Id: ldap.c,v 2003/10/07 00:36:27 iliaa Exp $  
Total Links  0/unlimited  
API Version  2004  
Vendor Name  OpenLDAP  
Vendor Version  20026  

OCI8 Support  enabled  
Revision  $Revision: $  
Oracle Version  8.1  
Compile-time ORACLE_HOME  /u01/app/oracle/product/8.1.6  
Libraries Used  no value  

OpenSSL support  enabled  
OpenSSL Version  OpenSSL 0.9.7 31 Dec 2002
 [2003-11-25 11:35 UTC] pyrox_pro at hotmail dot com
I have just confirmed that it is:

[Tue Nov 25 10:15:44 2003] [notice] child pid 25048 exit signal Segmentation fault (11)

The ldap_bind is causing a seg fault.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 17 23:01:27 2024 UTC