From: Jeff King Date: Thu, 10 Aug 2017 20:05:02 GMT Subject: Re: fatal: Out of memory, getdelim failed under NFS mounts Message-ID: <20170810200502.rutab4z3ft7gcpjz@sigill.intra.peff.net> In-Reply-To: <6d7b0d30-48ea-f79f-78cd-088557ea06ac@web.de> On Thu, Aug 10, 2017 at 09:58:37PM +0200, René Scharfe wrote: > > So the function is returning -1 and leaving ENOMEM in errno on > > Yaroslav's system. > > > > I wonder if we are truly hitting out of memory, though. The same > > symptom could bee seen if getdelim() does not touch errno when it > > returns -1, but some other system call earlier set it to ENOMEM, > > for example. > > That can happen when the end of a file is reached; getdelim() returns > -1 and leaves errno unchanged. So we need to set errno to 0 just > before that call. Good catch. That's a bug in my original conversoin of strbuf_getwholeline(). -Peff