Comment 13 for bug 238089

Revision history for this message
In , Pavel (pavel-redhat-bugs) wrote :

Found the root cause of the problem.

PartsBatch class has inconsistent storage for Parts. For each new batch, it does
not clear() the 'parts' variable, but only resize()s it if the new batch is
bigger (pan/data/parts.cc, lines 307 and 316). If the new batch is smaller than
the previous, extra entries are untouched.

The problem happens when pan attempts to sort the full vector
(pan/tasks/nzb.cc:128), thus possibly mixing the parts from the current batch
with the parts from the previous batches.

The solution is to clear() the 'parts' vector on each init(), then push_back()
the new parts in add_part, so the vector size always corresponds to the real
number of found parts.