Bug 470984 - Various things fail to launch with errors saying "qt.qpa.xcb: could not connect to display" and "Detected locale "C" with character encoding "UTF-8", which is not UTF-8"
Summary: Various things fail to launch with errors saying "qt.qpa.xcb: could not conne...
Status: RESOLVED FIXED
Alias: None
Product: plasma-integration
Classification: Plasma
Component: general (show other bugs)
Version: master
Platform: Other Linux
: NOR grave
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords: qt6
: 470932 470981 (view as bug list)
Depends on:
Blocks:
 
Reported: 2023-06-13 16:44 UTC by Nate Graham
Modified: 2023-06-13 20:21 UTC (History)
5 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 Nate Graham 2023-06-13 16:44:24 UTC
When I open KRunner and click on its configure button, nothing visibly happens. `journalctl` shows what's going on:

Jun 13 10:17:59 Liberator systemd[1401]: Started app-kcmshell6-1d22d2baeeab454b99025696db7821c1.scope - kcmshell6.
Jun 13 10:17:59 Liberator kcmshell6[1038311]: Detected locale "C" with character encoding "UTF-8", which is not UTF-8.
                                              Qt depends on a UTF-8 locale, and has switched to "C.UTF-8" instead.
                                              If this causes problems, reconfigure your locale. See the locale(1) manual
                                              for more information.
Jun 13 10:17:59 Liberator kcmshell6[1038311]: qt.qpa.xcb: could not connect to display
Jun 13 10:17:59 Liberator audit[1038311]: ANOM_ABEND auid=1000 uid=1000 gid=1000 ses=3 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 pid=1038311 comm="kcmshell6" exe="/home/nate/kde/usr6/bin/kcmshell6" sig=6 res=1
Jun 13 10:17:59 Liberator kcmshell6[1038311]: qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
Jun 13 10:17:59 Liberator kcmshell6[1038311]: This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
                                              
                                              Available platform plugins are: linuxfb, wayland-egl, eglfs, wayland, vnc, offscreen, minimal, minimalegl, vkkhrdisplay, xcb.
Jun 13 10:17:59 Liberator audit: BPF prog-id=464 op=LOAD
Jun 13 10:17:59 Liberator audit: BPF prog-id=465 op=LOAD
Jun 13 10:17:59 Liberator audit: BPF prog-id=466 op=LOAD
Jun 13 10:17:59 Liberator audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=systemd-coredump@41-1038313-0 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Jun 13 10:17:59 Liberator systemd[1]: Started systemd-coredump@41-1038313-0.service - Process Core Dump (PID 1038313/UID 0).


The crash backtrace is not useful and just shows that it's dying in QGuiApplicationPrivate::createPlatformIntegration()

#7  0x00007ffb1cb5bc32 in init_platform (pluginNamesWithArguments=..., platformPluginPath=..., 
    platformThemeName=..., argc=@0x7ffec0c50f0c: 2, argv=argv@entry=0x7ffec0c51218)
    at /usr/src/debug/qt6-qtbase-6.5.1-1.fc38.x86_64/src/gui/kernel/qguiapplication.cpp:1257
#8  0x00007ffb1cbfede0 in QGuiApplicationPrivate::createPlatformIntegration (this=0xf260f0)
    at /usr/src/debug/qt6-qtbase-6.5.1-1.fc38.x86_64/src/gui/kernel/qguiapplication.cpp:1505



This issue was also seen today by Justin Zobel when trying to open the "Add new printer" dialog from the printers KCM.
Comment 1 Nate Graham 2023-06-13 16:45:05 UTC
CCing some people who were involved in the discussion about this earlier today.
Comment 2 Nicolas Fella 2023-06-13 18:16:46 UTC
*** Bug 470981 has been marked as a duplicate of this bug. ***
Comment 3 Nicolas Fella 2023-06-13 18:17:18 UTC
*** Bug 470932 has been marked as a duplicate of this bug. ***
Comment 4 Bug Janitor Service 2023-06-13 18:40:28 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kio/-/merge_requests/1313
Comment 5 Fabian Vogt 2023-06-13 20:21:26 UTC
Git commit 916984940f64e07db9b4d152be9f2a87dda0cfb4 by Fabian Vogt.
Committed on 13/06/2023 at 18:35.
Pushed by fvogt into branch 'master'.

KIO::CommandLauncherJob: Inherit environment variables by default

Before Qt 6.3, an empty (default constructed) QProcessEnvironment caused
QProcess to incorrectly inherit the environment variables from the parent
process. This was fixed in qtbase 5fc9c02a695.

Adjust for this behaviour change by explicitly inheriting the environment
from the parent, to restore useful default behaviour of CommandLauncherJob.

M  +1    -1    src/gui/commandlauncherjob.cpp

https://invent.kde.org/frameworks/kio/-/commit/916984940f64e07db9b4d152be9f2a87dda0cfb4