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

Aaron Griffin aaronmgriffin at gmail.com
Thu Dec 6 19:24:55 EST 2007

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.

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.

More information about the pacman-dev mailing list