Re: [PATCH] read-cache: avoid git_path() race in freshen_shared_index()

2017-04-11 Thread Devan Lucas
Sent from my iPhone

Re: [PATCH] read-cache: avoid git_path() race in freshen_shared_index()

2017-04-01 Thread Jeff King
On Thu, Mar 30, 2017 at 04:24:40PM +0700, Duy Nguyen wrote: > On Thu, Mar 30, 2017 at 12:56 AM, Jeff King wrote: > > But in the end it doesn't really matter. I think code like: > > > > const char *filename = git_path(...); > > > > or > > > > nontrivial_function(git_path(...)); > > > > is an a

Re: [PATCH] read-cache: avoid git_path() race in freshen_shared_index()

2017-03-30 Thread Junio C Hamano
Christian Couder writes: > On Wed, Mar 29, 2017 at 7:56 PM, Jeff King wrote: > ... >> Yeah, it looks like that is what happened. I see that Christian bisected >> the rebase to find the commit in the series that introduces the problem. >> I'm mildly curious which commit upstream created the probl

Re: [PATCH] read-cache: avoid git_path() race in freshen_shared_index()

2017-03-30 Thread Duy Nguyen
On Thu, Mar 30, 2017 at 12:56 AM, Jeff King wrote: > But in the end it doesn't really matter. I think code like: > > const char *filename = git_path(...); > > or > > nontrivial_function(git_path(...)); > > is an anti-pattern. It _might_ be safe, but it's really hard to tell > without following

Re: [PATCH] read-cache: avoid git_path() race in freshen_shared_index()

2017-03-30 Thread Christian Couder
On Wed, Mar 29, 2017 at 7:56 PM, Jeff King wrote: > On Wed, Mar 29, 2017 at 10:06:52AM -0700, Junio C Hamano wrote: > >> > This shows that we should be careful not to use git_path() in >> > freshen_shared_index(). It is using a shared buffer that can >> > too easily lead to races. >> >> The impres

Re: [PATCH] read-cache: avoid git_path() race in freshen_shared_index()

2017-03-29 Thread Jeff King
On Wed, Mar 29, 2017 at 10:06:52AM -0700, Junio C Hamano wrote: > > This shows that we should be careful not to use git_path() in > > freshen_shared_index(). It is using a shared buffer that can > > too easily lead to races. > > The impression I get from the symptom is that after git_path() is >

Re: [PATCH] read-cache: avoid git_path() race in freshen_shared_index()

2017-03-29 Thread Junio C Hamano
Christian Couder writes: > When performing an interactive rebase in split-index mode, > the commit message that one should rework when squashing commits > can contain some garbage instead of the usual concatenation of > both of the commit messages. OK, that is an understandable explanation of wh

[PATCH] read-cache: avoid git_path() race in freshen_shared_index()

2017-03-29 Thread Christian Couder
When performing an interactive rebase in split-index mode, the commit message that one should rework when squashing commits can contain some garbage instead of the usual concatenation of both of the commit messages. When bisecting it appears that 94c9b5af70 (Merge branch 'cc/split-index-config', 2