Re: Bug report

Gerrit Pape <[email protected]> Mon, 28 Feb 2005 15:18:38 +0000
Newsgroups gmane.comp.web.fnord
Message-ID <20050228151611.32028.qmail@f8bcdf2e660f26.315fe32.mid.smarden.org>
--ibTvN161/egqYuK8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Fri, Feb 25, 2005 at 10:55:12AM +0200, Dale Gallagher wrote:
> Felix von Leitner wrote:
> >I don't remember hearing of this failure mode before.
> >How can I reproduce it?
> 
> This is what happens. Start fnord directly like so: ./run so I have 
> output to the terminal. Then I can browse the offline copy of cr.yp.to 
> for perhaps 20-30 pages before a fnord process starts hogging memory and 
> doesn't exit. Other subsequent requests (ie other fnord processes) seem 
> to serve content and exit, as expected, but the hanging fnord process 
> doesn't exit. So this issue is intermittent. I don't have much 

This sounds like
 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=292376

Contributed fix in
 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=293436

Regards, Gerrit.

--ibTvN161/egqYuK8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="sendfile-type.diff"

Fix infinite loop in sendfile loop (thx Joachim Berdal Haga, see #293436).

--- httpd.c.org	2005-02-15 10:58:27.000000000 +0000
+++ httpd.c	2005-02-15 10:58:44.000000000 +0000
@@ -1242,7 +1242,7 @@
       off_t l=rangeend-rangestart;
       do {
 	off_t c;
-	c=(l>(1<<31))?1<<31:l;
+	c=(l>(1UL<<31))?1UL<<31:l;
 	if (sendfile(1,fd,&offset,c)==-1) break;
 	l-=c;
       } while (l);

--ibTvN161/egqYuK8--