When ~/.local/share/baloo/index, baloo will crash. The reason for this is that in both positiondb.cpp and postingdb.cpp mdb_get is expected to either return MDB_SUCCESS (0) or to return MDB_NOTFOUND. However, in case of database corruption mdb_get returns MDB_PAGE_NOTFOUND, as can be seen in the backtrace below. Note that silently ignoring this error will not work, as further database operations will yield MDB_BAD_TXN (Transaction cannot recover - it must be aborted). ASSERT failure in PositionDB::iter: "MDB_PAGE_NOTFOUND: Requested page not found", file /home/fabian/projects/baloo/src/engine/positiondb.cpp, line 173 Program received signal SIGABRT, Aborted. [Switching to Thread 0x7fffc00aa700 (LWP 15679)] 0x00007ffff457f5f8 in raise () from /usr/lib/libc.so.6 (gdb) bt #0 0x00007ffff457f5f8 in raise () from /usr/lib/libc.so.6 #1 0x00007ffff4580a7a in abort () from /usr/lib/libc.so.6 #2 0x00007ffff4d07391 in qt_message_fatal (context=..., message=<synthetic pointer>) at global/qlogging.cpp:1610 #3 QMessageLogger::fatal (this=this@entry=0x7fffc00a8b60, msg=msg@entry=0x7ffff4fb5fa0 "ASSERT failure in %s: \"%s\", file %s, line %d") at global/qlogging.cpp:784 #4 0x00007ffff4d02721 in qt_assert_x (where=<optimized out>, what=<optimized out>, file=<optimized out>, line=<optimized out>) at global/qglobal.cpp:3002 #5 0x00007fffc02df51c in Baloo::PositionDB::iter (this=0x7fffc00a8c60, term=...) at /home/fabian/projects/baloo/src/engine/positiondb.cpp:173 #6 0x00007fffc02e84fa in Baloo::Transaction::postingIterator (this=0x7fffc00a98b0, query=...) at /home/fabian/projects/baloo/src/engine/transaction.cpp:312 #7 0x00007fffc07449f3 in Baloo::SearchStore::constructQuery (this=0x7fffc00a99c0, tr=0x7fffc00a98b0, term=...) at /home/fabian/projects/baloo/src/lib/searchstore.cpp:283 #8 0x00007fffc0743cc7 in Baloo::SearchStore::constructQuery (this=0x7fffc00a99c0, tr=0x7fffc00a98b0, term=...) at /home/fabian/projects/baloo/src/lib/searchstore.cpp:163 #9 0x00007fffc0743cc7 in Baloo::SearchStore::constructQuery (this=0x7fffc00a99c0, tr=0x7fffc00a98b0, term=...) at /home/fabian/projects/baloo/src/lib/searchstore.cpp:163 #10 0x00007fffc074346d in Baloo::SearchStore::exec (this=0x7fffc00a99c0, term=..., offset=0, limit=10, sortResults=true) at /home/fabian/projects/baloo/src/lib/searchstore.cpp:75 #11 0x00007fffc0731466 in Baloo::Query::exec (this=0x7fffc00a9b40) at /home/fabian/projects/baloo/src/lib/query.cpp:210 #12 0x00007fffc0963710 in SearchRunner::match (this=this@entry=0x10aa080, context=..., type=..., category=...) at /chakra/core/plasma-workspace/src/plasma-workspace-5.6.0/runners/baloo/baloosearchrunner.cpp:99 #13 0x00007fffc09644c9 in SearchRunner::match (this=0x10aa080, context=...) at /chakra/core/plasma-workspace/src/plasma-workspace-5.6.0/runners/baloo/baloosearchrunner.cpp:164 #14 0x00007fffd802b2d8 in Plasma::AbstractRunner::performMatch (this=0x10aa080, localContext=...) at /chakra/core/krunner/src/krunner-5.20.0/src/abstractrunner.cpp:131 #15 0x00007fffcfdeffd0 in ThreadWeaver::Executor::run(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () from /usr/lib/libKF5ThreadWeaver.so.5 #16 0x00007fffcfdeeb70 in ThreadWeaver::Job::execute(QSharedPointer<ThreadWeaver::JobInterface> const&, ThreadWeaver::Thread*) () from /usr/lib/libKF5ThreadWeaver.so.5 #17 0x00007fffcfdee67a in ThreadWeaver::Thread::run() () from /usr/lib/libKF5ThreadWeaver.so.5 #18 0x00007ffff4d1f238 in QThreadPrivate::start (arg=0x10bbef0) at thread/qthread_unix.cpp:340 #19 0x00007ffff2884464 in start_thread () from /usr/lib/libpthread.so.0 #20 0x00007ffff463512d in clone () from /usr/lib/libc.so.6 Reproducible: Always Steps to Reproduce: 1. Corrupt your database 2. Cause a query 3. Actual Results: In debug mode, the assertion is triggered. In release mode, the cast will be UB. This manifests in a traceback similar to #355280, as the data is corrupted. Expected Results: Baloo handles the crash gracefully. Ideally, it would try to repair the database or at least evict the bad data.
I should add that starting konsole from krunner is a very easy way to trigger that code path, which might be an explanation for those bugs (360754, 360727, etc.)
*** Bug 364360 has been marked as a duplicate of this bug. ***
*** Bug 359488 has been marked as a duplicate of this bug. ***
*** Bug 362200 has been marked as a duplicate of this bug. ***
*** Bug 366437 has been marked as a duplicate of this bug. ***
*** Bug 362621 has been marked as a duplicate of this bug. ***
*** Bug 359667 has been marked as a duplicate of this bug. ***
*** Bug 356009 has been marked as a duplicate of this bug. ***
*** Bug 353342 has been marked as a duplicate of this bug. ***
*** Bug 366005 has been marked as a duplicate of this bug. ***
*** Bug 359996 has been marked as a duplicate of this bug. ***
*** Bug 359839 has been marked as a duplicate of this bug. ***
*** Bug 359692 has been marked as a duplicate of this bug. ***
*** Bug 366011 has been marked as a duplicate of this bug. ***
*** Bug 366038 has been marked as a duplicate of this bug. ***
*** Bug 367769 has been marked as a duplicate of this bug. ***
*** Bug 368446 has been marked as a duplicate of this bug. ***
*** Bug 357344 has been marked as a duplicate of this bug. ***
I believe this bug is related to https://bugs.kde.org/show_bug.cgi?id=366022 and https://bugs.kde.org/show_bug.cgi?id=366190. See also this video: https://www.youtube.com/watch?v=u-aGfU-whhA
*** Bug 369076 has been marked as a duplicate of this bug. ***
*** Bug 368946 has been marked as a duplicate of this bug. ***
*** Bug 368991 has been marked as a duplicate of this bug. ***
*** Bug 368761 has been marked as a duplicate of this bug. ***
*** Bug 368699 has been marked as a duplicate of this bug. ***
*** Bug 371813 has been marked as a duplicate of this bug. ***
*** Bug 376403 has been marked as a duplicate of this bug. ***
*** Bug 380882 has been marked as a duplicate of this bug. ***
*** Bug 370347 has been marked as a duplicate of this bug. ***
*** Bug 364520 has been marked as a duplicate of this bug. ***
*** Bug 363491 has been marked as a duplicate of this bug. ***
*** Bug 354705 has been marked as a duplicate of this bug. ***
*** Bug 358657 has been marked as a duplicate of this bug. ***
*** Bug 368442 has been marked as a duplicate of this bug. ***
*** Bug 368519 has been marked as a duplicate of this bug. ***
*** Bug 364013 has been marked as a duplicate of this bug. ***
*** Bug 363511 has been marked as a duplicate of this bug. ***
*** Bug 366293 has been marked as a duplicate of this bug. ***
*** Bug 376525 has been marked as a duplicate of this bug. ***
*** Bug 384505 has been marked as a duplicate of this bug. ***
*** Bug 382610 has been marked as a duplicate of this bug. ***
*** Bug 381213 has been marked as a duplicate of this bug. ***
*** Bug 379788 has been marked as a duplicate of this bug. ***
*** Bug 370622 has been marked as a duplicate of this bug. ***
*** Bug 377311 has been marked as a duplicate of this bug. ***
*** Bug 373006 has been marked as a duplicate of this bug. ***
*** Bug 372549 has been marked as a duplicate of this bug. ***
I'm willing to bet that Christoph Cullman's work that went into 5.28 (especially https://cgit.kde.org/baloo.git/commit/?id=e34da150d82a57cf417a59b8b632b2fecb32a6f7) has fixed this. There isn't a single report of this crash happening when using a KDE Frameworks version later than 5.26.
*** Bug 368809 has been marked as a duplicate of this bug. ***
*** Bug 375293 has been marked as a duplicate of this bug. ***
*** Bug 364521 has been marked as a duplicate of this bug. ***
*** Bug 376932 has been marked as a duplicate of this bug. ***
*** Bug 369092 has been marked as a duplicate of this bug. ***
How is this resolved if crashes keep getting reported as duplicates? What version of KDE was this fixed in?
All the crashes I'm marking as duplicates were reported against versions of KDE Frameworks 5.26 and lower. It was fixed in KDE Frameworks 5.28. I haven't run into a crash with the same characteristics on KF 5.28 or later, and if I do, it's likely a different crash.
Created attachment 108591 [details] New crash information added by DrKonqi plasmashell (5.10.5) using Qt 5.7.1 - What I was doing when the application crashed: When I was querying from the "start menu" the search results appeared and then the desktop crashed and restarted. -- Backtrace (Reduced): #7 0x00007fab4086a4c0 in QByteArray::QByteArray(char const*, int) () from /usr/lib64/libQt5Core.so.5 #8 0x00007faa3a54aa77 in DBPostingIterator::DBPostingIterator(void*, unsigned int) () from /usr/lib64/libKF5BalooEngine.so.5 #9 0x00007faa3a54ade4 in Baloo::PostingDB::prefixIter(QByteArray const&) () from /usr/lib64/libKF5BalooEngine.so.5 #10 0x00007faa3a55535f in Baloo::Transaction::postingIterator(Baloo::EngineQuery const&) const () from /usr/lib64/libKF5BalooEngine.so.5 #11 0x00007faa3a9ada2a in Baloo::SearchStore::constructQuery(Baloo::Transaction*, Baloo::Term const&) () from /usr/lib64/libKF5Baloo.so.5
That looks like a different crash; your backtrace isn't showing a crash in Query::exec(). I didn't say that *everything* had been fixed (I wish) :). Please feel free to report that as in new bug report!
Thanks. I'll do that.
Created attachment 108592 [details] New crash information added by DrKonqi krunner (5.10.5) using Qt 5.7.1 When searching from the desktop search (ALT+space), the query results are returned and then the desktop crashes and restarts. This trace does show a call to Baloo::Query::exec(). So I decided to add it here. Let me know if I should open a seprate ticket for this as well. -- Backtrace (Reduced): #7 0x00007fd6a675c4c0 in QByteArray::QByteArray(char const*, int) () from /usr/lib64/libQt5Core.so.5 #8 0x00007fd66be26a77 in DBPostingIterator::DBPostingIterator(void*, unsigned int) () from /usr/lib64/libKF5BalooEngine.so.5 #9 0x00007fd66be26de4 in Baloo::PostingDB::prefixIter(QByteArray const&) () from /usr/lib64/libKF5BalooEngine.so.5 #10 0x00007fd66be3135f in Baloo::Transaction::postingIterator(Baloo::EngineQuery const&) const () from /usr/lib64/libKF5BalooEngine.so.5 #11 0x00007fd66c289a2a in Baloo::SearchStore::constructQuery(Baloo::Transaction*, Baloo::Term const&) () from /usr/lib64/libKF5Baloo.so.5
Can you file a whole new ticket, with a full backtrace? That's just another comment on this bug report (and all 52 people CCd on it are getting spammed).
Created attachment 126594 [details] New crash information added by DrKonqi dolphin (19.12.2) using Qt 5.14.1 - What I was doing when the application crashed: It always crashes when I select icons in dolphin. It doesn't matter which way it's done - it crashes with ctrl selection, with shift selection, with rectangle selection, with little plus button on top of the icon. It doesn't matter which kind of icon - it crashes on folders on textfiles on images. - Custom settings of the application: I have detailed info panel opened in Dolphin (F11 button). As soon as I close that panel i can select as many items as I wish without crashing -- Backtrace (Reduced): #8 0x00007f20faea6bd0 in mdb_get () from /usr/lib/liblmdb.so #9 0x00007f20fcd24f53 in Baloo::DocumentDataDB::get(unsigned long long) () from /usr/lib/libKF5BalooEngine.so.5 #10 0x00007f20fcd45684 in Baloo::Transaction::documentData(unsigned long long) const () from /usr/lib/libKF5BalooEngine.so.5 #11 0x00007f20ff1bdc32 in Baloo::File::load() () from /usr/lib/libKF5Baloo.so.5 [...] #13 0x00007f20fd8b826a in QObject::event(QEvent*) () from /usr/lib/libQt5Core.so.5