Re: [PATCH] git-svn: workaround for a bug in svn serf backend
- From
Roman Kagan <rkagan@mail.ru>
- Date
- Dec 27, 2013, 06:09 UTC
- Message-ID
- <CANiYKX6VA2KvJ_YWYOegb6+VFg_unL96P9qUBthYPFuo9fhAMA@mail.gmail.com>
- In-Reply-To
- <20131226202805.GV20443@google.com>
2013/12/27 Jonathan Nieder <jrnieder@gmail.com>:
Show 8 quoted lines
> Roman Kagan wrote: > >> Subversion serf backend in versions 1.8.5 and below has a bug that the >> function creating the descriptor of a file change -- add_file() -- >> doesn't make a copy of its 3d argument when storing it on the returned > > 3d makes me think of 3-dimensional. ;-) I think you mean third > (or the abbreviation 3rd).
Indeed.
Show 5 quoted lines
>> descriptor. As a result, by the time this field is used (in >> transactions of file copying or renaming) it may well be released. > > Please describe the symptom so this patch is easy to find when other > people run into it.
OK
> Do I remember correctly that "... released and scribbled over with a > new value, causing such-and-such assertion to fire" was what happened?
Exactly.
Show 7 quoted lines
>> This patch works around this bug, by storing the value to be passed as >> the 3d argument to add_file() in a local variable with the same scope as >> the file change descriptor, making sure their lifetime is the same. > > Could this be reproduced with a test script to make sure we don't > reintroduce the bug again later? (It's okay if the test only fails on > machines with the problematic svn version.)
That would need a fairly fancy setup phase, as the bug triggers only on http(s)-accessed svn repositories. I'll take a look if there's something already available in the existing test scripts; writing one from scratch for this specific case is IMO beyond the reasonable effort.
> Modulo the confusing 3-dimensional arguments in comments, the code > change looks good.
Thanks, I'll adjust the wording and resubmit.
Roman.