Bug 184161 - ktorrent 2.2.8 logfiles race
Summary: ktorrent 2.2.8 logfiles race
Status: RESOLVED INTENTIONAL
Alias: None
Product: ktorrent
Classification: Applications
Component: general (other bugs)
Version First Reported In: unspecified
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Joris Guisson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-12 18:09 UTC by Jaak Ristioja
Modified: 2009-02-12 18:37 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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