Re: What's cooking in git.git (Nov 2016, #06; Mon, 28)
- From
Jeff King <peff@peff.net>
- Date
- Nov 30, 2016, 23:32 UTC
- Message-ID
- <20161130233204.ihbrjwwu3yiv4ugq@sigill.intra.peff.net>
- In-Reply-To
- <20161130232823.GA192901@google.com>
On Wed, Nov 30, 2016 at 03:28:23PM -0800, Brandon Williams wrote:
Show 7 quoted lines
> So I couldn't find a race condition in the code. I tracked the problem > to grep_source_load_file which attempts to run lstat on the file so that > it can read it into a buffer. The lstat call fails with ENOENT (which > conveniently is skipped by the if statement which calls error_errno). So > for some reason the file cannot be found and read into memory resulting > in nothing being grep'ed for that particular file (since the buffer is > NULL).
That's definitely weird. Is it possible that any of the underlying calls from another thread are using chdir()? I think realpath() make do that behind the scenes, and there may be others.
A full strace from a failing case would be interesting reading. In theory we should be able to get that by running the stress script for long enough. :)
-Peff