Patch to avoid circular link problem with downloads

Andy Gibbs andyg1001@hotmail.co.uk
Fri Jun 18 08:03:00 GMT 2010


On Thursday, June 17, 2010 11:36 PM Yann E. MORIN wrote:


> Andy, All,
>
> On Tuesday 15 June 2010 18:21:53 Andy Gibbs wrote:
>> In my configuration, I'm saving the downloaded files to a local 
>> directory,
>> but crosstool seems to sometimes get out of sync with itself when 
>> restarting
>> again later.  The outcome was that the files in the saved downloads 
>> folder
>> were becoming circular links.
>>
>> [ ... ]
>
> I see what you mean, but I don't understand how it can happen.
>
> [ ... ]
>
> I feel uneasy with that patch. I'd rather that you point to a way I can
> reproduce that symlink-loop-of-death, because I'm really don't see how
> that can happen... But it's late, and I may not be sentient enough tonight
> to be sure I did not miss anything...
>

I take your point and agree with your position.  Certainly your logic is 
inescapable: it seems that for it to fail in the way I've described, it 
would have to first not find the tarball in 'tardir', then try to download 
but fail but think that it succeeded, in order to create the symlink loop. 
Quite a sequence of unlikely events!

I've spent some time trying to reproduce it but unfortunately with no 
success.  It is very possible that I just broke out of crosstool at the 
wrong moment, and when restarting it, it caused this to happen, but I have 
no explainations as to why.  I've only seen it on two separate occassions, 
in I-don't-know-how-many times I've used crosstool in recent weeks, so its 
not a major problem, I think.

I'll happily leave it in your hands: I don't think its a (easily) 
reproducable problem; I don't think it happens at all often; and I've only 
encountered it in situations where the build process is failing for other 
reasons anyway.

However... while writing this email, I have a memory stirring that at that 
time I might have been using 'set -o pipefail' in the parent script that was 
calling crosstool.  This setting causes error codes to return from all parts 
of a command pipe, not just from the last one which is the default.  I'm not 
sure whether this is a setting that persists to sub-shells, but if it does 
then it might just change the logic somewhere.  I should have some time 
early next week: I will see whether I can reproduce it like this...

Regards
Andy


--
For unsubscribe information see http://sourceware.org/lists.html#faq



More information about the crossgcc mailing list