Bug 364574 - Infinite loop in DocumentUrlDB::get(...) due to corrupt database
Summary: Infinite loop in DocumentUrlDB::get(...) due to corrupt database
Status: RESOLVED DUPLICATE of bug 378754
Alias: None
Product: frameworks-baloo
Classification: Frameworks and Libraries
Component: Baloo File Daemon (show other bugs)
Version: 5.22.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Pinak Ahuja
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-21 02:47 UTC by Stefan Brüns
Modified: 2018-05-29 04:12 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Brüns 2016-06-21 02:47:17 UTC
Somehow a bad entry ended up in the idfilename database, with key == parentId, name = "". Thus the while(id) loop never terminates.

The key is valid (e.g. points to the device/inode of ~/Pictures), and was referenced by several children, i.e. the ~/Pictures/ contents.

mdb_dump -n -p -s idfilename  /home/stefan/.local/share/baloo/index_bak  shows:
 /\00\00\00\1d\01\00\00
 /\00\00\00\02\01\00\00Music
 /\00\00\00\1e\01\00\00
 /\00\00\00\1e\01\00\00

Same for a non-corrupt database:
 /\00\00\00\1d\01\00\00
 /\00\00\00\02\01\00\00Music
 /\00\00\00\1e\01\00\00
 /\00\00\00\02\01\00\00Pictures

The error is also visible it the idtree database, it lists itself as a subdoc:
 /\00\00\00\1e\01\00\00
 /\00\00\00\1e\01\00\00/\00\00\00Q\0a\0c\00/\00\00\00i\0a\0c\00/\00\00\00\c9\0a\0c\00/\00\00\00\05?\10\00/\00\00\00YK\10\00/\00\00\00\faL\10\00/\00\00\00\c9M\10\00/\00\00\00YN\10\00/\00\00\00\d1T\10\00/\00\00\00\99\a2\18\00/\00\00\00\f2\c2o\00




Reproducible: Always

Steps to Reproduce:
Steps which lead to the corrupt database are unknown.


Expected Results:  
The DocumentUrlDb::get() should ignore such a bad entry, best remove it.
Comment 1 Nate Graham 2018-05-29 04:12:18 UTC

*** This bug has been marked as a duplicate of bug 378754 ***