Bug 20111 - CGI-script can break error-log
Summary: CGI-script can break error-log
Status: RESOLVED FIXED
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mod_cgi (show other bugs)
Version: 2.0.45
Hardware: PC FreeBSD
: P3 normal (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-05-21 12:55 UTC by Sander Holthaus
Modified: 2004-11-22 08:08 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sander Holthaus 2003-05-21 12:55:07 UTC
When debugging a cgi perl script, all cgi-error-logging broke down. The script 
worked flawlessly, but the parameters it outputted through warn's were not 
logged..
A graceful or restart did not fix the issue, I had to stop and start Apache to 
get it all going again. The strange thing is that only output from cgi's was 
broken, 404's were still logged.

I stumbled against this problem a few versions ago too, but was never able to 
reproduce the problem.
Comment 1 Sander Holthaus 2003-05-21 13:04:02 UTC
It seems that stop - start doesn't help either, you need to change the error-
logfile (forgot that I did that, sorry).
Comment 2 Sander Holthaus 2003-05-21 15:36:20 UTC
OK, figured it out. The errorlog does not seem to break (eg. other cgi-scripts 
and stuff can write to it, no restart neccesary), the bug is caused something I 
didn't look at (since is worked in previous versions).

The error-log does not seem to be outputted when writing out a Location header.
My script ends with:

print "Location http://www.mysite.com/succes.html\n\n";

exit;

This code worked up to 2.0.43, but as of 2.0.45 it doesn't. If I quote out this 
line I get an error 500 (since nothing is outputted to the browser), but 
everything gets written to the error-log.
Comment 3 Joe Orton 2004-05-05 19:44:31 UTC
Was that using an nph- script?  Bug 18348 concerns loss of stderr output from
nph- scripts.
Comment 4 Joe Orton 2004-11-22 17:08:17 UTC
Ah, no, you had tracked it down correctly.  This is harder to hit with 2.0.50
and later which have the "CGI bucket" changes, but the remaining case is fixed
on the trunk:

http://svn.apache.org/viewcvs.cgi/httpd/httpd/trunk/modules/generators/mod_cgi.c?rev=106195&r1=106103&r2=106195

Thanks for the report.