Bug 34618 - mod_ldap in 2.0.54 breaks with OpenLDAP < 2.2.21
Summary: mod_ldap in 2.0.54 breaks with OpenLDAP < 2.2.21
Status: RESOLVED FIXED
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mod_auth_ldap (show other bugs)
Version: 2.0.54
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords:
: 34620 34705 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-04-26 11:52 UTC by Vincent MATHIEU
Modified: 2005-08-18 03:05 UTC (History)
3 users (show)



Attachments
switch to connection timout per ldap connection (1.97 KB, patch)
2005-04-28 23:06 UTC, Brad Nicholes
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Vincent MATHIEU 2005-04-26 11:52:38 UTC
Since I upgraded httpd from 2.0.53 to 2.0.54, I have frequently segmentation
faults (redhat 7.3).

My httpd execute libphp4.so.

If I run this little script php, I generate the problem systematically :
for($i=0;$i<1000;$i++){
   $l = ldap_connect("ldap.univ.fr");
} 

(ldap.univ.fr doesn't exists).

If I compile httpd-2.0.54 with util_ldap.c from httpd-2.0.53 version, the
problem  disappear
Comment 1 Joe Orton 2005-04-28 17:28:28 UTC
*** Bug 34620 has been marked as a duplicate of this bug. ***
Comment 2 Joe Orton 2005-04-28 17:30:04 UTC
Brad Nicholes requested that someone test this patch:

http://svn.apache.org/viewcvs/httpd/httpd/trunk/modules/ldap/util_ldap.c?rev=164919&r1=164918&r2=164919&view=diff
Comment 3 Vincent MATHIEU 2005-04-28 21:36:00 UTC
(In reply to comment #2)
> Brad Nicholes requested that someone test this patch:
> 
>
http://svn.apache.org/viewcvs/httpd/httpd/trunk/modules/ldap/util_ldap.c?rev=164919&r1=164918&r2=164919&view=diff

I try to execute this patch (with 2.0.54 util_ldap.c).
I have an error during patch executing :

File to patch: util_ldap.c
patching file util_ldap.c
Hunk #1 FAILED at 247.
Hunk #2 succeeded at 321 (offset -9 lines).
Hunk #3 FAILED at 1784.
Hunk #4 FAILED at 1917.
3 out of 4 hunks FAILED -- saving rejects to file util_ldap.c.rej
Comment 4 Joe Orton 2005-04-28 22:11:41 UTC
Brad, can you provide a patch which applies to 2.0.x which mod_ldap users can test?
Comment 5 Brad Nicholes 2005-04-28 23:06:41 UTC
Created attachment 14873 [details]
switch to connection timout per ldap connection

Test the ldap connection timeout on a per connection basis rather than global
Comment 6 Vincent MATHIEU 2005-04-29 11:53:47 UTC
(In reply to comment #5)
> Created an attachment (id=14873) [edit]

Good!
I compiled apache2.0.54 with your patch.
I do not have any more segmentation faults

Thank's
Comment 7 Brad Nicholes 2005-04-29 16:44:12 UTC
Created backport proposal in the STATUS file.  Just waiting for the three +1 
votes.
Comment 8 Joe Orton 2005-05-04 14:03:14 UTC
*** Bug 34705 has been marked as a duplicate of this bug. ***
Comment 9 Justo Alonso 2005-05-05 17:47:43 UTC
I installed the patch and compiled it, and at first it seemed to work. But I do
some tests, works, and then if some time passes from the last test and I make a
new one, the apache process hangs.

I think that the ldap connection pool has some issues with the connection
timeouts and that makes the apache process to be unresponsive,
Comment 10 Brad Nicholes 2005-05-18 22:04:40 UTC
The patch has been backported to 2.0.55-dev
Comment 11 Joshua 2005-07-12 04:02:10 UTC
i tried the patch with apache 2.0.54 and recompiled. I still getseg faults in
the error log

[Tue Jul 12 11:57:52 2005] [notice] child pid 24029 exit signal Aborted (6)
[Tue Jul 12 11:57:54 2005] [notice] child pid 23956 exit signal Segmentation
fault (11)

any ideas
Comment 12 Markus Schuh 2005-07-19 19:28:02 UTC
I tried the patch on a LDAP enabled apache-2.0.54 on SuSE Enterprise Linux 9 
but get more segmentation faults afterwards. This apache was compiled against 
the builtin openldap 2.2.6 in SLES9.

After installation of openldap-2.2.27 and recompilation of apache against this 
version the segmentation faults are gone.

This seems to be related to the following patch in openldap 2.2.20

http://www.openldap.org/its/index.cgi/Software%20Bugs?
id=3487;expression=TIMEOUT;casesensitive=1;usearchives=1;statetype=-1
Comment 13 Broughan 2005-07-22 06:18:18 UTC
We also applied the patch to 2.0.54 and the segmentation fault errors appeared 
again, although less frequent. I see there was a bug fixed in openldap, we use 
mod_ldap and auth_ldap, should we be using openldap?
Comment 14 Brad Nicholes 2005-07-22 08:57:59 UTC
Yes, you need to update OpenLDAP

(In reply to comment #13)
> We also applied the patch to 2.0.54 and the segmentation fault errors 
appeared 
> again, although less frequent. I see there was a bug fixed in openldap, we 
use 
> mod_ldap and auth_ldap, should we be using openldap?

Comment 15 Broughan 2005-08-17 03:59:52 UTC
We are having the same problem with Microsoft Active Directory Service (Windows 
2000), we don't use OpenLDAP.

We did the patch on 2.0.54 but didn't help. So we're looking for a Windows 2000 
bug now?

Is this bug closed because it works with OpenLDAP server? Can anyone else test 
on Windows 2000?


(In reply to comment #14)
> Yes, you need to update OpenLDAP
> (In reply to comment #13)
> > We also applied the patch to 2.0.54 and the segmentation fault errors 
> appeared 
> > again, although less frequent. I see there was a bug fixed in openldap, we 
> use 
> > mod_ldap and auth_ldap, should we be using openldap?

Comment 16 Joe Orton 2005-08-18 11:05:08 UTC
Broughan, this bug concerns a specific issue with OpenLDAP introduced in 2.0.54
which is now fixed for 2.0.55.

Bug 18334 seems to be a generic "problems with Microsoft LDAP SDK" bug.