bug-wget
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-wget] [bug-wget] Segfault when trying to use metalinks


From: Ángel González
Subject: Re: [Bug-wget] [bug-wget] Segfault when trying to use metalinks
Date: Wed, 11 Sep 2013 21:13:33 +0200
User-agent: Thunderbird

On 11/09/13 07:13, Darshit Shah wrote:
I have debugged this a little further.

        I bet an assert(i < opt.jobs <http://opt.jobs>); at
        multi.c:148 would fail.
        I'm not sure how this code is supposed to work, but work from
        there.

    Even, I'm not very aware of the code, but it does seem like the
    problem  lies there. All the traces point to it.

assert (i < opt.jobs <http://opt.jobs>) would be wrong, since this region of the code is simply calculating the range values based on the chunk_size. A new thread for each range is not being spawned.

The issue was that struct range is defined with int variables, and for file sizes > 4GB, there was an integer overflow. Replacing int with wgint fixes the segfault. However, valgrind continues to throw all those invalid write errors, which leads me to believe that the issue is much deeper than this, but I have no idea on where to start debugging this.

The struct would have opt.jobs <http://opt.jobs> items from a quickly read of the code, that's why I suggested such assert. The increments to the variable i are unbounded, that's why there are writes outside the array.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]