Bug 383443

Summary: Infinite loop in baloo_file_extr due to incorrect parentId
Product: [Frameworks and Libraries] frameworks-baloo Reporter: Marco Leise <Marco.Leise>
Component: Baloo File DaemonAssignee: Pinak Ahuja <pinak.ahuja>
Status: RESOLVED FIXED    
Severity: grave CC: stefan.bruens
Priority: NOR    
Version: 5.34.0   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=364574
Latest Commit: Version Fixed In:

Description Marco Leise 2017-08-13 06:31:44 UTC
I think it was after using git stash [pop] a few times that Baloo started running an infinite loop here: https://github.com/KDE/baloo/blob/v5.34.0/src/engine/documenturldb.cpp#L141
Apparently two file name IDs became each other's parents forming an infinite loop. I can't tell how it got there, but here is a reconstruction of the file path data structure from the top level to the loop:

                                      docId   :29280948130416642 ->
name:"helpers.new.2",                 parentId:29280922360612866 ->
name:"generate unicode tables.dproj", parentId:29278212236249090 ->
name:"mono-d",                        parentId:29280922360612866 -> [loop]

On the filesystem I have sort of a backup copy of a few files including all of the above. So a first hint is that it might have to do with name collisions:

./source/fast/internal/helpers.new.2
./mono-d/generate unicode tables.dproj
./delme/helpers.new.2
./delme/mono-d/generate unicode tables.dproj

There are more files in the directories, but these are all which match the names I could extract from debugging. The grave issue with this is that it will not only keep one CPU core busy, but also consume all system memory from concatenating path elements ad infinitum.
Comment 1 Stefan BrĂ¼ns 2018-10-31 17:32:05 UTC
https://phabricator.kde.org/D12335