Bug 61909 - mod_fcgid FCGI_STDERR gets truncated
Summary: mod_fcgid FCGI_STDERR gets truncated
Status: NEW
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mod_fcgid (show other bugs)
Version: 2.4.29
Hardware: PC Linux
: P2 minor (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-12-15 12:29 UTC by Merijn van den Kroonenberg
Modified: 2017-12-15 12:35 UTC (History)
1 user (show)



Attachments
fix to write the entire stderr to the logfile (6.12 KB, patch)
2017-12-15 12:35 UTC, Merijn van den Kroonenberg
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Merijn van den Kroonenberg 2017-12-15 12:29:53 UTC
When a process sends large amounts of errorlog (stderr) to mod_fcgid only the first APR_BUCKET_BUFF_SIZE (8000 bytes) get written to the log.

For me this happens when running php with mod_fcgid, sometimes i log stacktraces to the error_log and this can easily exceed 8k when a few notices/warnimgs/errors occur. So I am missing debug information.

It is pretty easy to reproduce by sending a large amount of data to stderr in the handling process.
Comment 1 Merijn van den Kroonenberg 2017-12-15 12:35:43 UTC
Created attachment 35615 [details]
fix to write the entire stderr to the logfile

fcgid_bucket.c: changed the FCGI_STDERR handling so it keeps reading STDERR data in multiple batches if the internal buffersize of APR_BUCKET_BUFF_SIZE (8000 bytes) is exceeded. It tries to prevent chopping up lines in stderr so there are no broken up lines in the error log. 

We are using this in production for 2 months now.