You are viewing a plain text version of this content. The canonical link for it is here.
Posted to apache-bugdb@apache.org by Mark Mertel <mm...@ix.netcom.com> on 1997/04/18 09:30:02 UTC

general/413: inoordinate number of 'malformed header from script' errors from cgi perl

	The contract type is `' with a response time of 3 business hours.
	A first analysis should be sent before: Fri Apr 18 11:00:01 PDT 1997


>Number:         413
>Category:       general
>Synopsis:       inoordinate number of 'malformed header from script' errors from cgi perl
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    apache (Apache HTTP Project)
>State:          open
>Class:          sw-bug
>Submitter-Id:   apache
>Arrival-Date:   Fri Apr 18 00:30:01 1997
>Originator:     mmertel@ix.netcom.com
>Organization:
apache
>Release:        1.2b7
>Environment:
NEXTSTEP 3.2
>Description:
I'm developing some cgi programs using perl5.002, and sybperl 2.07 and am having very unpredictable behavior from the httpd server. noe perl errors or problems appear when these programs are run from the command line, however, when I run them from the Web browser, I get numerous 'malformed header from script' errors.
>How-To-Repeat:

>Fix:
could it be a configuration problem %3
>Audit-Trail:
>Unformatted:



Re: general/413: inoordinate number of 'malformed header from script' errors from cgi perl

Posted by Dean Gaudet <dg...@arctic.org>.
Ah ok, makes sense.

Dean

On Fri, 18 Apr 1997, Marc Slemko wrote:

> If anyone does something in perl that uses both perl's output and
> something that exec(3)s something, the perl output will not necessarily be
> flushed before the other output happens.
> 
> eg.
> 
> 	#!/usr/local/bin/crey
> 	print "Content-type: text/plain\n\n";
> 	system("/bin/ls");
> 
> will fail on many systems because the output from ls happens
> before perl flushes its buffers.  A similar thing happens in C
> on many systems.  On some systems, you will never run into
> this problem.
> 
> On Fri, 18 Apr 1997, Dean Gaudet wrote:
> 
> > Why are we recommending $| = 1 all the time?  I've never had to do this in
> > my CGIs.
> > 
> > Dean
> > 
> > On Fri, 18 Apr 1997, Marc Slemko wrote:
> > > Have you checked the error log?  This is almost certainly a bug in your
> > > CGI script.  Try adding "$| = 1;" near the start of your program and be
> > > sure you correctly output the header.  
> > 
> 
> 


Re: general/413: inoordinate number of 'malformed header from script' errors from cgi perl

Posted by Marc Slemko <ma...@znep.com>.
If anyone does something in perl that uses both perl's output and
something that exec(3)s something, the perl output will not necessarily be
flushed before the other output happens.

eg.

	#!/usr/local/bin/crey
	print "Content-type: text/plain\n\n";
	system("/bin/ls");

will fail on many systems because the output from ls happens
before perl flushes its buffers.  A similar thing happens in C
on many systems.  On some systems, you will never run into
this problem.

On Fri, 18 Apr 1997, Dean Gaudet wrote:

> Why are we recommending $| = 1 all the time?  I've never had to do this in
> my CGIs.
> 
> Dean
> 
> On Fri, 18 Apr 1997, Marc Slemko wrote:
> > Have you checked the error log?  This is almost certainly a bug in your
> > CGI script.  Try adding "$| = 1;" near the start of your program and be
> > sure you correctly output the header.  
> 


Re: general/413: inoordinate number of 'malformed header from script' errors from cgi perl

Posted by Dean Gaudet <dg...@arctic.org>.
Why are we recommending $| = 1 all the time?  I've never had to do this in
my CGIs.

Dean

On Fri, 18 Apr 1997, Marc Slemko wrote:
> Have you checked the error log?  This is almost certainly a bug in your
> CGI script.  Try adding "$| = 1;" near the start of your program and be
> sure you correctly output the header.  


Re: general/413: inoordinate number of 'malformed header from script' errors from cgi perl

Posted by Marc Slemko <ma...@znep.com>.
Have you checked the error log?  This is almost certainly a bug in your
CGI script.  Try adding "$| = 1;" near the start of your program and be
sure you correctly output the header.  

On Fri, 18 Apr 1997, Mark Mertel wrote:

> 
> 	The contract type is `' with a response time of 3 business hours.
> 	A first analysis should be sent before: Fri Apr 18 11:00:01 PDT 1997
> 
> 
> >Number:         413
> >Category:       general
> >Synopsis:       inoordinate number of 'malformed header from script' errors from cgi perl
> >Confidential:   no
> >Severity:       critical
> >Priority:       medium
> >Responsible:    apache (Apache HTTP Project)
> >State:          open
> >Class:          sw-bug
> >Submitter-Id:   apache
> >Arrival-Date:   Fri Apr 18 00:30:01 1997
> >Originator:     mmertel@ix.netcom.com
> >Organization:
> apache
> >Release:        1.2b7
> >Environment:
> NEXTSTEP 3.2
> >Description:
> I'm developing some cgi programs using perl5.002, and sybperl 2.07 and am having very unpredictable behavior from the httpd server. noe perl errors or problems appear when these programs are run from the command line, however, when I run them from the Web browser, I get numerous 'malformed header from script' errors.
> >How-To-Repeat:
> 
> >Fix:
> could it be a configuration problem %3
> >Audit-Trail:
> >Unformatted:
> 
>