Bug 184161

Summary: ktorrent 2.2.8 logfiles race
Product: [Applications] ktorrent Reporter: Jaak Ristioja <jaak>
Component: generalAssignee: Joris Guisson <joris.guisson>
Status: RESOLVED INTENTIONAL    
Severity: normal    
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Jaak Ristioja 2009-02-12 18:09:38 UTC
Version:           2.2.8 (using KDE 3.5.10)
Compiler:          gcc 4.1.2 
OS:                Linux
Installed from:    Gentoo Packages

When I leave KTorrent 2.2.8 running for some days, its log files get full and
get rotated. Unfortunately sometimes a KDE dialog appears asking whether to
overwrite "log-1" with "log" (if I remember it correctly). Anyway, without user
interaction (leaving the dialog open), KTorrent appears to start to consume
large amounts of memory, which could render the machine unresponsive. Tracing
the source code lead me to a part in libktorrent/util/autorotatelogjob.cpp
which appears to try to move a file twice, resulting in a race:

if (cnt == 1)
{
        // move current log to 1 and zip it
    bt::Move(file,file + "-1",true);
    KIO::Job* sj =
KIO::file_move(KURL::fromPathOrURL(file),KURL::fromPathOrURL(file +
"-1"),-1,true,false,false);
    connect(sj,SIGNAL(result(KIO::Job*)),this,SLOT(moveJobDone(KIO::Job* )));
}

Originally reported at http://ktorrent.org/forum/viewtopic.php?t=2816 and https://bugs.gentoo.org/show_bug.cgi?id=255068#add_comment and now this got directed here.
Comment 1 Joris Guisson 2009-02-12 18:37:59 UTC
2.2 series is no longer being developed, so WONTFIX