Bug 167682 - dirwatch enters potentially endless loop on encountering looped symlink directory structures
Summary: dirwatch enters potentially endless loop on encountering looped symlink direc...
Status: RESOLVED FIXED
Alias: None
Product: kio
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Rafał Rzepecki
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-07-29 21:42 UTC by Rafał Rzepecki
Modified: 2008-07-30 16:12 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
testcase (292 bytes, text/x-c++src)
2008-07-29 21:44 UTC, Rafał Rzepecki
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rafał Rzepecki 2008-07-29 21:42:58 UTC
Version:           r838844 (using Devel)
Installed from:    Compiled sources
Compiler:          GCC 4.2.3 Gentoo 4.2.3 p1.0
OS:                Linux

When adding a directory containing recursive symlinks with KDirWatch::addDir, telling KDirWatch to watch recursively with WatchSubDirs flag, it ends up recursively watching the same directories (it stops somewhere, but I'm not sure, why).

This might be causing gamin to use 100% CPU, not to mention other resource usage; this also might be (one of) the cause(s) of bug #161380 (I actually discovered it by noticing that strigi had been running for 24 hours and still indexing, while two nepomukservices had been saturating the CPU).

You'll find attached a testcase. I'm working on a fix ATM.

After running the testcase, you should see (assuming you have debug messages turned on) something along the lines of:

bar(8682)/kio (KDirWatch) KDirWatchPrivate::useFAM:  Setup FAM (Req 1) for "/tmp/foo/foo/bar/baz/bar/baz/bar"                                                   
bar(8682)/kio (KDirWatch) KDirWatchPrivate::useFAM:  Setup FAM (Req 2) for "/tmp/foo/foo/bar/baz/bar/foo/bar/baz/bar"                                           
bar(8682)/kio (KDirWatch) KDirWatchPrivate::useFAM:  Setup FAM (Req 3) for "/tmp/foo/foo/bar/baz/bar/foo/bar/foo/bar"                                           
bar(8682)/kio (KDirWatch) KDirWatchPrivate::useFAM:  Setup FAM (Req 4) for "/tmp/foo/foo/bar/baz/bar/foo/bar"                                                   
...
Comment 1 Rafał Rzepecki 2008-07-29 21:44:12 UTC
Created attachment 26485 [details]
testcase
Comment 2 Rafał Rzepecki 2008-07-30 16:12:12 UTC
Fixed in SVN (revision #839644).