Bug 24991

Summary: mod_proxy_http leaks memory when using HTTP POST requests
Product: Apache httpd-2 Reporter: Larry Toppi <l_toppi>
Component: mod_proxyAssignee: Apache HTTPD Bugs Mailing List <bugs>
Status: CLOSED FIXED    
Severity: critical Keywords: PatchAvailable
Priority: P3    
Version: 2.0.48   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Attachments: Fixed EOS bucket leak in proxy_http.c

Description Larry Toppi 2003-11-25 21:32:38 UTC
When reverse proxying a web page using the ProxyPass directive, Apache leaks 
memory when running the JMeter stress test tool using HTTP POST requests.  
This does not happen with HTTP GET requests.

Sample config:

<VirtualHost *:81>
	ServerName <your-server-name>
	<Location />
		ProxyPass http://localhost/
	</Location>
</VirtualHost>
Comment 1 Larry Toppi 2003-12-09 21:35:43 UTC
Created attachment 9470 [details]
Fixed EOS bucket leak in proxy_http.c
Comment 2 Jeff Trawick 2003-12-09 21:52:21 UTC
the patch looks simple (and correct) enough...  

any idea if the short-circuit test for EOS just above this leaks that bucket too?

I'm referring to this logic:

if (APR_BUCKET_IS_EOS(APR_BRIGADE_FIRST(bb))) {
                break;
            }

It looks to me like that simple brigade will get leaked in that condition.

I'm re-opening the bug and adding the PatchAvailable keyword; until somebody
commits your fix to 2.1-dev, it should be visible by everybody as something to
work on.
Comment 3 Cliff Woolley 2003-12-09 22:37:54 UTC
> I'm referring to this logic:
> if (APR_BUCKET_IS_EOS(APR_BRIGADE_FIRST(bb))) {
>                 break;
>             }
> It looks to me like that simple brigade will get leaked in that condition.

Not necessarily completely leaked, though it might live longer than one could 
hope for.  As long as the bucket remains in its brigade, the bucket and brigade 
will get killed off when the pool associated with the brigade is cleaned up.
Comment 4 Jeff Trawick 2003-12-09 22:51:37 UTC
Thanks for clarifying, Cliff!

I'm +1 for the patch.  That was my only dangling question.
Comment 5 Jeff Trawick 2003-12-10 19:57:32 UTC
thanks for the patch!

commited to 2.1-dev, proposed for merging to stable branch for 2.0.next
Comment 6 Jeff Trawick 2003-12-14 00:18:19 UTC
patch now committed to stable branch for 2.0.next