From: Jeff King Date: Tue, 25 Oct 2011 15:37:20 GMT Subject: Re: general protection faults with "git grep" version 1.7.7.1 Message-ID: <20111025153720.GA6640@sigill.intra.peff.net> In-Reply-To: <201110251550.22248.trast@student.ethz.ch> On Tue, Oct 25, 2011 at 03:50:21PM +0200, Thomas Rast wrote: > That being said, I'm not entirely convinced that the code in > builtin/grep.c works in the face of memory pressure. It guards > against concurrent access to read_sha1_file() with the > read_sha1_mutex, but any call to xmalloc() outside of that mutex can > still potentially invoke the try_to_free_routine. Maybe one of the > pack experts can say whether this is safe. (However, I implemented > locking around try_to_free_routine as a quick hack and it did not fix > the issue discussed in the bug report.) Yes, I think it needs to set try_to_free_routine. See this thread: http://thread.gmane.org/gmane.comp.version-control.git/180446 which discusses a possible subtlety with doing so. -Peff