Bug 403965 - 'Kstart5 [something]' doesn't work on wayland
Summary: 'Kstart5 [something]' doesn't work on wayland
Status: RESOLVED FIXED
Alias: None
Product: kstart
Classification: Plasma
Component: general (show other bugs)
Version: 5.15.0
Platform: Arch Linux Linux
: NOR crash
Target Milestone: ---
Assignee: Unassigned bugs mailing-list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-02-05 17:05 UTC by Matej Mrenica
Modified: 2019-07-07 12:16 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Backtrace after rebuilding kwindowsystem with debug option (2.19 KB, text/plain)
2019-03-09 14:33 UTC, Matej Mrenica
Details
kstart5 fix wayland crash (700 bytes, patch)
2019-07-07 06:31 UTC, Igor Kovalenko
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matej Mrenica 2019-02-05 17:05:05 UTC
and/or causes kstart5 to crash like this:

kstart5 dolphin .    
Omitting both --window and --windowclass arguments is not recommended
KCrash: crashing... crashRecursionCounter = 2
KCrash: Application Name = kstart5 path = /usr/bin pid = 7475
KCrash: Arguments: /usr/bin/kstart5 dolphin . 
KCrash: Attempting to start /usr/lib/drkonqi from kdeinit
sock_file=/run/user/1000/kdeinit5__1

KDE Frameworks Version: 5.54
Qt Version: 5.12.1

ADDITIONAL INFORMATION
Only on wayland
Comment 1 Matej Mrenica 2019-02-14 19:22:17 UTC
More logs:

Application: KStart (kstart5), signal: Segmentation fault
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[Current thread is 1 (Thread 0x7f5412b8a800 (LWP 16675))]

Thread 2 (Thread 0x7f540f45e700 (LWP 16676)):
#0  0x00007f54168bdc21 in poll () from /usr/lib/libc.so.6
#1  0x00007f541541f540 in ?? () from /usr/lib/libglib-2.0.so.0
#2  0x00007f541541f62e in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#3  0x00007f5416df0d04 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#4  0x00007f5416d99b2c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#5  0x00007f5416bdd569 in QThread::exec() () from /usr/lib/libQt5Core.so.5
#6  0x00007f5416691ba6 in ?? () from /usr/lib/libQt5DBus.so.5
#7  0x00007f5416bde96c in ?? () from /usr/lib/libQt5Core.so.5
#8  0x00007f5415e74a9d in start_thread () from /usr/lib/libpthread.so.0
#9  0x00007f54168c8b23 in clone () from /usr/lib/libc.so.6

Thread 1 (Thread 0x7f5412b8a800 (LWP 16675)):
[KCrash Handler]
#6  0x00007f54166600ce in xcb_send_request_with_fds64 () from /usr/lib/libxcb.so.1
#7  0x00007f541666066a in xcb_send_request () from /usr/lib/libxcb.so.1
#8  0x00007f5416666da5 in xcb_intern_atom () from /usr/lib/libxcb.so.1
#9  0x00007f5417922102 in ?? () from /usr/lib/libKF5WindowSystem.so.5
#10 0x00007f5417926aa7 in ?? () from /usr/lib/libKF5WindowSystem.so.5
#11 0x00007f5417928a12 in NETRootInfo::NETRootInfo(xcb_connection_t*, QFlags<NET::Property>, QFlags<NET::Property2>, int, bool) () from /usr/lib/libKF5WindowSystem.so.5
#12 0x000055b2ae5b2802 in ?? ()
#13 0x000055b2ae5b1541 in ?? ()
#14 0x00007f54167f1223 in __libc_start_main () from /usr/lib/libc.so.6
#15 0x000055b2ae5b1ace in _start ()
[Inferior 1 (process 16675) detached]
Comment 2 Patrick Silva 2019-03-05 18:04:05 UTC
it crashes here too.

Operating System: Arch Linux 
KDE Plasma Version: 5.15.2
KDE Frameworks Version: 5.55.0
Qt Version: 5.12.1
Comment 3 Christoph Feck 2019-03-09 09:26:22 UTC
Please install debug symbols for libKF5WindowSystem and add an updated backtrace.
Comment 4 Matej Mrenica 2019-03-09 14:33:54 UTC
Created attachment 118666 [details]
Backtrace after rebuilding kwindowsystem with debug option

Is this any better?
Comment 5 Christoph Feck 2019-03-09 14:51:06 UTC
Checking the sources, kstart not only requires X11, but also seems to be just a wrapper to run applications with the X11 startup notification info for those applications that don't provide their own.

As such, I think this application cannot be ported to Wayland.

I don't know if applications can itself request to run with Qt's xcb windowing backend. If not, you can manually start it with

QT_QPA_PLATFORM=xcb kstart5 ...


Crash caused by connection=0x0

Thread 1 (Thread 0x7f6921d1c800 (LWP 17822)):
[KCrash Handler]
#6  0x00007f69257f20ce in xcb_send_request_with_fds64 () from /usr/lib/libxcb.so.1
#7  0x00007f69257f266a in xcb_send_request () from /usr/lib/libxcb.so.1
#8  0x00007f69257f8da5 in xcb_intern_atom () from /usr/lib/libxcb.so.1
#9  0x00007f6926ab4132 in Atoms::init (this=this@entry=0x562cb3567260) at /usr/src/debug/kwindowsystem-5.56.0/src/platforms/xcb/netwm.cpp:304
#10 0x00007f6926ab8af7 in Atoms::Atoms (c=<optimized out>, this=0x562cb3567260) at /usr/src/debug/kwindowsystem-5.56.0/src/platforms/xcb/netwm.cpp:82
#11 atomsForConnection (c=<optimized out>, c@entry=0x0) at /usr/src/debug/kwindowsystem-5.56.0/src/platforms/xcb/netwm.cpp:68
#12 0x00007f6926abaa62 in NETRootInfo::NETRootInfo (this=0x7fff974a9f40, connection=0x0, properties=..., properties2=..., screen=-1, doActivate=<optimized out>) at /usr/src/debug/kwindowsystem-5.56.0/src/platforms/xcb/netwm.cpp:517
Comment 6 Igor Kovalenko 2019-07-07 06:31:49 UTC
Created attachment 121360 [details]
kstart5 fix wayland crash

I confirm this issue exists with kde-cli-tools-5.16.2
Running on gentoo under plasma wayland 'kstart5 plasmashell' does crash with the same backtrace.

I did a change following porting guide, patch attached, please have a look.
Comment 7 Albert Astals Cid 2019-07-07 11:23:58 UTC
Git commit 88533ac66bf9fb89a823dbcf07a3b7b6dd0de2eb by Albert Astals Cid, on behalf of Igor Kovalenko.
Committed on 07/07/2019 at 11:22.
Pushed by aacid into branch 'Plasma/5.16'.

fix kstart5 crash on wayland

Make kstart query NETRootInfo only if it is running on QX11Info::isPlatformX11 following porting guidelines.

Verified by starting just crashed plasmashell via 'kstart5 plasmashell'

M  +9    -1    kstart/kstart.cpp

https://commits.kde.org/kde-cli-tools/88533ac66bf9fb89a823dbcf07a3b7b6dd0de2eb