Summary: | akonadi_indexing_agent crashes due to GlassTable::set_overwritten throwing an error | ||
---|---|---|---|
Product: | [Frameworks and Libraries] Akonadi | Reporter: | Victor Mataré <vmatare+kdebug> |
Component: | general | Assignee: | kdepim bugs <kdepim-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | crash | CC: | a.samirh78, chrigi_1, cn001, delian2, dvratil, fabian.kislat, marvelvance, vmatare+kdebug, webmaster |
Priority: | NOR | Keywords: | drkonqi |
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Gentoo Packages | ||
OS: | Linux | ||
URL: | https://getting-started-with-xapian.readthedocs.io/en/latest/practical_example/searching/database_modified.html | ||
Latest Commit: | https://invent.kde.org/pim/akonadi-search/commit/ff6cdf57350228004ad431b7b0d98fa8d3f7d120 | Version Fixed In: | |
Sentry Crash Report: | |||
Attachments: | New crash information added by DrKonqi |
Description
Victor Mataré
2018-12-07 16:33:54 UTC
Created attachment 117557 [details]
New crash information added by DrKonqi
kmail (5.10.1) using Qt 5.11.3
- What I was doing when the application crashed:
Same thing as before: KMail just sitting idly. The improved backtrace suggests it's related to an indexing job happening sometime in the background.
-- Backtrace (Reduced):
#6 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#7 0x00007f46ceda76c0 in __GI_abort () at abort.c:79
#8 0x00007f46cefd9a0e in __gnu_cxx::__verbose_terminate_handler () at /var/tmp/portage/sys-devel/gcc-8.2.0-r6/work/gcc-8.2.0/libstdc++-v3/libsupc++/vterminate.cc:95
#9 0x00007f46ceffdca6 in __cxxabiv1::__terminate (handler=<optimized out>) at /var/tmp/portage/sys-devel/gcc-8.2.0-r6/work/gcc-8.2.0/libstdc++-v3/libsupc++/eh_terminate.cc:47
#10 0x00007f46ceffdce1 in std::terminate () at /var/tmp/portage/sys-devel/gcc-8.2.0-r6/work/gcc-8.2.0/libstdc++-v3/libsupc++/eh_terminate.cc:57
The Xapian documentation on DatabaseModifiedError: https://getting-started-with-xapian.readthedocs.io/en/latest/practical_example/searching/database_modified.html So that makes it sound like a pretty straightforward fix...? See also the location where the exception is thrown from Xapian: https://git.xapian.org/?p=xapian;a=blob;f=xapian-core/backends/glass/glass_table.cc;h=c733e9b8b16480adf2f4296b0f659f13719945a1;hb=e31683f3500dd8c6f2a0450c07c661e4eb1d309c Seems the what() message isn't reported by drkonqi, so here it is for completeness sake: The revision being read has been discarded - you should call Xapian::Database::reopen() and retry the operation *** Bug 404194 has been marked as a duplicate of this bug. *** *** Bug 406822 has been marked as a duplicate of this bug. *** *** Bug 422962 has been marked as a duplicate of this bug. *** *** Bug 425053 has been marked as a duplicate of this bug. *** Better backtrace, from bug 425053: [KCrash Handler] #4 0x00007f72d6ff3355 in raise () at /usr/lib/libc.so.6 #5 0x00007f72d6fdc853 in abort () at /usr/lib/libc.so.6 #6 0x00007f72d723086a in __gnu_cxx::__verbose_terminate_handler() () at /build/gcc/src/gcc/libstdc++-v3/libsupc++/vterminate.cc:95 #7 0x00007f72d723cd8a in __cxxabiv1::__terminate(void (*)()) (handler=<optimized out>) at /build/gcc/src/gcc/libstdc++-v3/libsupc++/eh_terminate.cc:48 #8 0x00007f72d723cdf7 in std::terminate() () at /build/gcc/src/gcc/libstdc++-v3/libsupc++/eh_terminate.cc:58 #9 0x00007f72d723d09e in __cxxabiv1::__cxa_throw(void*, std::type_info*, void (*)(void*)) (obj=obj@entry=0x55c12227e6c0, tinfo=0x7f72d8cb6770 <typeinfo for Xapian::DatabaseModifiedError>, tinfo@entry=0x7f72d8c40850 <typeinfo for Xapian::DatabaseModifiedError>, dest=dest@entry=0x7f72d8adc430 <Xapian::DatabaseModifiedError::~DatabaseModifiedError()>) at /build/gcc/src/gcc/libstdc++-v3/libsupc++/eh_throw.cc:95 #10 0x00007f72d8a70f80 in GlassTable::set_overwritten() const (this=this@entry=0x55c12240e020) at /usr/include/c++/10.1.0/ext/new_allocator.h:89 #11 0x00007f72d8a712be in GlassTable::block_to_cursor(Glass::Cursor*, int, unsigned int) const (this=0x55c12240e020, C_=0x55c12240e0e8, j=<optimized out>, n=12414) at backends/glass/glass_table.cc:335 #12 0x00007f72d8b34c75 in GlassTable::find(Glass::Cursor*) const (this=this@entry=0x55c12240e020, C_=C_@entry=0x55c12240e0e8) at ./common/wordaccess.h:57 #13 0x00007f72d8b35321 in GlassTable::get_exact_entry(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) const (this=this@entry=0x55c12240e020, key="C32", tag="") at backends/glass/glass_table.cc:1482 #14 0x00007f72d8b256e8 in GlassPostListTable::get_freqs(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int*, unsigned int*, unsigned int*) const (this=0x55c12240e020, term=..., termfreq_ptr=0x7ffd27212f08, collfreq_ptr=0x7ffd27212f0c, wdfub_ptr=0x0) at backends/glass/glass_postlist.cc:159 #15 0x00007f72d8bc17d1 in Xapian::Weight::Internal::accumulate_stats(Xapian::Database::Internal const&, Xapian::RSet const&) (this=0x55c122407450, subdb=..., rset=...) at weight/weightinternal.cc:91 #16 0x00007f72d8b804d8 in LocalSubMatch::prepare_match(bool, Xapian::Weight::Internal&) (this=<optimized out>, nowait=<optimized out>, total_stats=...) at matcher/localsubmatch.cc:172 #17 0x00007f72d8b88851 in prepare_sub_matches (stats=..., leaves=std::vector of length 1, capacity 1 = {...}) at matcher/multimatch.cc:237 #18 MultiMatch::MultiMatch(Xapian::Database const&, Xapian::Query const&, unsigned int, Xapian::RSet const*, unsigned int, unsigned int, int, double, Xapian::Enquire::docid_order, unsigned int, Xapian::Enquire::Internal::sort_setting, bool, double, Xapian::Weight::Internal&, Xapian::Weight const*, std::vector<Xapian::Internal::opt_intrusive_ptr<Xapian::MatchSpy>, std::allocator<Xapian::Internal::opt_intrusive_ptr<Xapian::MatchSpy> > > const&, bool, bool) (this=0x7ffd27213180, db_=..., query_=..., qlen=<optimized out>, omrset=0x0, collapse_max_=<optimized out>, collapse_key_=4294967295, percent_cutoff_=0, weight_cutoff_=<optimized out>, order_=Xapian::Enquire::ASCENDING, sort_key_=4294967295, sort_by_=Xapian::Enquire::Internal::REL, sort_value_forward_=true, time_limit_=<optimized out>, stats=..., weight_=0x55c122412150, matchspies_=std::vector of length 0, capacity 0, have_sorter=false, have_mdecider=false) at matcher/multimatch.cc:353 #19 0x00007f72d8a97d66 in Xapian::Enquire::Internal::get_mset(unsigned int, unsigned int, unsigned int, Xapian::RSet const*, Xapian::MatchDecider const*) const (this=0x7f72c0008790, first=0, maxitems=44788, check_at_least=<optimized out>, rset=0x0, mdecider=0x0) at ./include/xapian/intrusive_ptr.h:352 #20 0x00007f72d8a98016 in Xapian::Enquire::get_mset(unsigned int, unsigned int, unsigned int, Xapian::RSet const*, Xapian::MatchDecider const*) const (this=this@entry=0x7ffd27213350, first=first@entry=0, maxitems=maxitems@entry=4294967295, check_at_least=check_at_least@entry=0, rset=rset@entry=0x0, mdecider=0x0) at ./include/xapian/intrusive_ptr.h:165 #21 0x00007f72d8c965fd in Akonadi::Search::PIM::IndexedItemsPrivate::findIndexedInDatabase(QSet<long long>&, long long, QString const&) (this=<optimized out>, indexed=..., collectionId=<optimized out>, dbPath=...) at /usr/src/debug/akonadi-search-20.04.3/lib/indexeditems.cpp:163 #22 0x00007f72d8c969d1 in Akonadi::Search::PIM::IndexedItemsPrivate::findIndexed(QSet<long long>&, long long) (this=0x55c12228d3e0, indexed=..., collectionId=32) at /usr/src/debug/akonadi-search-20.04.3/lib/indexeditems.cpp:100 #23 0x000055c12113c80c in CollectionIndexingJob::findUnindexed() (this=0x55c12228de10) at /usr/src/debug/akonadi-search-20.04.3/agent/collectionindexingjob.cpp:183 #24 0x00007f72d7663906 in QtPrivate::QSlotObjectBase::call(QObject*, void**) (a=0x7ffd27213620, r=0x55c12228de10, this=0x55c12228ec50) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398 #25 doActivate<false>(QObject*, int, void**) (sender=0x55c12228ec20, signal_index=3, argv=argv@entry=0x7ffd27213620) at kernel/qobject.cpp:3886 #26 0x00007f72d765caa0 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) (sender=sender@entry=0x55c12228ec20, m=m@entry=0x7f72d80bbdc0 <KJob::staticMetaObject>, local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x7ffd27213620) at kernel/qobject.cpp:3946 #27 0x00007f72d806831a in KJob::finished(KJob*, KJob::QPrivateSignal) (this=this@entry=0x55c12228ec20, _t1=<optimized out>, _t1@entry=0x55c12228ec20, _t2=...) at /usr/src/debug/build/src/lib/KF5CoreAddons_autogen/include/moc_kjob.cpp:555 #28 0x00007f72d8068f5e in KJob::finishJob(bool) (this=0x55c12228ec20, emitResult=<optimized out>) at /usr/src/debug/kcoreaddons-5.72.0/src/lib/jobs/kjob.cpp:93 #29 0x00007f72d76590b2 in QObject::event(QEvent*) (this=0x55c12228ec20, e=0x55c12228c820) at kernel/qobject.cpp:1314 #30 0x00007f72d82216f2 in QApplicationPrivate::notify_helper(QObject*, QEvent*) (this=<optimized out>, receiver=0x55c12228ec20, e=0x55c12228c820) at kernel/qapplication.cpp:3671 #31 0x00007f72d762c69a in QCoreApplication::notifyInternal2(QObject*, QEvent*) (receiver=0x55c12228ec20, event=0x55c12228c820) at ../../include/QtCore/5.15.0/QtCore/private/../../../../../src/corelib/thread/qthread_p.h:325 #32 0x00007f72d762f183 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) (receiver=0x0, event_type=0, data=0x55c1221f6d80) at kernel/qcoreapplication.cpp:1815 #33 0x00007f72d7685bd4 in postEventSourceDispatch(GSource*, GSourceFunc, gpointer) (s=0x55c122259470) at kernel/qeventdispatcher_glib.cpp:277 #34 0x00007f72d3f2543c in g_main_context_dispatch () at /usr/lib/libglib-2.0.so.0 #35 0x00007f72d3f731d9 in () at /usr/lib/libglib-2.0.so.0 #36 0x00007f72d3f24221 in g_main_context_iteration () at /usr/lib/libglib-2.0.so.0 #37 0x00007f72d7685211 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x55c12225aad0, flags=...) at kernel/qeventdispatcher_glib.cpp:423 #38 0x00007f72d762b01c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (this=this@entry=0x7ffd27213a10, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:141 #39 0x00007f72d76334a4 in QCoreApplication::exec() () at ../../include/QtCore/../../src/corelib/global/qflags.h:121 #40 0x000055c12112baee in Akonadi::AgentBase::init<AkonadiIndexingAgent>(int, char**) (argc=<optimized out>, argv=0x7ffd27213aa0) at /usr/include/KF5/AkonadiAgentBase/agentbase.h:467 #41 0x00007f72d6fde002 in __libc_start_main () at /usr/lib/libc.so.6 #42 0x000055c121125dae in _start () [Inferior 1 (process 2498) detached] A possibly relevant merge request was started @ https://invent.kde.org/pim/akonadi-search/-/merge_requests/2 *** Bug 417863 has been marked as a duplicate of this bug. *** Couldn't find the component for akonadi-search. Git commit ff6cdf57350228004ad431b7b0d98fa8d3f7d120 by Ahmad Samir. Committed on 18/08/2020 at 17:41. Pushed by dvratil into branch 'master'. Fix crash by handling exceptions thrown by GlassTable::set_overwritten Xapian::Enquire::get_mset ultimately calls GlassTable::block_to_cursor, which could throw Xapian::DatabaseModifiedError if the database has been modified/deviated too much since it was opened for searching; handle that case by trying to call reopen on the database (as per the upstream error message[1]), then query it again, if that fails just return. Also handle one other exception, Xapian::DatabaseCorruptError; this has been reported in [2]. Use QByteArray::toStdString when calling the Xapian::Database ctor. [1] https://xapian.org/docs/sourcedoc/html/glass__table_8cc_source.html#l00288 [2] https://bugs.kde.org/show_bug.cgi?id=363928#c9 Related: bug 363928 M +24 -5 lib/indexeditems.cpp https://invent.kde.org/pim/akonadi-search/commit/ff6cdf57350228004ad431b7b0d98fa8d3f7d120 |