Bug 466540

Summary: baloo_file_extractor crashes on startup
Product: [Frameworks and Libraries] frameworks-kfilemetadata Reporter: aronkvh
Component: generalAssignee: Pinak Ahuja <pinak.ahuja>
Status: RESOLVED DOWNSTREAM    
Severity: crash CC: stefan.bruens, tagwerk19
Priority: NOR    
Version First Reported In: 5.103.0   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description aronkvh 2023-02-27 16:00:10 UTC
baloo_file_extractor crashes and a drkonqi window appears at every boot.

Operating System: KDE neon 5.27
KDE Plasma Version: 5.27.1
KDE Frameworks Version: 5.103.0
Qt Version: 5.15.8
Kernel Version: 5.19.0-32-generic (64-bit)
Graphics Platform: X11

Application: baloo_file_extractor (baloo_file_extractor), signal: Segmentation fault
[KCrash Handler]
#4  __strcmp_sse2_unaligned () at ../sysdeps/x86_64/multiarch/strcmp-sse2-unaligned.S:32
#5  0x00007fd40250c338 in FindNode () from /lib/libepub.so.0
#6  0x00007fd40250b009 in _opf_manifest_get_by_id () from /lib/libepub.so.0
#7  0x00007fd4025081bd in _get_spine_it_url () from /lib/libepub.so.0
#8  0x00007fd402508262 in epub_it_get_curr () from /lib/libepub.so.0
#9  0x00007fd4025150d7 in ?? () from /usr/lib/x86_64-linux-gnu/qt5/plugins/kf5/kfilemetadata/kfilemetadata_epubextractor.so
#10 0x000055df1785b260 in ?? ()
#11 0x000055df1785d0ee in ?? ()
#12 0x00007fd407ef81f6 in QtPrivate::QSlotObjectBase::call (a=0x7ffde6c10fb0, r=<optimized out>, this=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#13 QSingleShotTimer::timerEvent (this=0x55df19112aa0) at kernel/qtimer.cpp:320
#14 0x00007fd407ee99ff in QObject::event (this=0x55df19112aa0, e=0x7ffde6c110f0) at kernel/qobject.cpp:1369
#15 0x00007fd407ebc07a in QCoreApplication::notifyInternal2 (receiver=0x55df19112aa0, event=0x7ffde6c110f0) at kernel/qcoreapplication.cpp:1064
#16 0x00007fd407f14e0b in QTimerInfoList::activateTimers (this=0x55df190e3860) at kernel/qtimerinfo_unix.cpp:643
#17 0x00007fd407f1570c in timerSourceDispatch (source=<optimized out>) at kernel/qeventdispatcher_glib.cpp:183
#18 0x00007fd4069c2d3b in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#19 0x00007fd406a176c8 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#20 0x00007fd4069c03e3 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#21 0x00007fd407f15ad8 in QEventDispatcherGlib::processEvents (this=0x55df190db100, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#22 0x00007fd407eba99b in QEventLoop::exec (this=this@entry=0x7ffde6c11330, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:69
#23 0x00007fd407ec2f34 in QCoreApplication::exec () at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#24 0x000055df17852dc2 in ?? ()
#25 0x00007fd407429d90 in __libc_start_call_main (main=main@entry=0x55df17852210, argc=argc@entry=1, argv=argv@entry=0x7ffde6c11698) at ../sysdeps/nptl/libc_start_call_main.h:58
#26 0x00007fd407429e40 in __libc_start_main_impl (main=0x55df17852210, argc=1, argv=0x7ffde6c11698, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffde6c11688) at ../csu/libc-start.c:392
#27 0x000055df17852ef5 in ?? ()
[Inferior 1 (process 2639) detached]
Comment 1 tagwerk19 2023-02-27 20:36:27 UTC
(In reply to aronkvh from comment #0)
> baloo_file_extractor crashes and a drkonqi window appears at every boot.
> ...
> #9  0x00007fd4025150d7 in ?? () from /usr/lib/x86_64-linux-gnu/qt5/plugins/kf5/kfilemetadata/kfilemetadata_epubextractor.so
> ...
I can only guess at this stuff, but that looks as if baloo_file_extractor is failing when trying to get data out of an epub.

Do you have epubs in your indexed folders?

You might be able to get more details by turning on logging:

Create a folder
    ~/.config/QtProject/
and then a file
    ~/.config/QtProject/qtlogging.ini
that contains
    [Rules]
    kf.filemetadata=true
    kf.baloo=true

With that you might (should) see log messages appearing when you check with journalctl
Comment 2 Bug Janitor Service 2023-03-14 03:45:46 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 3 aronkvh 2023-03-19 17:08:26 UTC
It stopped happening after around a week after deleting a faulty .epub file
Comment 4 tagwerk19 2023-03-19 22:46:55 UTC
You didn't keep a copy of the corrupt .epub?

It shouldn't be that a corrupt file causes baloo (kfilemetadata extractor) to crash...
Comment 5 aronkvh 2023-03-20 18:48:44 UTC
(In reply to tagwerk19 from comment #4)
> You didn't keep a copy of the corrupt .epub?
> 
> It shouldn't be that a corrupt file causes baloo (kfilemetadata extractor)
> to crash...

I managed to find it again: https://bugs.kde.org/attachment.cgi?id=157452
Comment 6 tagwerk19 2023-03-20 20:56:54 UTC
(In reply to aronkvh from comment #5)
> I managed to find it again: https://bugs.kde.org/attachment.cgi?id=157452
Oh yes, so it does. Tbanks!

Flagging as Confirmed.

Looking at the file with epubcheck
    https://www.w3.org/publishing/epubcheck/
gives a collection of errors (including one fatal)
Comment 7 Stefan Brüns 2023-04-23 04:23:30 UTC
Actually its a bug in the used libepub from ebook-tools.

You can also try to open the file with okular, which will also crash.
Comment 8 Stefan Brüns 2023-04-23 04:26:46 UTC
Fix pending on openSUSE (https://build.opensuse.org/request/show/1082236), for any other distribution your mileage may vary.
Comment 9 tagwerk19 2023-04-23 05:44:34 UTC
(In reply to Stefan Brüns from comment #8)
> Fix pending on openSUSE ...
I read that as the "upstream" is not maintained, so it is up to individual distributions to patch their own copies (?)
Comment 10 Stefan Brüns 2023-04-24 15:39:04 UTC
(In reply to tagwerk19 from comment #9)
> (In reply to Stefan Brüns from comment #8)
> > Fix pending on openSUSE ...
> I read that as the "upstream" is not maintained, so it is up to individual
> distributions to patch their own copies (?)

Yes. After all, thats one of the major reasons for distributions to exist (do the work otherwise each individual user has to do).

Fix ships with the next openSUSE TW release.