https://bz.apache.org/bugzilla/show_bug.cgi?id=64096

            Bug ID: 64096
           Summary: mod_cgi leaks memory after timeouts
           Product: Apache httpd-2
           Version: 2.4.39
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: mod_cgi
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: ---

There is a weird edge case in which mod_cgi 2.4.x leaks memory. 

Basically, if a timeout happens and the request goes through the
`discard_script_output` function, the entire output of the cgi script is
buffered into memory.

This is actually fixed in trunk in r1867970 but would be helpful to cherry-pick
this particular fix (1-line change) to 2.4.x. 

The comment from r1867970 (
https://svn.apache.org/viewvc/httpd/httpd/trunk/modules/generators/cgi_common.h?revision=1867970&view=markup
): 

> * modules/generators/cgi_common.h (discard_script_output): Simplify
>   slightly and ensure constant rather than unlimited memory
>   consumption when discarding CGI script output (for e.g. a redirect
>   response).

As far as I can tell before this change (e.g. 2.4.x currently), this function
not only consumes unlimited memory but retains it forever. I'll post the
example conf and CGI script I used to test that.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to