You are viewing a plain text version of this content. The canonical link for it is here.
Posted to apache-bugdb@apache.org by Richard Porter <ri...@citizen1.com> on 1999/03/03 01:23:27 UTC

general/3986: Premature end of script headers

>Number:         3986
>Category:       general
>Synopsis:       Premature end of script headers
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    apache
>State:          open
>Class:          sw-bug
>Submitter-Id:   apache
>Arrival-Date:   Tue Mar  2 16:30:00 PST 1999
>Last-Modified:
>Originator:     richard@citizen1.com
>Organization:
apache
>Release:        Server version: Apache/1.3.3 (Unix)
>Environment:
SunOS xxx 5.5.1 Generic_103640-21 sun4u sparc SUNW,Ultra-1

I didn't build the distribution, our sysadmin did. If you'd like more information about the compiler and any compilation options, please let me know and I'll forward your request to him.
>Description:
I've seen a lot of coverage of this error, and the responses from most people seem to be dismissive. Both, "you can't program" and "this is a configuration error" are quite popular sentiments.

Well, I certainly can program (though I'm no expert at CGI) and I doubt a configuration error would be intermittent in the fashion of this one.

This is a production machine, so we're a bit reluctant to throw 1.3.4 at it until we've had a chance to test it out. If this is a bug in Apache that has been fixed in that version (and not reported in the release notes) please advise.
>How-To-Repeat:
Please run the following Java file with a command line parameter of
http://www.citeline.com/cgi-bin/coyote

import java.io.*;
import java.net.*;

public class load {
  public static void main(String[] args) throws Exception {
    if (args.length != 1) {
      System.out.println("Usage: java load URL");
      System.exit(0);
    }

    int i = 1;
    int j = 1;
    while (true) {
      try {
        URL url = new URL(args[0]);
        HttpURLConnection http = (HttpURLConnection) url.openConnection();
        http.setRequestMethod("GET");
        http.connect();
          
        BufferedReader br = new BufferedReader(new InputStreamReader((InputStream)http.getInputStream()));
      
        for (String s = br.readLine();
             s != null;
             s = br.readLine())
          System.out.println(s + i++);

        http.disconnect();
      }
      catch (FileNotFoundException fnfe) {
        System.out.println("\tfailure" + j++);
      }
    }
  }
}

The script called by this file is the following:

#!/usr/bin/perl

$oldpipe = $|;
$| = 1;
print "Content-type: text/html\r\n\r\n";
print "hello world";
$| = $oldpipe;
>Fix:

>Audit-Trail:
>Unformatted:
[In order for any reply to be added to the PR database, ]
[you need to include <ap...@Apache.Org> in the Cc line ]
[and leave the subject line UNCHANGED.  This is not done]
[automatically because of the potential for mail loops. ]
[If you do not include this Cc, your reply may be ig-   ]
[nored unless you are responding to an explicit request ]
[from a developer.                                      ]
[Reply only with text; DO NOT SEND ATTACHMENTS!         ]