php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #34892 Process hang on LDAP operations
Submitted: 2005-10-17 16:50 UTC Modified: 2005-10-17 18:06 UTC
From: jason at mugfu dot com Assigned:
Status: Not a bug Package: LDAP related
PHP Version: 5.0.5 OS: FreeBSD 6.0 RC1
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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: jason at mugfu dot com
New email:
PHP Version: OS:

 

 [2005-10-17 16:50 UTC] jason at mugfu dot com
Description:
------------
Environment:

- FreeBSD 6.0 RC-1 on AMD64
- OpenLDAP2.2 client libraries on php host
- Connecting to OpenLDAP2.3 on remote host.

When this script is run from the command line, the LDAP operations complete very quickly, without any problem.  When executed via mod_php in Apache2, the php process will timeout everytime.  I have enabled full debug tracing on in the LDAP server (OpenLDAP).  It shows the result being sent back to the client, but the client does not close the connection.  CPU usage on the httpd process handling the web client goes to 100%.  ktrace/kdump show the process to be caught in a continuous loop like this:

 69111 httpd    CALL  select(0x400,0x9e1d00,0x9e1d80,0,0)
 69111 httpd    RET   select 1


Reproduce code:
---------------
Short script:
<?php
error_reporting(E_ALL);

$ds=ldap_connect("192.168.1.11");
echo "connect result is " . $ds . "<br />\n";

if (ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3)) {
   echo "Using LDAPv3<br/>\n";
} else {
   echo "Failed to set protocol version to 3<br/>\n";
}

//Anonymous bind:
$r=ldap_bind($ds);
echo "Bind result is " . $r . "<br />\n";

$sr=ldap_search($ds, "dc=mydomain,dc=com", "(&(objectclass=*))");
echo "Number of entires returned is " . ldap_count_entries($ds, $sr) . "<br />\n";

ldap_close($ds);
?>


Expected result:
----------------
I would expect the command line version, and the version running via mod_php to behave in the same fashion.

Actual result:
--------------
Process timeouts without any other error.  Note that ldap_connect and ldap_set_option behave fine in both environments (I may be wrong, but I don't believe those actually open connections).  It is ldap_bind and ldap_search that cause the issue.  If I comment out ldap_bind, the process hangs on ldap_search.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-10-17 18:06 UTC] jason at mugfu dot com
Withdrawing bug.  Now I can no longer reproduce this problem :/
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed May 01 14:01:31 2024 UTC