From: Junio C Hamano Date: Mon, 22 Mar 2010 20:25:23 GMT Subject: Re: [PATCH] http-backend: Don't infinite loop during die() Message-ID: <7vhbo885os.fsf@alter.siamese.dyndns.org> In-Reply-To: <20100322142204.GB8916@spearce.org> "Shawn O. Pearce" writes: > If stdout has already been closed by the CGI and die() gets called, > the CGI will fail to write the "Status: 500 Internal Server Error" to > the pipe, which results in die() being called again (via safe_write). > This goes on in an infinite loop until the stack overflows and the > process is killed by SIGSEGV. Before looking at the code I first thought "wouldn't we have the same problem in die(), and shouldn't we have "dying" flag there?" but I was stupid as usual ;-) The patch looks sane. Thanks.