https://bugs.kde.org/show_bug.cgi?id=408553

Matt Fagnani <matthew.fagn...@utoronto.ca> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|UPSTREAM                    |FIXED
      Latest Commit|                            |https://phabricator.kde.org
                   |                            |/D27538
   Version Fixed In|                            |5.68

--- Comment #7 from Matt Fagnani <matthew.fagn...@utoronto.ca> ---
(In reply to Nate Graham from comment #6)
> #6  QMessageLogger::fatal (this=this@entry=0x7fffd70c5ba0,
> msg=msg@entry=0x7ff994ac00b8 "The Wayland connection broke. Did the Wayland
> compositor die?") at global/qlogging.cpp:893
> 
> This means that the compositor crashed. Due to a Qt issue, when this
> happens, the app using it will crash too. KDE developers submitted a fix,
> but sadly it was not merged. See
> https://codereview.qt-project.org/c/qt/qtwayland/+/308984.
> 
> Until we get better handling of this in Qt, the best we can do is debug why
> the compositor crashed in the first place. So can you please get a backtrace
> of the crash in kwin_wayland and then file a new bug report with it on kwin
> | wayland-generic? Thanks!
> 
> You may be able to use the `coredumpctl` utility to retrieve the backtrace.
> See
> https://community.kde.org/Guidelines_and_HOWTOs/Debugging/
> How_to_create_useful_crash_reports#Retrieving_a_backtrace_using_coredumpctl

Nate, I think that kwin_wayland stopped normally during logout before
powerdevil segmentation faulted and then powerdevil tried to restart and
drkonqi aborted, which led to the errors like The Wayland connection broke. Did
the Wayland compositor die? I didn't mention any kwin_wayland crashes in my
report. The first powerdevil segmentation faults were due to the use-after-free
errors in wl_proxy_unref (wayland-client.c:229) in libwayland-client. I think
those errors were fixed by Daniel Vrátil in kwayland 5.68 whose message
mentioned invalid read/write use-after-free errors in wl_proxy_unref
(wayland-client.c:230) also involving
KWayland::Client::Registry::Private::globalSync in the commit
https://phabricator.kde.org/R127:4ceb35672dfa3378776a926c452b9f83ffe2bc41

Registry: don't destroy the callback on globalsync

Summary:
Instead just unref it, because the wl_display_dispatch_queue_pending
will try to destroy the callback afterwards as well, leading to
invalid read/write.

Fixes Valgrind warnings when running KScreen tests:

==460922== Invalid read of size 4
==460922==    at 0x5CE5B34: wl_proxy_unref (wayland-client.c:230)
==460922==    by 0x5CE5C33: destroy_queued_closure (wayland-client.c:292)
==460922==    by 0x5CE74AB: dispatch_queue (wayland-client.c:1591)
==460922==    by 0x5CE74AB: wl_display_dispatch_queue_pending
(wayland-client.c:1833)
==460922==    by 0x4E0240D: KWayland::Client::EventQueue::dispatch()
(src/frameworks/kwayland/src/client/event_queue.cpp:96)
g==460922==  Address 0x17233aac is 44 bytes inside a block of size 80 free'd
==460922==    at 0x483B9F5: free (vg_replace_malloc.c:540)
==460922==    by 0x4E15B60: destroy
(src/frameworks/kwayland/src/client/wayland_pointer_p.h:63)
==460922==    by 0x4E15B60:
KWayland::Client::Registry::Private::globalSync(void*, wl_callback*, unsigned
int) (src/frameworks/kwayland/src/client/registry.cpp:548)
...
==460922==    by 0x5CE74AB: dispatch_queue (wayland-client.c:1591)
==460922==    by 0x5CE74AB: wl_display_dispatch_queue_pending
(wayland-client.c:1833)
==460922==    by 0x4E0240D: KWayland::Client::EventQueue::dispatch()
(src/frameworks/kwayland/src/client/event_queue.cpp:96)

I haven't seen these powerdevil crashes or those involving similar invalid
read/write errors in plasmashell, konsole, etc I mentioned in comment 5 since
KF 5.68.0.

The qtwayland fix you mentioned could resolve the aborts of KDE programs after
kwin_wayland stopped when logging out. Alternatively, kwin_wayland could be
made to wait until the other KDE programs have stopped before it is stopped
maybe using the systemd integration. Thanks.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to