Bug 489275 - Crash when extracting content from mobipocket file
Summary: Crash when extracting content from mobipocket file
Status: RESOLVED WAITINGFORINFO
Alias: None
Product: kdegraphics-mobipocket
Classification: Frameworks and Libraries
Component: general (other bugs)
Version First Reported In: 2.1.0
Platform: Neon Linux
: NOR crash
Target Milestone: ---
Assignee: Unassigned bugs
URL:
Keywords: drkonqi
Depends on:
Blocks:
 
Reported: 2024-06-27 02:40 UTC by Danilo Araujo
Modified: 2025-08-14 12:51 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Danilo Araujo 2024-06-27 02:40:29 UTC
Application: baloo_file_extractor (6.3.0)

Qt Version: 6.7.0
Frameworks Version: 6.3.0
Operating System: Linux 6.5.0-41-generic x86_64
Windowing System: X11
Distribution: KDE neon 6.0
DrKonqi: 6.1.0 [KCrashBackend]

-- Information about the crash:
This occurs after logging in and repeats constantly.

The crash can be reproduced sometimes.

-- Backtrace:
Application: Extrator de arquivos do Baloo (baloo_file_extractor), signal: Aborted
Content of s_kcrashErrorMessage: std::unique_ptr<char []> = {get() = <optimized out>}
[KCrash Handler]
#6  __pthread_kill_implementation (no_tid=0, signo=6, threadid=131652004280896) at ./nptl/pthread_kill.c:44
#7  __pthread_kill_internal (signo=6, threadid=131652004280896) at ./nptl/pthread_kill.c:78
#8  __GI___pthread_kill (threadid=131652004280896, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
#9  0x000077bc9fa42476 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#10 0x000077bc9fa287f3 in __GI_abort () at ./stdlib/abort.c:79
#11 0x000077bca06fdb6e in qAbort () at ./src/corelib/global/qglobal.cpp:161
#12 0x000077bca06f820a in qt_message_fatal<QString&> (message=..., context=...) at ./src/corelib/global/qlogging.cpp:2025
#13 qt_message(QtMsgType, const QMessageLogContext &, const char *, typedef __va_list_tag __va_list_tag *) (msgType=msgType@entry=QtFatalMsg, context=..., msg=<optimized out>, ap=ap@entry=0x7fff19a0cbf0) at ./src/corelib/global/qlogging.cpp:374
#14 0x000077bca06fe511 in QMessageLogger::fatal (this=<optimized out>, msg=<optimized out>) at ./src/corelib/global/qlogging.cpp:889
#15 0x000077bca06c2ac2 in qt_assert (assertion=assertion@entry=0x777c99ab042d "n <= d.size - pos", file=file@entry=0x777c99ab0040 "/usr/include/x86_64-linux-gnu/qt6/QtCore/qbytearray.h", line=line@entry=549) at ./src/corelib/global/qassert.cpp:68
#16 0x0000777c99aa96c3 in QByteArray::verify (n=<optimized out>, pos=<optimized out>, this=<optimized out>) at /usr/include/x86_64-linux-gnu/qt6/QtCore/qbytearray.h:549
#17 QByteArray::operator[] (i=<optimized out>, this=<optimized out>) at /usr/include/x86_64-linux-gnu/qt6/QtCore/qbytearray.h:635
#18 0x0000777c99aa9a3c in QByteArray::operator[] (i=<optimized out>, this=<optimized out>) at /usr/include/x86_64-linux-gnu/qt6/QtCore/qbytearray.h:547
#19 Mobipocket::BitReader::read (this=<optimized out>) at ./lib/decompressor.cpp:69
#20 Mobipocket::HuffdicDecompressor::unpack (this=0x5798f11b9610, reader=..., depth=1) at ./lib/decompressor.cpp:202
#21 0x0000777c99aabb64 in Mobipocket::HuffdicDecompressor::unpack (this=0x5798f11b9610, reader=..., depth=0) at ./lib/decompressor.cpp:225
#22 0x0000777c99aabd0f in Mobipocket::HuffdicDecompressor::decompress (this=this@entry=0x5798f11b9610, data=...) at ./lib/decompressor.cpp:194
#23 0x0000777c99aaeceb in Mobipocket::Document::text (this=this@entry=0x7fff19a0d008, size=size@entry=-1) at ./lib/mobipocket.cpp:261
#24 0x000077bc9c0140f9 in KFileMetaData::MobiExtractor::extract (this=<optimized out>, result=0x7fff19a0d490) at ./src/extractors/mobiextractor.cpp:93
#25 0x00005798ef59b120 in Baloo::App::index (this=0x7fff19a0dce0, tr=0x5798f0ce6020, url=..., id=220763301222222985) at ./src/file/extractor/app.cpp:180
#26 0x00005798ef59c3ee in Baloo::App::processNextFile (this=0x7fff19a0dce0) at /usr/include/c++/11/bits/unique_ptr.h:173
#27 0x000077bca066355e in QtPrivate::QSlotObjectBase::call (a=<optimized out>, r=<optimized out>, this=<optimized out>, this=<optimized out>, r=<optimized out>, a=<optimized out>) at ./src/corelib/kernel/qobjectdefs_impl.h:469
#28 doActivate<false> (sender=0x5798f0efd7a0, signal_index=3, argv=0x7fff19a0d808) at ./src/corelib/kernel/qobject.cpp:4078
#29 0x000077bca061655e in QSingleShotTimer::timeout (this=0x5798f0efd7a0) at ./obj-x86_64-linux-gnu/src/corelib/Core_autogen/7GB2EGQPHR/moc_qsingleshottimer_p.cpp:139
#30 QSingleShotTimer::timerEvent (this=0x5798f0efd7a0) at ./src/corelib/kernel/qsingleshottimer_p.h:116
#31 0x000077bca05fa1ce in QObject::event (this=0x5798f0efd7a0, e=0x7fff19a0d990) at ./src/corelib/kernel/qobject.cpp:1423
#32 0x000077bca06a1c13 in doNotify (event=<optimized out>, receiver=<optimized out>) at ./src/corelib/kernel/qcoreapplication.cpp:1235
#33 QCoreApplication::notify (event=<optimized out>, receiver=<optimized out>, this=<optimized out>) at ./src/corelib/kernel/qcoreapplication.cpp:1218
#34 QCoreApplication::notifyInternal2 (receiver=0x5798f0efd7a0, event=0x7fff19a0d990) at ./src/corelib/kernel/qcoreapplication.cpp:1134
#35 0x000077bca0582dda in QTimerInfoList::activateTimers (this=<optimized out>) at ./src/corelib/kernel/qtimerinfo_unix.cpp:436
#36 0x000077bca0478004 in timerSourceDispatch (source=<optimized out>) at ./src/corelib/kernel/qeventdispatcher_glib.cpp:150
#37 idleTimerSourceDispatch (source=<optimized out>) at ./src/corelib/kernel/qeventdispatcher_glib.cpp:197
#38 0x000077bc9e920d3b in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#39 0x000077bc9e9762b8 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#40 0x000077bc9e91e3e3 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#41 0x000077bca0476570 in QEventDispatcherGlib::processEvents (this=0x5798f0cb1e90, flags=...) at ./src/corelib/kernel/qeventdispatcher_glib.cpp:394
#42 0x000077bca06a3e3b in QEventLoop::exec (this=this@entry=0x7fff19a0dbf0, flags=..., flags@entry=...) at ./src/corelib/global/qflags.h:34
#43 0x000077bca06a5a6c in QCoreApplication::exec () at ./src/corelib/global/qflags.h:74
#44 0x00005798ef590c8a in main (argc=<optimized out>, argv=<optimized out>) at ./src/file/extractor/main.cpp:33
[Inferior 1 (process 6112) detached]

Reported using DrKonqi
Comment 1 tagwerk19 2024-06-27 07:25:04 UTC
(In reply to Danilo Araujo from comment #0)
> Application: baloo_file_extractor (6.3.0)
>  ...
> #19 Mobipocket::BitReader::read (this=<optimized out>) at ./lib/decompressor.cpp:69
> #20 Mobipocket::HuffdicDecompressor::unpack (this=0x5798f11b9610, reader=..., depth=1) at ./lib/decompressor.cpp:202
> #21 0x0000777c99aabb64 in Mobipocket::HuffdicDecompressor::unpack (this=0x5798f11b9610, reader=..., depth=0) at ./lib/decompressor.cpp:225
> #22 0x0000777c99aabd0f in Mobipocket::HuffdicDecompressor::decompress (this=this@entry=0x5798f11b9610, data=...) at ./lib/decompressor.cpp:194
> #23 0x0000777c99aaeceb in Mobipocket::Document::text (this=this@entry=0x7fff19a0d008, size=size@entry=-1) at ./lib/mobipocket.cpp:261
> #24 0x000077bc9c0140f9 in KFileMetaData::MobiExtractor::extract (this=<optimized out>, result=0x7fff19a0d490) at ./src/extractors/mobiextractor.cpp:93
There have been a number of .mobi related crashes recently, see Bug 475975

This looks a little different but it still suggest the .mobi extractor needs some more love. You might try to see if Calibre can read and convert the file, https://bugs.kde.org/show_bug.cgi?id=475975#c5
Comment 2 Stefan Brüns 2025-02-23 03:35:56 UTC
Two possible explanations:
- Some distributions have started to enable the QMobipocket depedency for KFileMetaData
- Download & Transfer for Kindle eBooks Going Away on February 26 [1]

[1] https://blog.the-ebook-reader.com/2025/02/12/download-transfer-for-kindle-ebooks-going-away-on-february-26/
Comment 3 Stefan Brüns 2025-02-23 03:55:23 UTC
Git commit a188b893654fe5f88b1ebab7e8341ceb181f6dc9 by Stefan Brüns.
Committed on 23/02/2025 at 03:54.
Pushed by bruns into branch 'disable_mobipocket_text'.

[MobiExtractor] Disable buggy text extraction by default

The text extraction in mobiextractor is extremely buggy, and causes
a lot of bug reports for baloo (which then gets blamed for its
"buggyness" when calling third-party code).

QMobipocket lacks support for any halfway current mobipocket version
(last supported: 4, current: 8), and has no testsuite.

Make this opt-in ("ENABLE_MOBIPOCKET_TEXT_EXTRACTION") until the bugs
in QMobiPocket gets fixed.

SENTRY: BALOO-2N5
SENTRY: BALOO-426
SENTRY: BALOO-33
// use `stack.filename is mobipocket.cpp` for more
Related: bug 475975, bug 482420

M  +1    -0    CMakeLists.txt
M  +3    -0    src/extractors/CMakeLists.txt
M  +2    -1    src/extractors/mobiextractor.cpp

https://invent.kde.org/frameworks/kfilemetadata/-/commit/a188b893654fe5f88b1ebab7e8341ceb181f6dc9
Comment 4 Stefan Brüns 2025-03-15 12:20:05 UTC
Git commit 8bd1e61cca1e07a0ffce7ff79b861e2872662e6d by Stefan Brüns.
Committed on 15/03/2025 at 12:16.
Pushed by bruns into branch 'master'.

[MobiExtractor] Disable buggy text extraction by default

The text extraction in mobiextractor is extremely buggy, and causes
a lot of bug reports for baloo (which then gets blamed for its
"buggyness" when calling third-party code).

QMobipocket lacks support for any halfway current mobipocket version
(last supported: 4, current: 8), and has no testsuite.

Make this opt-in ("ENABLE_MOBIPOCKET_TEXT_EXTRACTION") until the bugs
in QMobiPocket gets fixed.

SENTRY: BALOO-2N5
SENTRY: BALOO-426
SENTRY: BALOO-33
// use `stack.filename is mobipocket.cpp` for more
Related: bug 475975, bug 482420

M  +1    -0    CMakeLists.txt
M  +3    -0    src/extractors/CMakeLists.txt
M  +2    -1    src/extractors/mobiextractor.cpp

https://invent.kde.org/frameworks/kfilemetadata/-/commit/8bd1e61cca1e07a0ffce7ff79b861e2872662e6d
Comment 5 Bug Janitor Service 2025-06-01 23:32:03 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/kdegraphics-mobipocket/-/merge_requests/35
Comment 6 Stefan Brüns 2025-06-09 08:47:44 UTC
Git commit 439a01662e72102e114a46d168fbabbb4de04184 by Stefan Brüns.
Committed on 07/06/2025 at 15:19.
Pushed by bruns into branch 'master'.

Handle trailing data entries correctly

Text records may contain extra auxiliary data which should not be fed
to the decompressor.

The existence of such data is signalled by the `extraflags` header field,
and each set bit signals the corresponding extra data which will be
present in all text records.

The entries can be decoded (or removed) by reading the record from the
back. When an entry is present, its size will be at the very end of the
record, preceded by the actual data.
Related: bug 475975, bug 482420

M  +0    -1    autotests/mobipockettest.cpp
M  +62   -3    lib/mobipocket.cpp

https://invent.kde.org/graphics/kdegraphics-mobipocket/-/commit/439a01662e72102e114a46d168fbabbb4de04184
Comment 7 Stefan Brüns 2025-08-14 12:51:30 UTC
Likely fixed in 25.08.