Bug 405284

Summary: baloo_file_extractor crashes in Baloo::DocumentDB::del() / mdb_cursor_del()
Product: [Frameworks and Libraries] frameworks-baloo Reporter: Mina <842mono>
Component: Baloo File DaemonAssignee: baloo-bugs-null
Status: RESOLVED DUPLICATE    
Severity: crash CC: aaronw, aubin.ob1, avinashrocks1990, benjunmun, christoph, cyrille.dunant, dcgowan, guido-kdebugs, kde, michaelpellegrinimail, nate, phist0, robert, scripptor, stefan.bruens, tagwerk19
Priority: VHI Keywords: drkonqi
Version: 5.55.0   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Mina 2019-03-09 21:58:31 UTC
Application: baloo_file_extractor (5.55.0)

Qt Version: 5.12.0
Frameworks Version: 5.55.0
Operating System: Linux 4.15.0-46-generic x86_64
Distribution: KDE neon User Edition 5.15

-- Information about the crash:
- What I was doing when the application crashed:

The crash message appeared right after restarting neon after an update.

-- Backtrace:
Application: Baloo File Extractor (baloo_file_extractor), signal: Aborted
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[Current thread is 1 (Thread 0x7fcab5d8cc80 (LWP 2777))]

Thread 3 (Thread 0x7fca8f8ea700 (LWP 2779)):
#0  0x00007fcab28a70b4 in __GI___libc_read (fd=8, buf=0x7fca8f8e9b60, nbytes=16) at ../sysdeps/unix/sysv/linux/read.c:27
#1  0x00007fcaaefbccd0 in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007fcaaef78027 in g_main_context_check () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007fcaaef784e0 in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#4  0x00007fcaaef7864c in g_main_context_iteration () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007fcab31ee15b in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x7fca88000b20, flags=...) at kernel/qeventdispatcher_glib.cpp:424
#6  0x00007fcab318f64a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (this=this@entry=0x7fca8f8e9d70, flags=..., flags@entry=...) at kernel/qeventloop.cpp:225
#7  0x00007fcab2fb741a in QThread::exec() (this=this@entry=0x7fcab4dfad80 <(anonymous namespace)::Q_QGS__q_manager::innerFunction()::holder>) at thread/qthread.cpp:531
#8  0x00007fcab4b83015 in QDBusConnectionManager::run() (this=0x7fcab4dfad80 <(anonymous namespace)::Q_QGS__q_manager::innerFunction()::holder>) at qdbusconnection.cpp:178
#9  0x00007fcab2fb8bc2 in QThreadPrivate::start(void*) (arg=0x7fcab4dfad80 <(anonymous namespace)::Q_QGS__q_manager::innerFunction()::holder>) at thread/qthread_unix.cpp:361
#10 0x00007fcab14b26db in start_thread (arg=0x7fca8f8ea700) at pthread_create.c:463
#11 0x00007fcab28b888f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 2 (Thread 0x7fcaa90c8700 (LWP 2778)):
#0  0x00007fcab28abbf9 in __GI___poll (fds=0x7fcaa90c7cb8, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
#1  0x00007fcaaeb07747 in  () at /usr/lib/x86_64-linux-gnu/libxcb.so.1
#2  0x00007fcaaeb0936a in xcb_wait_for_event () at /usr/lib/x86_64-linux-gnu/libxcb.so.1
#3  0x00007fcaaa64332a in QXcbEventQueue::run() (this=0x55f7ed835cd0) at qxcbeventqueue.cpp:225
#4  0x00007fcab2fb8bc2 in QThreadPrivate::start(void*) (arg=0x55f7ed835cd0) at thread/qthread_unix.cpp:361
#5  0x00007fcab14b26db in start_thread (arg=0x7fcaa90c8700) at pthread_create.c:463
#6  0x00007fcab28b888f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 1 (Thread 0x7fcab5d8cc80 (LWP 2777)):
[KCrash Handler]
#6  0x00007fcab27d5e97 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#7  0x00007fcab27d7801 in __GI_abort () at abort.c:79
#8  0x00007fcab1e614d2 in  () at /usr/lib/x86_64-linux-gnu/liblmdb.so.0
#9  0x00007fcab1e565d5 in  () at /usr/lib/x86_64-linux-gnu/liblmdb.so.0
#10 0x00007fcab1e57803 in  () at /usr/lib/x86_64-linux-gnu/liblmdb.so.0
#11 0x00007fcab1e57a79 in  () at /usr/lib/x86_64-linux-gnu/liblmdb.so.0
#12 0x00007fcab1e59764 in  () at /usr/lib/x86_64-linux-gnu/liblmdb.so.0
#13 0x00007fcab1e5daba in mdb_cursor_del () at /usr/lib/x86_64-linux-gnu/liblmdb.so.0
#14 0x00007fcab1e5f0d4 in  () at /usr/lib/x86_64-linux-gnu/liblmdb.so.0
#15 0x00007fcab521be1e in Baloo::DocumentDB::del(unsigned long long) () at /usr/lib/x86_64-linux-gnu/libKF5BalooEngine.so.5
#16 0x00007fcab523518a in Baloo::WriteTransaction::removeDocument(unsigned long long) () at /usr/lib/x86_64-linux-gnu/libKF5BalooEngine.so.5
#17 0x000055f7ed4e535c in  ()
#18 0x000055f7ed4e5b7e in  ()
#19 0x00007fcab31cdd04 in QtPrivate::QSlotObjectBase::call(QObject*, void**) (a=0x7ffe09e03f20, r=<optimized out>, this=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:394
#20 0x00007fcab31cdd04 in QSingleShotTimer::timerEvent(QTimerEvent*) (this=0x55f7ed87f860) at kernel/qtimer.cpp:318
#21 0x00007fcab31c194b in QObject::event(QEvent*) (this=0x55f7ed87f860, e=<optimized out>) at kernel/qobject.cpp:1271
#22 0x00007fcab3f8783c in QApplicationPrivate::notify_helper(QObject*, QEvent*) (this=this@entry=0x55f7ed8300f0, receiver=receiver@entry=0x55f7ed87f860, e=e@entry=0x7ffe09e04260) at kernel/qapplication.cpp:3752
#23 0x00007fcab3f8edd0 in QApplication::notify(QObject*, QEvent*) (this=0x7ffe09e04540, receiver=0x55f7ed87f860, e=0x7ffe09e04260) at kernel/qapplication.cpp:3499
#24 0x00007fcab3191328 in QCoreApplication::notifyInternal2(QObject*, QEvent*) (receiver=0x55f7ed87f860, event=0x7ffe09e04260) at kernel/qcoreapplication.cpp:1061
#25 0x00007fcab31ed5a9 in QTimerInfoList::activateTimers() (this=0x55f7ed87bbb0) at kernel/qtimerinfo_unix.cpp:643
#26 0x00007fcab31edd71 in timerSourceDispatch(GSource*, GSourceFunc, gpointer) (source=<optimized out>) at kernel/qeventdispatcher_glib.cpp:182
#27 0x00007fcaaef78387 in g_main_context_dispatch () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#28 0x00007fcaaef785c0 in  () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#29 0x00007fcaaef7864c in g_main_context_iteration () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#30 0x00007fcab31ee13f in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x55f7ed8752c0, flags=...) at kernel/qeventdispatcher_glib.cpp:422
#31 0x00007fcab318f64a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (this=this@entry=0x7ffe09e044b0, flags=..., flags@entry=...) at kernel/qeventloop.cpp:225
#32 0x00007fcab3198800 in QCoreApplication::exec() () at kernel/qcoreapplication.cpp:1364
#33 0x000055f7ed4e420d in  ()
#34 0x00007fcab27b8b97 in __libc_start_main (main=0x55f7ed4e3fc0, argc=1, argv=0x7ffe09e04798, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffe09e04788) at ../csu/libc-start.c:310
#35 0x000055f7ed4e42ba in  ()

Reported using DrKonqi
Comment 1 Nate Graham 2019-03-26 21:17:02 UTC
*** Bug 405871 has been marked as a duplicate of this bug. ***
Comment 2 Nate Graham 2020-06-10 23:31:48 UTC
*** Bug 422355 has been marked as a duplicate of this bug. ***
Comment 3 Nate Graham 2020-08-05 04:18:06 UTC
*** Bug 422393 has been marked as a duplicate of this bug. ***
Comment 4 Nate Graham 2020-09-08 13:12:27 UTC
*** Bug 426275 has been marked as a duplicate of this bug. ***
Comment 5 Nate Graham 2020-09-21 23:52:08 UTC
I can reproduce this crash 100% by running `balooctl clear "/home/nate/SpiderOak Hive/Software/KDE/Moving back to Linux.txt"`.

I was trying to un-index that file because baloo_file_extractor is crashing trying to index it! So it crashes trying to remove it too. :)


The backtrace is pretty much the same:

#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x00007ffff7489539 in __GI_abort () at abort.c:79
#2  0x00007ffff734e214 in mdb_assert_fail.constprop.0 (env=0x55555559f770, 
    expr_txt=expr_txt@entry=0x7ffff734f5f0 "rc == 0", 
    func=func@entry=0x7ffff734f918 <__func__.16> "mdb_page_dirty", 
    line=line@entry=2127, file=0x7ffff734f987 "mdb.c") at mdb.c:1542
#3  0x00007ffff7341f15 in mdb_page_dirty (txn=<optimized out>, 
    txn=<optimized out>, mp=<optimized out>) at mdb.c:2114
#4  mdb_page_dirty (txn=0x5555555a0b30, mp=<optimized out>) at mdb.c:2114
#5  0x00007ffff734b4f6 in mdb_page_alloc.isra.0 (num=num@entry=1, 
    mp=mp@entry=0x7fffffffcb48, mc=<optimized out>, mc=<optimized out>)
    at mdb.c:2308
#6  0x00007ffff73428f3 in mdb_page_touch (mc=mc@entry=0x7fffffffcfd0)
    at mdb.c:2495
#7  0x00007ffff734473c in mdb_cursor_touch (mc=mc@entry=0x7fffffffcfd0)
    at mdb.c:6523
#8  0x00007ffff7348a99 in mdb_cursor_del (flags=32, mc=0x7fffffffcfd0)
    at mdb.c:7081
#9  mdb_cursor_del (mc=mc@entry=0x7fffffffcfd0, flags=flags@entry=32)
    at mdb.c:7063
#10 0x00007ffff734a343 in mdb_del0 (txn=0x5555555a0b30, dbi=<optimized out>, 
    key=key@entry=0x7fffffffd3c0, data=0x0, flags=32, flags@entry=0)
    at mdb.c:8571
#11 0x00007ffff734a3ba in mdb_del (txn=<optimized out>, dbi=<optimized out>, 
    key=key@entry=0x7fffffffd3c0, data=<optimized out>, data@entry=0x0)
    at mdb.c:8531
#12 0x00007ffff7f4b863 in Baloo::DocumentDB::del (this=<optimized out>, 
    docId=<optimized out>)
    at /usr/src/debug/baloo5-5.73.0-1.2.x86_64/src/engine/documentdb.cpp:118
#13 0x00007ffff7f62a82 in Baloo::WriteTransaction::removeDocument (
    this=0x7fffec014520, id=109231283309183748)
    at /usr/src/debug/baloo5-5.73.0-1.2.x86_64/src/engine/writetransaction.cpp:128
#14 0x000055555555e2ec in main (argc=<optimized out>, argv=<optimized out>)
    at /usr/src/debug/baloo5-5.73.0-1.2.x86_64/src/tools/balooctl/main.cpp:273
Comment 6 Stefan BrĂ¼ns 2020-09-28 12:27:53 UTC
@ngraham - updating and deleting the file updates the same parts of the DB. Apparently the internal structure is corrupt.
Comment 7 Nate Graham 2020-10-26 15:58:44 UTC
*** Bug 411708 has been marked as a duplicate of this bug. ***
Comment 8 Nate Graham 2020-10-26 16:02:28 UTC
*** Bug 425266 has been marked as a duplicate of this bug. ***
Comment 9 Nate Graham 2020-11-11 20:58:29 UTC
*** Bug 428943 has been marked as a duplicate of this bug. ***
Comment 10 Nate Graham 2020-11-20 19:57:37 UTC
*** Bug 429387 has been marked as a duplicate of this bug. ***
Comment 11 Aaron Williams 2021-01-06 04:18:17 UTC
I am seeing this same crash:

#0  0x00007f97d31b66db in __GI___poll (fds=fds@entry=0x7ffd4647c4b8, nfds=nfds@entry=1, 
    timeout=timeout@entry=1000) at ../sysdeps/unix/sysv/linux/poll.c:29
#1  0x00007f97d4dd7f50 in poll (__timeout=1000, __nfds=1, __fds=0x7ffd4647c4b8)
    at /usr/include/bits/poll2.h:46
#2  pollDrKonqiSocket (sockfd=3, pid=112635)
    at /usr/src/debug/kcrash-5.77.0-lp152.212.1.x86_64/src/kcrash.cpp:802
#3  KCrash::startProcess (argc=argc@entry=15, argv=argv@entry=0x7ffd4647c5a0, 
    waitAndExit=waitAndExit@entry=true)
    at /usr/src/debug/kcrash-5.77.0-lp152.212.1.x86_64/src/kcrash.cpp:663
#4  0x00007f97d4dd8725 in KCrash::defaultCrashHandler (sig=6)
    at /usr/src/debug/kcrash-5.77.0-lp152.212.1.x86_64/src/kcrash.cpp:545
#5  <signal handler called>
#6  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#7  0x00007f97d30ffb01 in __GI_abort () at abort.c:79
#8  0x00007f97d3141957 in __libc_message (action=action@entry=(do_abort | do_backtrace), 
    fmt=fmt@entry=0x7f97d324abd0 "*** Error in `%s': %s: 0x%s ***\n") at ../sysdeps/posix/libc_fatal.c:181
#9  0x00007f97d3148173 in malloc_printerr (action=<optimized out>, 
    str=0x7f97d3247692 "realloc(): invalid pointer", ptr=<optimized out>, ar_ptr=<optimized out>)
    at malloc.c:5428
#10 0x00007f97d314cc24 in realloc_check (oldmem=0x7f57c3294010, bytes=2097152, caller=<optimized out>)
    at hooks.c:353
#11 0x00007f97d222a295 in mdb_midl_grow (idp=idp@entry=0x55e145cda4f8, num=num@entry=131071) at midl.c:134
#12 0x00007f97d222a554 in mdb_midl_append_range (idp=idp@entry=0x55e145cda4f8, id=id@entry=373460, 
    n=n@entry=1) at midl.c:189
#13 0x00007f97d222094c in mdb_ovpage_free (mp=<optimized out>, mc=<optimized out>, mc=<optimized out>)
    at mdb.c:5548
#14 0x00007f97d22281ae in mdb_cursor_del (mc=0x7ffd4647d440, flags=<optimized out>) at mdb.c:6942
#15 0x00007f97d2228d95 in mdb_freelist_save (txn=0x55e145cda4d0) at mdb.c:3105
#16 mdb_txn_commit (txn=0x55e145cda4d0) at mdb.c:3592
#17 0x00007f97d5005923 in Baloo::Transaction::commit (this=0x55e14b5c73a0)
    at /usr/src/debug/baloo5-5.77.0-lp152.250.1.x86_64/src/engine/transaction.cpp:276
#18 0x000055e144f9b50c in Baloo::App::processNextFile (this=0x7ffd4647db30)
    at /usr/src/debug/baloo5-5.77.0-lp152.250.1.x86_64/src/file/extractor/app.cpp:123
#19 0x00007f97d3b717d4 in QtPrivate::QSlotObjectBase::call (a=0x7ffd4647d710, r=<optimized out>, 
    this=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#20 QSingleShotTimer::timerEvent (this=0x55e148785b40) at kernel/qtimer.cpp:320
#21 0x00007f97d3b635a3 in QObject::event (this=0x55e148785b40, e=0x7ffd4647d840) at kernel/qobject.cpp:1336
#22 0x00007f97d3b2f443 in QCoreApplication::notifyInternal2 (receiver=0x55e148785b40, event=0x7ffd4647d840)
    at kernel/qcoreapplication.cpp:1063
#23 0x00007f97d3b91059 in QTimerInfoList::activateTimers (this=0x55e145c10b10)
    at kernel/qtimerinfo_unix.cpp:643
#24 0x00007f97d3b91859 in timerSourceDispatch (source=<optimized out>)
    at kernel/qeventdispatcher_glib.cpp:183
#25 idleTimerSourceDispatch (source=<optimized out>) at kernel/qeventdispatcher_glib.cpp:230
#26 0x00007f97cf2994a4 in g_main_dispatch (context=0x55e145b039c0) at ../glib/gmain.c:3216
#27 g_main_context_dispatch (context=context@entry=0x55e145b039c0) at ../glib/gmain.c:3881
#28 0x00007f97cf299840 in g_main_context_iterate (context=context@entry=0x55e145b039c0, 
--Type <RET> for more, q to quit, c to continue without paging--
    block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/gmain.c:3954
#29 0x00007f97cf2998cc in g_main_context_iteration (context=0x55e145b039c0, may_block=may_block@entry=1)
    at ../glib/gmain.c:4015
#30 0x00007f97d3b91bcc in QEventDispatcherGlib::processEvents (this=0x55e145ae6c30, flags=...)
    at kernel/qeventdispatcher_glib.cpp:423
#31 0x00007f97d3b2dcca in QEventLoop::exec (this=this@entry=0x7ffd4647da90, flags=..., flags@entry=...)
    at kernel/qeventloop.cpp:232
#32 0x00007f97d3b374c7 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1371
#33 0x00007f97d4179e2c in QGuiApplication::exec () at kernel/qguiapplication.cpp:1867
#34 0x000055e144f993f5 in main (argc=<optimized out>, argv=<optimized out>)
    at /usr/src/debug/baloo5-5.77.0-lp152.250.1.x86_64/src/file/extractor/main.cpp:37

#10 0x00007f97d314cc24 in realloc_check (oldmem=0x7f57c3294010, bytes=2097152, caller=<optimized out>)
    at hooks.c:353
353           malloc_printerr (check_action, "realloc(): invalid pointer", oldmem,
(gdb) up
#11 0x00007f97d222a295 in mdb_midl_grow (idp=idp@entry=0x55e145cda4f8, num=num@entry=131071) at midl.c:134
134             idn = realloc(idn, (*idn + num + 2) * sizeof(MDB_ID));
(gdb) list
129
130     static int mdb_midl_grow( MDB_IDL *idp, int num )
131     {
132             MDB_IDL idn = *idp-1;
133             /* grow it */
134             idn = realloc(idn, (*idn + num + 2) * sizeof(MDB_ID));
135             if (!idn)
136                     return ENOMEM;
137             *idn++ += num;
138             *idp = idn;
(gdb) p num
$1 = 131071
(gdb) p idn
$2 = <optimized out>
(gdb) p *idn
value has been optimized out
(gdb) down
#10 0x00007f97d314cc24 in realloc_check (oldmem=0x7f57c3294010, bytes=2097152, caller=<optimized out>)
    at hooks.c:353
353           malloc_printerr (check_action, "realloc(): invalid pointer", oldmem,
(gdb) list
348       __libc_lock_lock (main_arena.mutex);
349       const mchunkptr oldp = mem2chunk_check (oldmem, &magic_p);
350       __libc_lock_unlock (main_arena.mutex);
351       if (!oldp)
352         {
353           malloc_printerr (check_action, "realloc(): invalid pointer", oldmem,
354                            &main_arena);
355           return malloc_check (bytes, NULL);
356         }
357       const INTERNAL_SIZE_T oldsize = chunksize (oldp);

#15 0x00007f97d2228d95 in mdb_freelist_save (txn=0x55e145cda4d0) at mdb.c:3105
3105                            rc = mdb_cursor_del(&mc, 0);
(gdb) up
#16 mdb_txn_commit (txn=0x55e145cda4d0) at mdb.c:3592
3592            rc = mdb_freelist_save(txn);
(gdb) p txn
$3 = (MDB_txn *) 0x55e145cda4d0
(gdb) p *txn
$4 = {mt_parent = 0x0, mt_child = 0x0, mt_next_pgno = 5336964, mt_txnid = 903381, mt_env = 0x55e145cd8ff0,
  mt_free_pgs = 0x7f57c3294018, mt_loose_pgs = 0x0, mt_loose_count = 0, mt_spill_pgs = 0x0, mt_u = {
    dirty_list = 0x7f97c3761010, reader = 0x7f97c3761010}, mt_dbxs = 0x55e145cd9210,
  mt_dbs = 0x55e145cda558, mt_dbiseqs = 0x55e145cda868, mt_cursors = 0x55e145cda7f8,
  mt_dbflags = 0x55e145cda8a0 "\b\030\031\031\031\032\032\032\030\032\031\031\032\032,", mt_numdbs = 14,
  mt_flags = 0, mt_dirty_room = 130270}
(gdb)
Comment 12 Martin Schnitkemper 2021-01-11 12:21:01 UTC
Same issue here, it happen reproducable after creating or deleting a directory.

Application: baloo_file (baloo_file), signal: Aborted

[KCrash Handler]
#4  0x00007fdc0efdb615 in raise () from /usr/lib/libc.so.6
#5  0x00007fdc0efc4862 in abort () from /usr/lib/libc.so.6
#6  0x00007fdc0f51a9ac in QMessageLogger::fatal(char const*, ...) const () from /usr/lib/libQt5Core.so.5
#7  0x00007fdc0f519d59 in qt_assert(char const*, char const*, int) () from /usr/lib/libQt5Core.so.5
#8  0x000056117dc047d5 in Baloo::FileWatch::slotFileDeleted (this=0x7ffce4fa9440, urlString=..., isDir=<optimized out>) at /usr/src/debug/baloo-5.78.0/src/file/filewatch.cpp:100
#9  0x00007fdc0f776dd6 in ?? () from /usr/lib/libQt5Core.so.5
#10 0x000056117dc229a2 in KInotify::deleted (_t2=true, _t1=..., this=0x56117e473980) at /usr/src/debug/build/src/file/baloofilecommon_autogen/include/moc_kinotify.cpp:334
#11 KInotify::slotEvent (this=0x56117e473980, socket=<optimized out>) at /usr/src/debug/baloo-5.78.0/src/file/kinotify.cpp:395
#12 0x00007fdc0f776dd6 in ?? () from /usr/lib/libQt5Core.so.5
#13 0x00007fdc0f77a340 in QSocketNotifier::activated(QSocketDescriptor, QSocketNotifier::Type, QSocketNotifier::QPrivateSignal) () from /usr/lib/libQt5Core.so.5
#14 0x00007fdc0f77ab4d in QSocketNotifier::event(QEvent*) () from /usr/lib/libQt5Core.so.5
#15 0x00007fdc0f73fa50 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib/libQt5Core.so.5
#16 0x00007fdc0f7992f6 in ?? () from /usr/lib/libQt5Core.so.5
#17 0x00007fdc0dcdaa84 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#18 0x00007fdc0dd2e9b1 in ?? () from /usr/lib/libglib-2.0.so.0
#19 0x00007fdc0dcd92b1 in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#20 0x00007fdc0f7986e1 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#21 0x00007fdc0f73e3fc in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#22 0x00007fdc0f746894 in QCoreApplication::exec() () from /usr/lib/libQt5Core.so.5
#23 0x000056117dc04e8d in main (argc=<optimized out>, argv=0x7ffce4fa93b0) at /usr/src/debug/baloo-5.78.0/src/file/main.cpp:78
[Inferior 1 (process 8573) detached]

Operating System: Arch Linux
KDE Plasma Version: 5.20.5
KDE Frameworks Version: 5.78.0
Qt Version: 5.15.2
Kernel Version: 5.10.6-arch1-1
Comment 13 Martin Schnitkemper 2021-02-23 09:11:30 UTC
It seems to work now after the latest upgrade to KDE Frameworks 5.79.0; it does no more crash after creating or deleting a folder.

On one system it was necessary to purge the database and create the index again, since it crashed always on startup.
Comment 14 scripptor 2022-06-15 14:44:56 UTC
(In reply to Martin Schnitkemper from comment #13)
> It seems to work now after the latest upgrade to KDE Frameworks 5.79.0; it
> does no more crash after creating or deleting a folder.
> 
> On one system it was necessary to purge the database and create the index
> again, since it crashed always on startup.

Possibly a regression, in framework version 5.94.0.

Details:

SUMMARY
baloo_file_extractor frequently crashes producing the "same" crashlog. 
One backtrace is attached. 

STEPS TO REPRODUCE
Unknown.
It might be related to my latest install of the gnome-session-wayland/pattern-gnome opensuse pattern.

OBSERVED RESULT
Dr. Konqi is reporting a crash. 

EXPECTED RESULT
No crash.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: openSuse Tumbleweed 20220613
KDE Plasma Version: 5.25.0
KDE Frameworks Version: 5.94.0
Qt Version: 5.15.2

CRASH LOG

Application: baloo_file_extractor (baloo_file_extractor), signal: Aborted
Content of s_kcrashErrorMessage: std::unique_ptr<char []> = {get() = <optimized out>}
[KCrash Handler]
#6  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
#7  0x00007fe75e3d4733 in __pthread_kill_internal (signo=6, threadid=<optimized out>) at pthread_kill.c:78
#8  0x00007fe75e3816f6 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#9  0x00007fe75e36a814 in __GI_abort () at abort.c:79
#10 0x00007fe75dfc8263 in mdb_assert_fail.constprop.0 (env=0x561b6e2728d0, expr_txt=<optimized out>, func=<optimized out>, line=<optimized out>, file=0x7fe75dfc99b0 "mdb.c") at /usr/src/debug/lmdb-0.9.29-1.6.x86_64/libraries/liblmdb/mdb.c:1545
#11 0x00007fe75dfba7f5 in mdb_page_dirty (txn=<optimized out>, mp=<optimized out>) at /usr/src/debug/lmdb-0.9.29-1.6.x86_64/libraries/liblmdb/mdb.c:2117
#12 mdb_page_dirty (txn=0x561b6e2787a0, mp=<optimized out>) at /usr/src/debug/lmdb-0.9.29-1.6.x86_64/libraries/liblmdb/mdb.c:2117
#13 0x00007fe75dfc54e6 in mdb_page_alloc.isra.0 (num=<optimized out>, mp=0x7ffdf28ebf58, mc=<optimized out>) at /usr/src/debug/lmdb-0.9.29-1.6.x86_64/libraries/liblmdb/mdb.c:2311
#14 0x00007fe75dfbc94b in mdb_page_touch (mc=mc@entry=0x7ffdf28ec3e0) at /usr/src/debug/lmdb-0.9.29-1.6.x86_64/libraries/liblmdb/mdb.c:2431
#15 0x00007fe75dfbe6b7 in mdb_cursor_touch (mc=mc@entry=0x7ffdf28ec3e0) at /usr/src/debug/lmdb-0.9.29-1.6.x86_64/libraries/liblmdb/mdb.c:6536
#16 0x00007fe75dfc2709 in mdb_cursor_del (flags=32, mc=0x7ffdf28ec3e0) at /usr/src/debug/lmdb-0.9.29-1.6.x86_64/libraries/liblmdb/mdb.c:7094
#17 mdb_cursor_del (mc=mc@entry=0x7ffdf28ec3e0, flags=flags@entry=32) at /usr/src/debug/lmdb-0.9.29-1.6.x86_64/libraries/liblmdb/mdb.c:7076
#18 0x00007fe75dfc3f34 in mdb_del0 (txn=0x561b6e2787a0, dbi=<optimized out>, key=0x7ffdf28ec7d0, data=<optimized out>, flags=32) at /usr/src/debug/lmdb-0.9.29-1.6.x86_64/libraries/liblmdb/mdb.c:8594
#19 0x00007fe75f4918f2 in Baloo::DocumentDB::del(unsigned long long) () from /lib64/libKF5BalooEngine.so.5
#20 0x00007fe75f4a94fc in Baloo::WriteTransaction::removeDocument(unsigned long long) () from /lib64/libKF5BalooEngine.so.5
#21 0x0000561b6de2da0d in ?? ()
#22 0x0000561b6de2efcc in ?? ()
#23 0x00007fe75ea9fca2 in QtPrivate::QSlotObjectBase::call (a=0x7ffdf28ece10, r=<optimized out>, this=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#24 QSingleShotTimer::timerEvent (this=0x561b6e240d50) at kernel/qtimer.cpp:320
#25 0x00007fe75ea9047d in QObject::event (this=0x561b6e240d50, e=0x7ffdf28ecf20) at kernel/qobject.cpp:1336
#26 0x00007fe75ea64988 in QCoreApplication::notifyInternal2 (receiver=0x561b6e240d50, event=0x7ffdf28ecf20) at kernel/qcoreapplication.cpp:1064
#27 0x00007fe75eabb9a1 in QTimerInfoList::activateTimers (this=0x561b6e21c090) at kernel/qtimerinfo_unix.cpp:643
#28 0x00007fe75eabc234 in timerSourceDispatch (source=<optimized out>) at kernel/qeventdispatcher_glib.cpp:183
#29 0x00007fe75d3bdea0 in g_main_dispatch (context=0x561b6e219910) at ../glib/gmain.c:3417
#30 g_main_context_dispatch (context=0x561b6e219910) at ../glib/gmain.c:4135
#31 0x00007fe75d3be258 in g_main_context_iterate (context=context@entry=0x561b6e219910, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/gmain.c:4211
#32 0x00007fe75d3be2ec in g_main_context_iteration (context=0x561b6e219910, may_block=1) at ../glib/gmain.c:4276
#33 0x00007fe75eabc5a6 in QEventDispatcherGlib::processEvents (this=0x561b6e215940, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#34 0x00007fe75ea633fb in QEventLoop::exec (this=this@entry=0x7ffdf28ed160, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:69
#35 0x00007fe75ea6b566 in QCoreApplication::exec () at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#36 0x0000561b6de24d85 in ?? ()
#37 0x00007fe75e36b5b0 in __libc_start_call_main (main=main@entry=0x561b6de24130, argc=argc@entry=1, argv=argv@entry=0x7ffdf28ed4e8) at ../sysdeps/nptl/libc_start_call_main.h:58
#38 0x00007fe75e36b679 in __libc_start_main_impl (main=0x561b6de24130, argc=1, argv=0x7ffdf28ed4e8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffdf28ed4d8) at ../csu/libc-start.c:392
#39 0x0000561b6de24ea5 in ?? ()
[Inferior 1 (process 3291) detached]
Comment 15 Martin Schnitkemper 2022-06-19 07:29:51 UTC
(In reply to scripptor from comment #14)
> Possibly a regression, in framework version 5.94.0.
We are meanwhile on KDE Frameworks Version 5.95.0. 

I was for weeks on version 5.94 and I cannot confirm any issues with baloo.  Since today I am on KDE Plasma Version 5.25.0 and
KDE Frameworks Version 5.95.0 on two systems and it still works without problems: Create and delete file & folders or purge and recreate the database runs without any crashes. Operating System is Arch Linux.
Comment 16 tagwerk19 2022-06-19 08:56:17 UTC
(In reply to scripptor from comment #14)
> SOFTWARE/OS VERSIONS
> Linux/KDE Plasma: openSuse Tumbleweed 20220613
(In reply to Martin Schnitkemper from comment #15)
> Operating System is Arch Linux ...
It's possible that the issue is the filesystem rather than (directly) the distibution.

Are you using Tumbleweed with BTRFS (with multiple subvols)? If so have a look at:
    https://bugs.kde.org/show_bug.cgi?id=402154#c12
and check whether you are seeing the "Device" number changing. This can make the index 'baloon' in size on disc and in memory, maybe to the point baloo fails.

OpenSUSE/Tumbleweed, I think does use BTRFS. Arch, I've seen people report both ext4 and BTRFS
Comment 17 scripptor 2022-06-19 09:56:46 UTC
(In reply to tagwerk19 from comment #16)
> (In reply to scripptor from comment #14)
> > SOFTWARE/OS VERSIONS
> > Linux/KDE Plasma: openSuse Tumbleweed 20220613
> (In reply to Martin Schnitkemper from comment #15)
> > Operating System is Arch Linux ...
> It's possible that the issue is the filesystem rather than (directly) the
> distibution.
> 
> Are you using Tumbleweed with BTRFS (with multiple subvols)? If so have a
> look at:
>     https://bugs.kde.org/show_bug.cgi?id=402154#c12
> and check whether you are seeing the "Device" number changing. This can make
> the index 'baloon' in size on disc and in memory, maybe to the point baloo
> fails.
> 
> OpenSUSE/Tumbleweed, I think does use BTRFS. Arch, I've seen people report
> both ext4 and BTRFS

Thanks for the hints.
Yes, I'm currently using BTRFS, although I don't notice any high CPU usage related to baloo when starting the system (probably caused when indexing).
My current fix was to purge the baloo database and reindex everything again.
The index is currently only a few 100 mb in size, but I can not rule out, that it wasn't that way before (when I experienced the issue).
I will observe the future behavior, maybe that was only a "one-time" bug.
Thanks again for the references.
Comment 18 scripptor 2022-06-21 16:09:25 UTC
(In reply to tagwerk19 from comment #16)
> (In reply to scripptor from comment #14)
> > SOFTWARE/OS VERSIONS
> > Linux/KDE Plasma: openSuse Tumbleweed 20220613
> (In reply to Martin Schnitkemper from comment #15)
> > Operating System is Arch Linux ...
> It's possible that the issue is the filesystem rather than (directly) the
> distibution.
> 
> Are you using Tumbleweed with BTRFS (with multiple subvols)? If so have a
> look at:
>     https://bugs.kde.org/show_bug.cgi?id=402154#c12
> and check whether you are seeing the "Device" number changing. This can make
> the index 'baloon' in size on disc and in memory, maybe to the point baloo
> fails.
> 
> OpenSUSE/Tumbleweed, I think does use BTRFS. Arch, I've seen people report
> both ext4 and BTRFS

A little addendum here:
I read the post you referenced and tried whether baloo would show me a different id for the test-file I created as well as using baloosearch to find the content. I did 3 reboots, but until now the id didn't change as well as baloosearch is showing me only 1 entry (the commands I used were directly copy-pasted from the post).

So it doesn't seem to be related in that case (for now).
Comment 19 Nicolas Fella 2023-08-13 15:16:37 UTC
*** Bug 468766 has been marked as a duplicate of this bug. ***
Comment 20 Nicolas Fella 2023-08-13 15:16:57 UTC
*** Bug 467769 has been marked as a duplicate of this bug. ***
Comment 21 Nicolas Fella 2023-08-13 15:17:20 UTC
*** Bug 472540 has been marked as a duplicate of this bug. ***
Comment 22 Christoph Cullmann 2024-08-25 21:56:09 UTC
We try to not delete the lock file now, perhaps this was just the result of a race condition because of the old lock file deletion.

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