Web lists-archives.com

Re: balloo assert on database inconsistency (trying to fix, help needed)




El dilluns, 24 d’octubre de 2016, a les 12:58:30 CEST, Tomaz Canabrava va 
escriure:
> So - I got a bit of crash on baloo - and I wonder what should I do to fix
> it.
> mostly because the crash is on an assert - wich means that this shouldn't
> ever happen, and if it does, it's bugged.
> 
> The affecting call is this:
> 
> QByteArray DocumentUrlDB::get(quint64 docId) const
> {
>     Q_ASSERT(docId > 0);
> 
>     IdFilenameDB idFilenameDb(m_idFilenameDbi, m_txn);
> 
>     auto path = idFilenameDb.get(docId);
>     if (path.name.isEmpty()) {
>         return QByteArray();
>     }
> 
>     QByteArray ret = path.name;
>     quint64 id = path.parentId;
> 
>     while (id) {
>         auto p = idFilenameDb.get(id);
>         Q_ASSERT(!p.name.isEmpty());
> 
>         ret = p.name + '/' + ret;
>         id = p.parentId;
>     }
> 
>     return '/' + ret;
> }
> 
> aparently, my database has something that has a parent with no name - hm...
> not sure what a parent means in baloo context / my guess is "folder", but
> what could be the right thing do to in this case?
> 
> - remove the index from the database
> - try to reescan the file because the parent is borked
> - show an information that there is a database inconsistency?
> 
> the only thing it shouldn't do is crash :)
> 
> Halp?

i know it's a poor man's solution but replace the the assert with an if + 
return + qWarning  for the moment so it doesn't crash?

Cheers,
  Albert

> 
> ➜  ~ krunner
> Error contacting the daemon!
> org.kde.kurifilter-ikws: ":q"
> org.kde.kurifilter-ikws: Keywords Engine: Loading config...
> org.kde.kurifilter-ikws: Web Shortcuts Enabled:  true
> org.kde.kurifilter-ikws: Default Shortcut:  ""
> org.kde.kurifilter-ikws: Keyword Delimiter:  :
> ASSERT: "!p.name.isEmpty()" in file
> /home/tcanabrava/Projects/kdesrc/baloo/src/engine/documenturldb.cpp, line
> 143
> KCrash: Attempting to start /home/tcanabrava/Projects/install/bin/krunner
> from kdeinit
> sock_file=/run/user/1000/kdeinit5__0
> KCrash: crashing... crashRecursionCounter = 2
> KCrash: Application Name = krunner path =
> /home/tcanabrava/Projects/install/bin pid = 1693
> KCrash: Arguments: /home/tcanabrava/Projects/install/bin/krunner
> KCrash: Attempting to start
> /home/tcanabrava/Projects/install/lib64/libexec/drkonqi from kdeinit
> sock_file=/run/user/1000/kdeinit5__0
> QSocketNotifier: Invalid socket 8 and type 'Read', disabling...
> QSocketNotifier: Invalid socket 14 and type 'Read', disabling...
> QSocketNotifier: Invalid socket 12 and type 'Read', disabling...
> QSocketNotifier: Invalid socket 6 and type 'Read', disabling...
> QSocketNotifier: Invalid socket 13 and type 'Read', disabling...
> QSocketNotifier: Invalid socket 16 and type 'Exception', disabling...
> QSocketNotifier: Invalid socket 10 and type 'Read', disabling...
> QSocketNotifier: Invalid socket 15 and type 'Read', disabling...
> intel_do_flush_locked failed: Bad file descriptor