Bug 390151 - Crash on exit [wl_proxy_destroy, wl_map_insert_at]
Summary: Crash on exit [wl_proxy_destroy, wl_map_insert_at]
Status: RESOLVED FIXED
Alias: None
Product: frameworks-kwayland
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 5.42.0
Platform: openSUSE Linux
: NOR crash
Target Milestone: ---
Assignee: Martin Flöser
URL:
Keywords: drkonqi, wayland
: 385628 389603 391263 391641 392873 392957 394371 394453 394484 395576 395767 395839 395845 396020 396239 397223 398795 399990 400017 402057 404287 404367 404403 405112 406719 407992 408578 408971 415396 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-02-09 13:30 UTC by 431741580derp
Modified: 2021-05-21 09:12 UTC (History)
25 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
New crash information added by DrKonqi (6.19 KB, text/plain)
2018-04-27 09:55 UTC, Markus Rathgeb
Details
backtrace from Kate with -g -ggdb -O0 (6.27 KB, text/plain)
2018-10-19 20:22 UTC, Alexey Min
Details
New crash information added by DrKonqi (5.34 KB, text/plain)
2019-03-01 21:02 UTC, Sascha Gaspar
Details
New crash information added by DrKonqi (4.75 KB, text/plain)
2019-03-28 12:56 UTC, David
Details

Note You need to log in before you can comment on or make changes to this bug.
Description 431741580derp 2018-02-09 13:30:42 UTC
Application: systemsettings5 (5.12.0)

Qt Version: 5.10.0
Frameworks Version: 5.42.0
Operating System: Linux 4.15.1-1-default x86_64
Distribution: "openSUSE Tumbleweed"

-- Information about the crash:
- What I was doing when the application crashed:

Opened:
System settings -> Shortcuts -> Custom shortcuts
Toggle an option (make it so that apply changes becomes active)

Alt-F4
(using the apply changes button doens't cause a crash)

A popup for apply/discard changes & cancel appears
Pick either apply or discard

Segfault
(Changes are applied or discarded as intended)

The crash can be reproduced every time.

-- Backtrace:
Application: System Settings (systemsettings5), signal: Segmentation fault
Using host libthread_db library "/lib64/libthread_db.so.1".
[Current thread is 1 (Thread 0x7f44ae7fc100 (LWP 7704))]

Thread 2 (Thread 0x7f44991f7700 (LWP 7706)):
#0  0x00007f44aa26bf8b in poll () at /lib64/libc.so.6
#1  0x00007f44a4056109 in  () at /usr/lib64/libglib-2.0.so.0
#2  0x00007f44a405621c in g_main_context_iteration () at /usr/lib64/libglib-2.0.so.0
#3  0x00007f44aaba278b in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib64/libQt5Core.so.5
#4  0x00007f44aab496ba in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib64/libQt5Core.so.5
#5  0x00007f44aa9708da in QThread::exec() () at /usr/lib64/libQt5Core.so.5
#6  0x00007f44ac48bbd5 in  () at /usr/lib64/libQt5DBus.so.5
#7  0x00007f44aa9758d0 in QThreadPrivate::start(void*) () at /usr/lib64/libQt5Core.so.5
#8  0x00007f44a6447558 in start_thread () at /lib64/libpthread.so.0
#9  0x00007f44aa27672f in clone () at /lib64/libc.so.6

Thread 1 (Thread 0x7f44ae7fc100 (LWP 7704)):
[KCrash Handler]
#6  0x00007f449db1bd39 in  () at /usr/lib64/libwayland-client.so.0
#7  0x00007f449db17e4e in wl_proxy_destroy () at /usr/lib64/libwayland-client.so.0
#8  0x00007f449c0ddfb7 in KWayland::Client::PlasmaWindow::release() () at /usr/lib64/libKF5WaylandClient.so.5
#9  0x00007f449c0ddfda in KWayland::Client::PlasmaWindow::~PlasmaWindow() () at /usr/lib64/libKF5WaylandClient.so.5
#10 0x00007f449c0de0d9 in KWayland::Client::PlasmaWindow::~PlasmaWindow() () at /usr/lib64/libKF5WaylandClient.so.5
#11 0x00007f44aab76d9b in QObjectPrivate::deleteChildren() () at /usr/lib64/libQt5Core.so.5
#12 0x00007f44aab800eb in QObject::~QObject() () at /usr/lib64/libQt5Core.so.5
#13 0x00007f449c0de6a9 in KWayland::Client::PlasmaWindowManagement::~PlasmaWindowManagement() () at /usr/lib64/libKF5WaylandClient.so.5
#14 0x00007f44aab76d9b in QObjectPrivate::deleteChildren() () at /usr/lib64/libQt5Core.so.5
#15 0x00007f44aab800eb in QObject::~QObject() () at /usr/lib64/libQt5Core.so.5
#16 0x00007f448838aa93 in  () at /usr/lib64/qt5/plugins/kf5/org.kde.kwindowsystem.platforms/KF5WindowSystemKWaylandPlugin.so
#17 0x00007f44aa1b6ce8 in __run_exit_handlers () at /lib64/libc.so.6
#18 0x00007f44aa1b6d3a in  () at /lib64/libc.so.6
#19 0x00007f44aa19ef51 in __libc_start_main () at /lib64/libc.so.6
#20 0x0000558fe65959aa in _start () at ../sysdeps/x86_64/start.S:120

Reported using DrKonqi
Comment 1 Martin Flöser 2018-02-10 06:39:19 UTC
Unfortunately the backtrace lacks debug symbols. Due to that there is nothing we can do to investigate. Please provide a backtrace with debug symbols.
Comment 2 Christoph Feck 2018-03-29 14:50:22 UTC
*** Bug 391263 has been marked as a duplicate of this bug. ***
Comment 3 Michail Vourlakos 2018-03-29 16:32:58 UTC
Using frameworks: 5.44.0

and by adding a pager plasmoid in Latte I get the following when exiting Latte under wayland:

Application: Latte Dock (latte-dock), signal: Segmentation fault
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[Current thread is 1 (Thread 0x7f28b6ea98c0 (LWP 5383))]

Thread 1 (Thread 0x7f28b6ea98c0 (LWP 5383)):
[KCrash Handler]
#4  0x00007f28ae6765b9 in wl_map_insert_at (map=<optimized out>, flags=<optimized out>, i=<optimized out>, data=<optimized out>) at ../src/wayland-util.c:249
#5  0x00007f28ae6727be in proxy_destroy (proxy=0x8567460) at ../src/wayland-client.c:411
#6  wl_proxy_destroy (proxy=proxy@entry=0x8567460) at ../src/wayland-client.c:442
#7  0x00007f28b5fedc17 in org_kde_plasma_window_destroy (org_kde_plasma_window=0x8567460) at /workspace/build/obj-x86_64-linux-gnu/src/client/wayland-plasma-window-management-client-protocol.h:634
#8  KWayland::Client::WaylandPointer<org_kde_plasma_window, org_kde_plasma_window_destroy>::release (this=0x6b25370, this=0x6b25370) at /workspace/build/src/client/wayland_pointer_p.h:53
#9  KWayland::Client::PlasmaWindow::release (this=this@entry=0x92a5130) at /workspace/build/src/client/plasmawindowmanagement.cpp:745
#10 0x00007f28b5fedc3a in KWayland::Client::PlasmaWindow::~PlasmaWindow (this=0x92a5130, __in_chrg=<optimized out>) at /workspace/build/src/client/plasmawindowmanagement.cpp:735
#11 0x00007f28b5fedd29 in KWayland::Client::PlasmaWindow::~PlasmaWindow (this=0x92a5130, __in_chrg=<optimized out>) at /workspace/build/src/client/plasmawindowmanagement.cpp:736
#12 0x00007f28b1689f73 in QObjectPrivate::deleteChildren() () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#13 0x00007f28b1693e94 in QObject::~QObject() () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#14 0x00007f28b5fee2c9 in KWayland::Client::PlasmaWindowManagement::~PlasmaWindowManagement (this=0x252dbb0, __in_chrg=<optimized out>) at /workspace/build/src/client/plasmawindowmanagement.cpp:252
#15 0x00007f28b1689f73 in QObjectPrivate::deleteChildren() () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#16 0x00007f28b1693e94 in QObject::~QObject() () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#17 0x00007f288d9576a3 in ?? () from /usr/lib/x86_64-linux-gnu/qt5/plugins/kf5/org.kde.kwindowsystem.platforms/KF5WindowSystemKWaylandPlugin.so
#18 0x00007f28b07a2ff8 in __run_exit_handlers (status=0, listp=0x7f28b0b2d5f8 <__exit_funcs>, run_list_atexit=run_list_atexit@entry=true) at exit.c:82
#19 0x00007f28b07a3045 in __GI_exit (status=<optimized out>) at exit.c:104
#20 0x00007f28b0789837 in __libc_start_main (main=0x440a40 <main>, argc=2, argv=0x7ffe7188bb08, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffe7188baf8) at ../csu/libc-start.c:325
#21 0x0000000000442979 in _start ()
Comment 4 Christoph Feck 2018-04-26 23:16:55 UTC
Thanks for the update; backtrace looks useful.

Looks like there is a global QObject in KF5WindowSystemKWaylandPlugin.so that is destroyed _after_ the application is already shut down.

For related crashes in wl_proxy_destroy see bug 372597 and https://bugs.kde.org/buglist.cgi?bug_severity=crash&bug_severity=normal&bug_status=UNCONFIRMED&bug_status=CONFIRMED&bug_status=ASSIGNED&bug_status=REOPENED&bug_status=NEEDSINFO&longdesc=wl_proxy_destroy&longdesc_type=allwordssubstr&chfieldfrom=730d
Comment 5 Christoph Feck 2018-04-26 23:32:03 UTC
Michail, if you can still reproduce, please also install debug symbols for kwayland-integration, see missing symbol in line #17 of comment #3.

It should reveal the information which objects are not deleted inside the QCoreApplication::aboutToQuit() lamda.
Comment 6 Christoph Feck 2018-04-26 23:36:55 UTC
*** Bug 389603 has been marked as a duplicate of this bug. ***
Comment 7 Christoph Feck 2018-04-26 23:39:36 UTC
*** Bug 392957 has been marked as a duplicate of this bug. ***
Comment 8 Christoph Feck 2018-04-26 23:41:29 UTC
*** Bug 391641 has been marked as a duplicate of this bug. ***
Comment 9 Christoph Feck 2018-04-26 23:42:08 UTC
*** Bug 392873 has been marked as a duplicate of this bug. ***
Comment 10 Markus Rathgeb 2018-04-27 09:55:04 UTC
Created attachment 112283 [details]
New crash information added by DrKonqi

systemsettings5 (5.12.4) using Qt 5.9.5

- What I was doing when the application crashed:

Close "System Settings" while "Shortcuts" section has been selected.

-- Backtrace (Reduced):
#4  0x00007f6fa45ba8dc in wl_map_insert_at (map=<optimized out>, flags=<optimized out>, i=<optimized out>, data=<optimized out>) at /usr/src/debug/dev-libs/wayland-1.14.0/wayland-1.14.0/src/wayland-util.c:249
#5  0x00007f6fa45b6b7e in proxy_destroy (proxy=0x562a7d7c47a0) at /usr/src/debug/dev-libs/wayland-1.14.0/wayland-1.14.0/src/wayland-client.c:411
#6  wl_proxy_destroy (proxy=0x562a7d7c47a0) at /usr/src/debug/dev-libs/wayland-1.14.0/wayland-1.14.0/src/wayland-client.c:442
#7  0x00007f6fa2a824b7 in org_kde_plasma_window_destroy (org_kde_plasma_window=0x562a7d7c47a0) at /usr/src/debug/kde-frameworks/kwayland-5.45.0/kwayland-5.45.0_build/src/client/wayland-plasma-window-management-client-protocol.h:634
#8  KWayland::Client::WaylandPointer<org_kde_plasma_window, org_kde_plasma_window_destroy>::release (this=0x562a7d35d680, this=0x562a7d35d680) at /usr/src/debug/kde-frameworks/kwayland-5.45.0/kwayland-5.45.0/src/client/wayland_pointer_p.h:53
Comment 11 Markus Rathgeb 2018-04-27 09:59:16 UTC
(In reply to Christoph Feck from comment #5)
> Michail, if you can still reproduce, please also install debug symbols for
> kwayland-integration, see missing symbol in line #17 of comment #3.
> 
> It should reveal the information which objects are not deleted inside the
> QCoreApplication::aboutToQuit() lamda.

I tried to add the relevant debug symbols. If there is still something missing, please comment and I will add further debug symbols and reproduce.
Comment 12 Christoph Feck 2018-04-27 11:53:03 UTC
line 54 in waylandintegration.cpp is the ~WaylandIntegration() destructor. This confirms objects were added to the WaylandIntegration object that are not deleted via the aboutToQuit lambda.

Martin, I suggest to either add "foreach(children) delete" inside the lambda, or add debug statements in the destructor to find out which objects are still there after QApplication destruction that are harmful to delete from the destructor.
Comment 13 Christoph Feck 2018-04-27 11:57:27 UTC
Another observation: The backtraces say that KWayland::Client::PlasmaWindowManagement::~PlasmaWindowManagement is one of the objects that is in the children list. Does "m_wm->release();" actually remove the PlasmaWindowManagement from the parent object?
Comment 14 Christoph Feck 2018-06-06 22:24:13 UTC
*** Bug 394453 has been marked as a duplicate of this bug. ***
Comment 15 Christoph Feck 2018-06-15 22:22:08 UTC
*** Bug 394484 has been marked as a duplicate of this bug. ***
Comment 16 Christoph Feck 2018-06-25 11:21:11 UTC
*** Bug 395839 has been marked as a duplicate of this bug. ***
Comment 17 Christoph Feck 2018-06-27 23:01:29 UTC
*** Bug 395576 has been marked as a duplicate of this bug. ***
Comment 18 Christoph Feck 2018-06-27 23:02:08 UTC
*** Bug 394371 has been marked as a duplicate of this bug. ***
Comment 19 Christoph Feck 2018-06-27 23:02:41 UTC
*** Bug 395767 has been marked as a duplicate of this bug. ***
Comment 20 Christoph Feck 2018-06-27 23:03:12 UTC
*** Bug 395845 has been marked as a duplicate of this bug. ***
Comment 21 Christoph Feck 2018-07-20 02:22:08 UTC
*** Bug 396020 has been marked as a duplicate of this bug. ***
Comment 22 Christoph Feck 2018-07-20 02:23:59 UTC
*** Bug 396239 has been marked as a duplicate of this bug. ***
Comment 23 Christoph Feck 2018-10-01 14:47:23 UTC
*** Bug 398795 has been marked as a duplicate of this bug. ***
Comment 24 Christoph Feck 2018-10-01 14:50:33 UTC
*** Bug 397223 has been marked as a duplicate of this bug. ***
Comment 25 Christoph Feck 2018-10-19 03:46:48 UTC
*** Bug 399990 has been marked as a duplicate of this bug. ***
Comment 26 Christoph Feck 2018-10-19 03:47:09 UTC
*** Bug 400017 has been marked as a duplicate of this bug. ***
Comment 27 Alexey Min 2018-10-19 20:07:02 UTC
Still in KF 5.50. Unfortunately packages involved were compiled in -O2 mode... Going to recompile now for future use.

Thread 1 (Thread 0x7f1a7d7cf3c0 (LWP 2822)):
[KCrash Handler]
#6  0x00007f1a6b60cf19 in wl_map_insert_at (map=<optimized out>, flags=<optimized out>, i=<optimized out>, data=<optimized out>) at /var/tmp/portage/dev-libs/wayland-1.16.0/work/wayland-1.16.0/src/wayland-util.c:247
#7  0x00007f1a6b608dd0 in proxy_destroy (proxy=0x560b8e3c1f90) at /var/tmp/portage/dev-libs/wayland-1.16.0/work/wayland-1.16.0/src/wayland-client.c:499
#8  wl_proxy_destroy (proxy=proxy@entry=0x560b8e3c1f90) at /var/tmp/portage/dev-libs/wayland-1.16.0/work/wayland-1.16.0/src/wayland-client.c:530
#9  0x00007f1a69dbf887 in org_kde_plasma_window_destroy (org_kde_plasma_window=0x560b8e3c1f90) at /var/tmp/portage/kde-frameworks/kwayland-5.50.0/work/kwayland-5.50.0_build/src/client/wayland-plasma-window-management-client-protocol.h:642
#10 KWayland::Client::WaylandPointer<org_kde_plasma_window, org_kde_plasma_window_destroy>::release (this=0x560b8e3c1310, this=0x560b8e3c1310) at /var/tmp/portage/kde-frameworks/kwayland-5.50.0/work/kwayland-5.50.0/src/client/wayland_pointer_p.h:53
#11 KWayland::Client::PlasmaWindow::release (this=this@entry=0x560b8e916940) at /var/tmp/portage/kde-frameworks/kwayland-5.50.0/work/kwayland-5.50.0/src/client/plasmawindowmanagement.cpp:757
#12 0x00007f1a69dbf8aa in KWayland::Client::PlasmaWindow::~PlasmaWindow (this=0x560b8e916940, __in_chrg=<optimized out>) at /var/tmp/portage/kde-frameworks/kwayland-5.50.0/work/kwayland-5.50.0/src/client/plasmawindowmanagement.cpp:747
#13 0x00007f1a69dbf999 in KWayland::Client::PlasmaWindow::~PlasmaWindow (this=0x560b8e916940, __in_chrg=<optimized out>) at /var/tmp/portage/kde-frameworks/kwayland-5.50.0/work/kwayland-5.50.0/src/client/plasmawindowmanagement.cpp:748
#14 0x00007f1a78a4dc4b in QObjectPrivate::deleteChildren (this=0x560b8e9f1df0) at kernel/qobject.cpp:1997
#15 0x00007f1a78a4c1f2 in QObject::~QObject (this=0x560b8ea145a0, __in_chrg=<optimized out>) at kernel/qobject.cpp:1025
#16 0x00007f1a69dbff49 in KWayland::Client::PlasmaWindowManagement::~PlasmaWindowManagement (this=0x560b8ea145a0, __in_chrg=<optimized out>) at /var/tmp/portage/kde-frameworks/kwayland-5.50.0/work/kwayland-5.50.0/src/client/plasmawindowmanagement.cpp:254
#17 0x00007f1a78a4dc4b in QObjectPrivate::deleteChildren (this=0x560b8e811170) at kernel/qobject.cpp:1997
#18 0x00007f1a78a4c1f2 in QObject::~QObject (this=0x7f1a5d5943e0 <(anonymous namespace)::Q_QGS_privateWaylandIntegrationSelf::innerFunction()::holder>, __in_chrg=<optimized out>) at kernel/qobject.cpp:1025
#19 0x00007f1a5d38b753 in WaylandIntegration::~WaylandIntegration (this=<optimized out>, __in_chrg=<optimized out>) at /var/tmp/portage/kde-plasma/kwayland-integration-5.14.1/work/kwayland-integration-5.14.1/src/windowsystem/waylandintegration.cpp:54
#20 WaylandIntegrationSingleton::~WaylandIntegrationSingleton (this=<optimized out>, __in_chrg=<optimized out>) at /var/tmp/portage/kde-plasma/kwayland-integration-5.14.1/work/kwayland-integration-5.14.1/src/windowsystem/waylandintegration.cpp:40
#21 (anonymous namespace)::Q_QGS_privateWaylandIntegrationSelf::Holder::~Holder (this=<optimized out>, __in_chrg=<optimized out>) at /var/tmp/portage/kde-plasma/kwayland-integration-5.14.1/work/kwayland-integration-5.14.1/src/windowsystem/waylandintegration.cpp:46
#22 0x00007f1a77c36330 in __run_exit_handlers (status=0, listp=0x7f1a77fb96f8 <__exit_funcs>, run_list_atexit=run_list_atexit@entry=true, run_dtors=run_dtors@entry=true) at exit.c:83
#23 0x00007f1a77c3639a in __GI_exit (status=<optimized out>) at exit.c:105
#24 0x00007f1a77c1e018 in __libc_start_main (main=0x560b8d187840 <main(int, char**)>, argc=3, argv=0x7ffc0fa001c8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffc0fa001b8) at ../csu/libc-start.c:342
#25 0x0000560b8d18b01a in _start ()
Comment 28 Alexey Min 2018-10-19 20:22:42 UTC
Created attachment 115751 [details]
backtrace from Kate with -g -ggdb -O0
Comment 29 Alexey Min 2018-10-19 20:23:45 UTC
Able to almost reliably reproduce, open Kate double-clicking some text doc in dolphin, add several more documents by double clicking in dolphin, close all tabs except one, close Kate clicking close button on the window, boom.
Comment 30 Christoph Feck 2018-12-21 22:38:14 UTC
*** Bug 385628 has been marked as a duplicate of this bug. ***
Comment 31 Christoph Feck 2018-12-21 22:38:58 UTC
*** Bug 402057 has been marked as a duplicate of this bug. ***
Comment 32 David Edmundson 2018-12-22 17:44:29 UTC
Can't reproduce, which doesn't help.

If someone can reliably reproduce and has some GDB experience can I find out two things:

1) Can I have a backtrace of when WaylandIntegration::plasmaWindowManagement
happens. I can't think why Kate would create this, mine doesn't which is key to why I don't get this crash.
Must be some setting/plugin.

(break WaylandIntegration::plasmaWindowManagement)

2)  do we get inside the lambda 
   connect(qApp, &QCoreApplication::aboutToQuit, this, [=]() {

which is declared in WaylandIntegration::setupKWaylandIntegration?

(break waylandintegration.cpp:87)

From the backtrace it would appear we do not.
Comment 33 David Edmundson 2018-12-22 17:48:17 UTC
I have one guess what it could be. 

In addition to the information above, please could someone test if https://phabricator.kde.org/P284 fixes it.
Comment 34 John Scott 2018-12-22 18:23:33 UTC
(In reply to David Edmundson from comment #32)
> Can't reproduce, which doesn't help.
> 
> If someone can reliably reproduce and has some GDB experience can I find out
> two things:
> 
> 1) Can I have a backtrace of when WaylandIntegration::plasmaWindowManagement
> happens. I can't think why Kate would create this, mine doesn't which is key
> to why I don't get this crash.
> Must be some setting/plugin.
> 
> (break WaylandIntegration::plasmaWindowManagement)

I'm not a gdb pro, but I am able to reproduce. Here's my gdb session.

(gdb) break WaylandIntegration::plasmaWindowManagement
Function "WaylandIntegration::plasmaWindowManagement" not defined.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 (WaylandIntegration::plasmaWindowManagement) pending.
(gdb) run
Starting program: /usr/bin/kate /home/john/explicit.gp
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffed435700 (LWP 4949)]
Using Wayland-EGL
[New Thread 0x7fffe4f53700 (LWP 4950)]
Using the 'xdg-shell-v6' shell integration
qt.qpa.wayland: Wayland does not support QWindow::requestActivate()
qt.qpa.wayland: Wayland does not support QWindow::requestActivate()

Thread 1 "kate" hit Breakpoint 1, WaylandIntegration::plasmaWindowManagement (
    this=0x7fffec0413c0 <(anonymous namespace)::Q_QGS_privateWaylandIntegrationSelf::innerFunction()::holder>) at ./src/windowsystem/waylandintegration.cpp:183
183     ./src/windowsystem/waylandintegration.cpp: No such file or directory.
(gdb) bt
#0  WaylandIntegration::plasmaWindowManagement (this=0x7fffec0413c0 <(anonymous namespace)::Q_QGS_privateWaylandIntegrationSelf::innerFunction()::holder>)
    at ./src/windowsystem/waylandintegration.cpp:183
#1  0x00007fffec03acac in WindowSystem::window (this=<optimized out>, wid=wid@entry=1) at ./src/windowsystem/windowsystem.cpp:46
#2  0x00007fffec03ae99 in WindowSystem::forceActiveWindow (this=<optimized out>, win=1, time=<optimized out>) at ./src/windowsystem/windowsystem.cpp:69
#3  0x00005555555d37ac in KateAppAdaptor::activate (this=<optimized out>) at ./kate/kateappadaptor.cpp:45
#4  0x00005555555cca8d in KateAppAdaptor::qt_static_metacall (_o=_o@entry=0x7fffffffdfb8, _id=_id@entry=11, _a=_a@entry=0x7fffffffd550, _c=QMetaObject::InvokeMetaMethod)
    at ./obj-x86_64-linux-gnu/kate/kdeinit_kate_autogen/EWIEGA46WW/moc_kateappadaptor.cpp:149
#5  0x00005555555d15f1 in KateAppAdaptor::qt_static_metacall (_a=0x7fffffffd550, _id=11, _c=QMetaObject::InvokeMetaMethod, _o=0x7fffffffdfb8)
    at ./obj-x86_64-linux-gnu/kate/kdeinit_kate_autogen/EWIEGA46WW/moc_kateappadaptor.cpp:210
#6  KateAppAdaptor::qt_metacall (this=0x7fffffffdfb8, _c=QMetaObject::InvokeMetaMethod, _id=11, _a=0x7fffffffd550)
    at ./obj-x86_64-linux-gnu/kate/kdeinit_kate_autogen/EWIEGA46WW/moc_kateappadaptor.cpp:210
#7  0x00007ffff65c3e8a in QDBusConnectionPrivate::deliverCall (this=<optimized out>, object=<optimized out>, msg=..., metaTypes=..., slotIdx=<optimized out>)
    at qdbusintegrator.cpp:991
#8  0x00007ffff65c84a5 in QDBusConnectionPrivate::activateCall (this=this@entry=0x7fffe8003f10, object=0x7fffffffdfb8, flags=flags@entry=273, msg=...) at qdbusintegrator.cpp:894
#9  0x00007ffff65c8cf6 in QDBusConnectionPrivate::activateCall (msg=..., flags=273, object=<optimized out>, this=0x7fffe8003f10) at qdbusintegrator.cpp:843
#10 QDBusConnectionPrivate::activateObject (pathStartPos=<optimized out>, msg=..., node=..., this=0x7fffe8003f10) at qdbusintegrator.cpp:1477
#11 QDBusConnectionPrivate::activateObject (this=0x7fffe8003f10, node=..., msg=..., pathStartPos=<optimized out>) at qdbusintegrator.cpp:1427
#12 0x00007ffff65cb36e in QDBusActivateObjectEvent::placeMetaCall (this=0x7fffe800d6c0) at qdbusintegrator.cpp:1597
#13 0x00007ffff633cb42 in QObject::event (this=0x7fffffffdf30, e=<optimized out>) at kernel/qobject.cpp:1251
#14 0x00007ffff6df3491 in QApplicationPrivate::notify_helper (this=this@entry=0x555555629ac0, receiver=receiver@entry=0x7fffffffdf30, e=e@entry=0x7fffe800d6c0)
    at kernel/qapplication.cpp:3727
#15 0x00007ffff6dfaad0 in QApplication::notify (this=0x7fffffffdef0, receiver=0x7fffffffdf30, e=0x7fffe800d6c0) at kernel/qapplication.cpp:3486
#16 0x00007ffff6313039 in QCoreApplication::notifyInternal2 (receiver=0x7fffffffdf30, event=0x7fffe800d6c0)
    at ../../include/QtCore/5.11.2/QtCore/private/../../../../../src/corelib/thread/qthread_p.h:307
#17 0x00007ffff631602b in QCoreApplication::sendEvent (event=0x7fffe800d6c0, receiver=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:234
#18 QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x555555628f90) at kernel/qcoreapplication.cpp:1745
#19 0x00007ffff63656e3 in postEventSourceDispatch (s=0x5555556bf3d0) at kernel/qeventdispatcher_glib.cpp:276
#20 0x00007ffff3a92c3e in g_main_dispatch (context=0x55555569c2b0) at ../../../../glib/gmain.c:3182
#21 g_main_context_dispatch (context=context@entry=0x55555569c2b0) at ../../../../glib/gmain.c:3847
#22 0x00007ffff3a92ed8 in g_main_context_iterate (context=context@entry=0x55555569c2b0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>)
    at ../../../../glib/gmain.c:3920
#23 0x00007ffff3a92f6c in g_main_context_iteration (context=0x55555569c2b0, may_block=may_block@entry=1) at ../../../../glib/gmain.c:3981
#24 0x00007ffff6364d13 in QEventDispatcherGlib::processEvents (this=0x555555633b10, flags=...) at kernel/qeventdispatcher_glib.cpp:422
#25 0x00007ffff07906c1 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5WaylandClient.so.5
#26 0x00007ffff6311d0b in QEventLoop::exec (this=this@entry=0x7fffffffdcf0, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:140
#27 0x00007ffff6319e82 in QCoreApplication::exec () at ../../include/QtCore/../../src/corelib/global/qflags.h:120
#28 0x0000555555581a25 in main (argc=<optimized out>, argv=<optimized out>) at ./kate/main.cpp:595

> 2)  do we get inside the lambda 
>    connect(qApp, &QCoreApplication::aboutToQuit, this, [=]() {
> 
> which is declared in WaylandIntegration::setupKWaylandIntegration?
> 
> (break waylandintegration.cpp:87)
> 
> From the backtrace it would appear we do not.
(gdb) break waylandintegration.cpp:87
No source file named waylandintegration.cpp.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 (waylandintegration.cpp:87) pending.
(gdb) run
Starting program: /usr/bin/kate /home/john/explicit.gp
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffed435700 (LWP 5106)]
Using Wayland-EGL
[New Thread 0x7fffe4f53700 (LWP 5116)]
Using the 'xdg-shell-v6' shell integration
qt.qpa.wayland: Wayland does not support QWindow::requestActivate()
qt.qpa.wayland: Wayland does not support QWindow::requestActivate()
[New Thread 0x7fffdf4ec700 (LWP 5153)]

Thread 1 "kate" hit Breakpoint 1, WaylandIntegration::<lambda()>::operator() (__closure=0x555555a226e0) at ./src/windowsystem/waylandintegration.cpp:87
87      ./src/windowsystem/waylandintegration.cpp: No such file or directory.
(gdb) bt
#0  WaylandIntegration::<lambda()>::operator() (__closure=0x555555a226e0) at ./src/windowsystem/waylandintegration.cpp:87
#1  QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, WaylandIntegration::setupKWaylandIntegration()::<lambda()> >::call (arg=<optimized out>, f=...)
    at /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:128
#2  QtPrivate::Functor<WaylandIntegration::setupKWaylandIntegration()::<lambda()>, 0>::call<QtPrivate::List<>, void> (arg=<optimized out>, f=...)
    at /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:238
#3  QtPrivate::QFunctorSlotObject<WaylandIntegration::setupKWaylandIntegration()::<lambda()>, 0, QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase *, QObject *, void **, bool *) (which=<optimized out>, this_=0x555555a226d0, r=<optimized out>, a=<optimized out>, ret=<optimized out>)
    at /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:421
#4  0x00007ffff633c3e0 in QtPrivate::QSlotObjectBase::call (a=0x7fffffffdcb0, 
    r=0x7fffec0413c0 <(anonymous namespace)::Q_QGS_privateWaylandIntegrationSelf::innerFunction()::holder>, this=0x555555a226d0)
    at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:376
#5  QMetaObject::activate (sender=0x7fffffffdef0, signalOffset=<optimized out>, local_signal_index=<optimized out>, argv=<optimized out>) at kernel/qobject.cpp:3754
#6  0x00007ffff6312217 in QCoreApplication::aboutToQuit (this=<optimized out>, _t1=...) at .moc/moc_qcoreapplication.cpp:249
#7  0x00007ffff63164b9 in QCoreApplicationPrivate::execCleanup (this=0x555555629ac0) at kernel/qcoreapplication_p.h:76
#8  0x00007ffff6319e9b in QCoreApplication::exec () at global/qglobal.h:1038
#9  0x0000555555581a25 in main (argc=<optimized out>, argv=<optimized out>) at ./kate/main.cpp:595
Comment 35 Christoph Feck 2019-02-15 16:27:15 UTC
*** Bug 404367 has been marked as a duplicate of this bug. ***
Comment 36 Christoph Feck 2019-02-15 16:27:52 UTC
*** Bug 404287 has been marked as a duplicate of this bug. ***
Comment 37 Christoph Feck 2019-02-15 18:05:52 UTC
*** Bug 404403 has been marked as a duplicate of this bug. ***
Comment 38 Sascha Gaspar 2019-03-01 21:02:16 UTC
Created attachment 118469 [details]
New crash information added by DrKonqi

systemsettings5 (5.15.0) using Qt 5.12.0

- What I was doing when the application crashed:
  I used the Color schema settings. The cash occured when I clicked apply. I had the dialog open for some minutes and changed between applications. I can not reproduce the crash.

- Custom settings of the application:
  I use "Breeze Dark" in Wayland and changed many UI settings.

The line 46 in /usr/src/debug/kwayland-integration-5.15.0-1.1.x86_64/src/windowsystem/waylandintegration.cpp is:
Q_GLOBAL_STATIC(WaylandIntegrationSingleton, privateWaylandIntegrationSelf)

-- Backtrace (Reduced):
#6  0x00007f85b9294ec9 in wl_map_insert_at (map=<optimized out>, flags=flags@entry=1, i=<optimized out>, data=data@entry=0x0) at src/wayland-util.c:247
#7  0x00007f85b9290cf1 in proxy_destroy (proxy=0x55a79f18e3e0) at src/wayland-client.c:499
#8  wl_proxy_destroy (proxy=proxy@entry=0x55a79f18e3e0) at src/wayland-client.c:530
#9  0x00007f85b2e37607 in org_kde_plasma_window_destroy (org_kde_plasma_window=0x55a79f18e3e0) at /usr/src/debug/kwayland-5.55.0-1.1.x86_64/build/src/client/wayland-plasma-window-management-client-protocol.h:694
#10 KWayland::Client::WaylandPointer<org_kde_plasma_window, org_kde_plasma_window_destroy>::release (this=0x7f85ac009e30, this=0x7f85ac009e30) at /usr/src/debug/kwayland-5.55.0-1.1.x86_64/src/client/wayland_pointer_p.h:53
Comment 39 Christoph Feck 2019-03-05 19:07:15 UTC
*** Bug 405112 has been marked as a duplicate of this bug. ***
Comment 40 David 2019-03-28 12:56:29 UTC
Created attachment 119099 [details]
New crash information added by DrKonqi

systemsettings5 (5.15.3) using Qt 5.12.2

- What I was doing when the application crashed:

Removed a global shortcut in settings. Then exited the window via the x button

-- Backtrace (Reduced):
#6  0x00007f3dce7def19 in wl_map_insert_at (map=<optimized out>, flags=flags@entry=1, i=<optimized out>, data=data@entry=0x0) at src/wayland-util.c:247
#7  0x00007f3dce7dacf1 in proxy_destroy (proxy=0x55878f7f8940) at src/wayland-client.c:502
#8  wl_proxy_destroy (proxy=proxy@entry=0x55878f7f8940) at src/wayland-client.c:533
#9  0x00007f3dc83a0677 in org_kde_plasma_window_destroy (org_kde_plasma_window=0x55878f7f8940) at /usr/src/debug/kwayland-5.56.0-1.1.x86_64/build/src/client/wayland-plasma-window-management-client-protocol.h:694
#10 KWayland::Client::WaylandPointer<org_kde_plasma_window, org_kde_plasma_window_destroy>::release (this=0x55878f386900, this=0x55878f386900) at /usr/src/debug/kwayland-5.56.0-1.1.x86_64/src/client/wayland_pointer_p.h:53
Comment 41 Christoph Feck 2019-05-14 20:11:36 UTC
*** Bug 406719 has been marked as a duplicate of this bug. ***
Comment 42 Christoph Feck 2019-06-14 12:01:46 UTC
*** Bug 407992 has been marked as a duplicate of this bug. ***
Comment 43 Christoph Feck 2019-06-20 11:10:25 UTC
*** Bug 408578 has been marked as a duplicate of this bug. ***
Comment 44 Christoph Feck 2019-07-16 10:58:09 UTC
*** Bug 408971 has been marked as a duplicate of this bug. ***
Comment 45 Christoph Feck 2020-01-13 11:52:02 UTC
*** Bug 415396 has been marked as a duplicate of this bug. ***
Comment 46 David Edmundson 2021-05-21 09:12:26 UTC
No dupes for a year and we've redone this bit of code, closing