httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 43942] - httpd crashes while loading ldap attributes
Date Fri, 07 Dec 2007 13:01:10 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=43942>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=43942


bernd.asf@emskeim.de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #21240|0                           |1
        is obsolete|                            |
         AssignedTo|bugs@httpd.apache.org       |bernd.asf@emskeim.de
             Status|NEEDINFO                    |ASSIGNED




------- Additional Comments From bernd.asf@emskeim.de  2007-12-07 05:01 -------
Created an attachment (id=21242)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=21242&action=view)
Patch - optimized attribute handling

Regardless of the process doesn't crash anymore with correct LDR-CNTRLs I still
 think that this is bug in util_ldap.c

If you look at this piece of code:

-	     while (values && values[j]) {
-		 str = str ? apr_pstrcat(r->pool, str, "; ", values[j], NULL)
-			   : apr_pstrdup(r->pool, values[j]);

So with each iteration an new string is allocated with apr_pstrcat whereas the
old string is not returned to the pool.

In my case I want to retrieve 3'500 attribute values. So this loop has 3'500
iterations and 3'500 strings are allocated, each a bit larger than the one
before. This is exponential memory consumption.

In the end this loop consumes about 760 mb; in my patched version it takes only
about 800 kb. Still not optimal, but much better than before.

Patch now in unified diff format as requested.


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


Mime
View raw message