Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 255068 - net-p2p/ktorrent-2.2.8 logfiles race
Summary: net-p2p/ktorrent-2.2.8 logfiles race
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Ioannis Aslanidis (RETIRED)
URL: http://ktorrent.org/forum/viewtopic.p...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-15 17:19 UTC by Jaak Ristioja
Modified: 2009-02-16 20:48 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
ktorrent-logfile-race.diff (ktorrent-lograce.diff,477 bytes, patch)
2009-01-15 17:20 UTC, Jaak Ristioja
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jaak Ristioja 2009-01-15 17:19:09 UTC
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* )));
}
Comment 1 Jaak Ristioja 2009-01-15 17:20:54 UTC
Created attachment 178605 [details, diff]
ktorrent-logfile-race.diff

A patch which will hopefully resolve this.
Comment 2 Jeroen Roovers (RETIRED) gentoo-dev 2009-01-15 17:45:52 UTC
.
Comment 3 Ioannis Aslanidis (RETIRED) gentoo-dev 2009-02-12 16:29:43 UTC
For what I cant tell, this is an upstream bug, so the proper place to report this is bugs.kde.org. In any case, check whether the 3.x.x versions still show this problem.
Comment 4 Jaak Ristioja 2009-02-12 17:19:28 UTC
(In reply to comment #3)
> For what I cant tell, this is an upstream bug, so the proper place to report
> this is bugs.kde.org. In any case, check whether the 3.x.x versions still show
> this problem.
> 

I won't install an unstable KDE 4 for KTorrent version 3. A similar bug, but not the quite the same for that is reported here: https://bugs.kde.org/show_bug.cgi?id=168874

For version 2.2.8, I reported the bug here: https://bugs.kde.org/show_bug.cgi?id=184161

Anyway, the patch I submitted here earlier appears to work fine and I get no dialogs any more. So I'd still consider a revision bump with the patch given. Also consider the thread at the URL for this bug.
Comment 5 Jaak Ristioja 2009-02-12 17:52:05 UTC
Upstream WONTFIX.
Comment 6 Ioannis Aslanidis (RETIRED) gentoo-dev 2009-02-12 21:00:33 UTC
The thing is, I can apply your patch, but you should push it upstream no matter what. Are you telling me that upstream refuses to apply the patch? If so, for what reason? What is the URL for the bug report you opened upstream?
Comment 7 Jaak Ristioja 2009-02-12 21:13:58 UTC
(In reply to comment #6)
> The thing is, I can apply your patch, but you should push it upstream no matter
> what. Are you telling me that upstream refuses to apply the patch? If so, for
> what reason? What is the URL for the bug report you opened upstream?
> 

As I stated in my previous comment, the URL is https://bugs.kde.org/show_bug.cgi?id=184161 

Reason given for WONTFIX for that bug report is they don't develop the 2.2 series of KTorrent any more. It's also stated in http://ktorrent.org/?q=node/24 that 2.2.8 is and will be the final release for KDE 3.
Comment 8 Ioannis Aslanidis (RETIRED) gentoo-dev 2009-02-12 23:09:52 UTC
OK, looks good, I'll try to get your patch tomorrow in the tree.
Comment 9 Theo Chatzimichos (RETIRED) archtester gentoo-dev Security 2009-02-16 20:48:52 UTC
In CVS, thanks