Bug 60353 - Uploading a large file causes mod_fcgid to overuse memory and eventually crash
Summary: Uploading a large file causes mod_fcgid to overuse memory and eventually crash
Status: RESOLVED DUPLICATE of bug 51747
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mod_fcgid (show other bugs)
Version: 2.5-HEAD
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-08 14:22 UTC by Oz Gilat
Modified: 2018-11-28 08:59 UTC (History)
0 users



Attachments
upload script (288 bytes, application/x-httpd-php)
2016-11-08 14:22 UTC, Oz Gilat
Details
proposed patch (2.89 KB, patch)
2016-11-08 14:22 UTC, Oz Gilat
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Oz Gilat 2016-11-08 14:22:07 UTC
Created attachment 34428 [details]
upload script

Hi,

When i'm uploading a large file (~270 MB) using the attached script (upload.php), mod_fcgid tries to send it to the PHP process and causes a crash in httpd.exe.
The proc_write_ipc function gets the apr_bucket_brigade list and sends the buckets one by one to the PHP process and is using a lot of memory until a point where 'malloc' returns NULL (through allocator_alloc ) and httpd immediately crashes.

I've attached a suggestion for a patch to this function where the httpd is using significantly less memory and the crash is gone. It basically frees each apr_bucket after it is sent to the php process. 

thanks!
Comment 1 Oz Gilat 2016-11-08 14:22:50 UTC
Created attachment 34429 [details]
proposed patch
Comment 2 Joe Orton 2018-11-28 08:59:43 UTC

*** This bug has been marked as a duplicate of bug 51747 ***