www-apache-bugdb mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gerd Knops <ge...@BITart.com>
Subject mod_cgi/2894: cgi triggers premature EOF to be sent to client
Date Mon, 24 Aug 1998 04:47:06 GMT

>Number:         2894
>Category:       mod_cgi
>Synopsis:       cgi triggers premature EOF to be sent to client
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    apache
>State:          open
>Class:          sw-bug
>Submitter-Id:   apache
>Arrival-Date:   Sun Aug 23 21:50:00 PDT 1998
>Originator:     gerti@BITart.com
>Release:        1.3.1
Hi Guys,

Sorry, this is going to be vague, but maybe it rings a bell somewhere.

A cgi script working perfectly fine with 1.2.x suddenly started failing. The script sends
a number of fixed size files from a floppy to a java applet.

The Java applet receives a premature EOF, which in turn causes apache to send a SIGTERM to
the CGI.

Here is the code in the CGI that sends the files:

	foreach my $file (@files)
		my $mtime=(stat("$floppy/$file"))[9];
		print "$file\t$mtime\r\n";
		my $buf="";
			die("$0: Error reading 4608 bytes from $floppy/$file");
		close(IN) || die("$0: Close failed for $floppy/$file");
		print $buf;

The CGI doesn't produce any error messages. To make things more bizar, calling the CGI a number
of times makes it fail later and later in the process, until it finally works. Remount the
floppy, and the problems start over.

I thought it might have to do with me sending binary data, so I replaced the "print $buf;"
with "print '-' x 4608;", but the behavior was the same.

I guess it has to do woth apache now sending the output from the CGI unbuffered, but I am
at a total loss to even figure out what or where it goes wrong.

The only thing changed since the script used to work was apache.

Setting $! to 0 or 1 in perl doesn't make any difference.

I'd be very thankful for any pointers.



[In order for any reply to be added to the PR database, ]
[you need to include <apbugs@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!         ]

View raw message