https://bugs.kde.org/show_bug.cgi?id=528511
Bug ID: 528511
Summary: baloo_file_extractor crashes (SIGABRT) when spawned by
daemon: Qt GUI platform cannot initialize without
DISPLAY
Classification: Frameworks and Libraries
Product: frameworks-baloo
Version First 6.27.0
Reported In:
Platform: KDE Linux
OS: Linux
Status: REPORTED
Severity: crash
Priority: NOR
Component: Baloo File Daemon
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: ---
aloo_file_extractor aborts on every invocation during content indexing. The
daemon spawns the extractor with a stripped environment containing only
DBUS_SESSION_BUS_ADDRESS (no DISPLAY, no QT_QPA_PLATFORM). Because the
extractor is a QGuiApplication (it uses KIdleTime, which requires a GUI
platform), Qt's xcb platform plugin fails to initialize and init_platform calls
qFatal → SIGABRT. Filename indexing works; content/full-text indexing is
entirely broken.
Reproduction:
Ensure baloo content indexing is enabled (balooctl6 config set contentIndexing
true).
Trigger indexing of a file requiring content extraction (e.g. an image/PNG):
balooctl6 clear <file> && balooctl6 index <file>.
Observe baloo_file_extractor crash in coredumpctl (SIGABRT) and journalctl
--user -u kde-baloo.service ("Extractor crashed").
Minimal repro of the underlying cause (no daemon needed):
env -u DISPLAY -u XAUTHORITY /usr/libexec/kf6/baloo_file_extractor; echo
"exit=$?"
→ Aborted (core dumped), exit 134 (SIGABRT). Journal: "could not connect to
display … From 6.5.0, xcb-cursor0 or libxcb-cursor0 is needed to load the Qt
xcb platform plugin."
Backtrace (from coredump, pid 313167):
#0 __pthread_kill_implementation
#1 raise
#2 abort
#3 qAbort()
#4 qt_message
#5 QMessageLogger::fatal
#6 init_platform [clone .cold] (libQt6Gui.so.6)
#7 QGuiApplicationPrivate::createPlatformIntegration()
#8 QGuiApplicationPrivate::createEventDispatcher()
#9 QCoreApplicationPrivate::init()
#10 QGuiApplicationPrivate::init()
#11 QGuiApplication::QGuiApplication
#12 main (baloo_file_extractor)
Modules loaded include libQt6XcbQpa.so.6 and libxcb-cursor.so.0 — the library
is present; the failure is the missing display connection, not a missing
package.
Root-cause analysis:
src/file/extractor/main.cpp constructs a QGuiApplication (uses KIdleTime).
src/file/extractorprocess.cpp spawns it via QProcess with no
setProcessEnvironment, so in principle it should inherit the daemon's env.
However, the spawned process's /proc/<pid>/environ contains only
DBUS_SESSION_BUS_ADDRESS — DISPLAY and any service-level QT_QPA_PLATFORM are
not present. (Verified with the daemon running under systemd with both vars
set; child still stripped.)
So the extractor can never initialize the xcb platform and aborts on every
batch.
Workarounds (verified):
Disable content indexing: balooctl6 config set contentIndexing false (sets
onlyBasicIndexing=true). Stops the crash loop; loses full-text search.
Filename/metadata search still works.
Run the extractor with QT_QPA_PLATFORM=offscreen (e.g. via a wrapper around
/usr/libexec/kf6/baloo_file_extractor) → exits 0, no crash.
Suggested fix (upstream):
Either make the extractor a QCoreApplication-based process (remove the
GUI/KIdleTime dependency, or guard it so platform init isn't required), or
have the daemon spawn it with QT_QPA_PLATFORM=offscreen (or pass -platform
offscreen), or
propagate DISPLAY/QT_QPA_PLATFORM explicitly when starting the extractor.
Note: the same issue exists in the current git (6.31.0) source —
extractor/main.cpp still uses QGuiApplication and extractorprocess.cpp still
doesn't set the platform.
Secondary issue (cosmetic): on startup the extractor logs Failed to register
with host portal: Could not register app ID: App info not found for
'org.kde.baloo' — there is no org.kde.baloo.desktop file (only
org.kde.baloorunner.desktop). Non-fatal but could be fixed by shipping the
desktop file.
--
You are receiving this mail because:
You are watching all bug changes.