[pacman-dev] [BUG] segfault when the download fails

Dan McGee dpmcgee at gmail.com
Thu Dec 6 19:39:20 EST 2007


On Dec 6, 2007 6:24 PM, Aaron Griffin <aaronmgriffin at gmail.com> wrote:
> On Dec 6, 2007 5:46 PM, Xavier <shiningxc at gmail.com> wrote:
> > [00:27:01] debug: using 'hunspell-1.2.1-2-i686.pkg.tar.gz'
> > [00:27:02] debug: using 'openoffice-fr-2.3.1-1-i686.pkg.tar.gz'
> > [00:27:02] debug: using 'hunspell-1.2.1-2-i686.pkg.tar.gz'
>
> A cursory look here shows something important. We have the following logic:
>
> for s in servers:
>     for f in files:
>         if cant_get_file: continue
>
> Well that's just not right - we want to pop out to the parent loop,
> not move to the next file
>
> While that's wrong and all, it's actually not really the error... I
> mean, just looking at it... it should still WORK in this case, just
> much slower due to extra loop iterations.

It is terrible logic and just screams for a rewrite. I might do this
tonight if the bar doesn't call my name.

> My guess? There's an alpm_list_free inside the "for s in servers" loop
> that should probably be OUTSIDE it, unless that's a totally different
> bug, but I'd expect the list_free that DOESN'T null out the pointer is
> going to re-add without reallocating and blow up like this.

Yeah, worth looking for.

-Dan




More information about the pacman-dev mailing list