httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jim Jagielski <>
Subject Re: Huge memory leak in mod_substitute
Date Fri, 07 Jan 2011 17:54:27 GMT
If what you have substituted is a pattern for a subsequent
match, then you need to worry about flattening.

For example, if you s/cat/dog/ and then later on have
a s/doghouse/shed/ then you need to worry if you had
some places where you went from cathouse -> doghouse due
to the 1st replacement because that 2nd substitution won't
happen for *those* instances.


I put my cat in the cathouse
  -> I put my dog in the doghouse [1st sub]

With flattening you will get:
    -> I put my dog in the shed [2nd sub]

But without it you would get:
    -> I put my dog in the doghouse

because the 'doghouse' acts like 'dog''house' where
there is this imaginary "break" between dog
and house (since there are in different buckets inside

On Jan 7, 2011, at 11:31 AM, Nick Gearls wrote:

> When setting the q flag, I have no more memory leaks.
> And it substitutes all instances on the line; however, it seems we cannot assume it will
always do so :-(
> Btw, I never understood when multiple subst will work with the q flag; does somebody
have an answer?
> For instance,
>  Substitute s/aa/b/q
> works on "aaaaaaaaaaaaaa", even on a 10 KB long with "a".
> Thanks,
> Nick
> On 7/1/2011 15:49, Nick Kew wrote:
>> On Fri, 07 Jan 2011 14:26:35 +0100
>> Nick Gearls<>  wrote:
>>> Hello,
>>> I saw servers completely freezing (the whole system, not only httpd) due
>>> to a memory leak problem in mod_substitute.
>>> This is a major issue as it can completely block your systems, sometimes
>>> even the fail-over as the server is blocked, but not completely down.
>>> Even the management interfaces are blocked.
>>> We reported the problem
>>> (, with a
>>> (scaled-down) reproducible process to trigger it.
>>> Did somebody already begin to work on mod_substitute memory management?
>> The obvious question would be whether the "q" flag affects your
>> observations.  But the detailed bug report suggests that's unlikely.
>> So the second obvious question: have you tried equivalent observations
>> with mod_sed and/or mod_line_edit?

View raw message