Bug 391271 - When loging out wayland session, do the windows get a proper close signal?
Summary: When loging out wayland session, do the windows get a proper close signal?
Status: RESOLVED UPSTREAM
Alias: None
Product: plasmashell
Classification: Plasma
Component: generic-wayland (show other bugs)
Version: 5.12.2
Platform: Other Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-03-01 23:15 UTC by Michail Vourlakos
Modified: 2021-01-13 22:54 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michail Vourlakos 2018-03-01 23:15:46 UTC
I am updating Latte implementation for wayland and I dont get a clean exit when plasma is exiting the wayland session. I have added debug messages on exiting on the destructor of the main class but these messages arent shown at all. Instead it is shown the following message:

"The Wayland connection broke. Did the Wayland compositor die?"

So is there a chance that the kwin wayland compositor is closing before all the windows exit?

One more thing I noticed is that during logging out all Qt windows dont close but instead the Firefox one does, which is using XWayland I suppose.
Comment 1 Martin Flöser 2018-03-02 05:19:47 UTC
It's totally possible that the termination process is wrong.
Comment 2 Michail Vourlakos 2018-03-02 08:53:24 UTC
> It's totally possible that the termination process is wrong.

Martin is this the right place to report this or another part of plasma is responsible?
Comment 3 Martin Flöser 2018-03-02 15:04:29 UTC
(In reply to Michail Vourlakos from comment #2)
> > It's totally possible that the termination process is wrong.
> 
> Martin is this the right place to report this or another part of plasma is
> responsible?

I don't know yet;-)
Comment 4 Michail Vourlakos 2018-03-02 16:12:23 UTC
> I don't know yet;-)

thank you for considering this as valid :)
Comment 5 Martin Flöser 2018-03-04 08:54:47 UTC
Reassigning.

startplasmacompositor runs kwin_wayland with the --exit-with-session flag. This means kwin start to terminate once everything else has exited. If something survives the compositor it means it was not terminated properly before.
Comment 6 David Edmundson 2019-01-03 23:16:25 UTC
Normally ksmserver terminates everything - but naturally that only happens on X.

Will need a cross toolkit solution and changes in Qt.

Roman was quite interested in this work at some point.
Comment 7 Nate Graham 2021-01-13 18:44:55 UTC
#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
Comment 8 magiblot 2021-01-13 22:54:55 UTC
(In reply to Nate Graham from comment #7)
> #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.

Allow me to disagree. The Wayland connection may break without the compositor crashing. For example:

* If the compositor exits and the clients keep reading on the wayland socket.
* If the compositor or the clients block or cannot process wayland events fast enough and the socket overflows (bug 392376, https://gitlab.freedesktop.org/wayland/wayland/-/issues/159).

> You may be able to use the `coredumpctl` utility to retrieve the backtrace.

Have you tried this yourself? Here is what I get:

> Wed 2021-01-13 23:12:42 CET     954  1000   983   6 present   /usr/lib/drkonqi
> Wed 2021-01-13 23:12:42 CET     952  1000   983   6 present   /usr/lib/drkonqi
> Wed 2021-01-13 23:12:42 CET     875  1000   983   6 present   /usr/lib/disman_backend_launcher
> Wed 2021-01-13 23:12:43 CET     968  1000   983   6 present   /usr/bin/kded5
> Wed 2021-01-13 23:12:43 CET     714  1000   983   6 present   /usr/lib/kdeconnectd
> Wed 2021-01-13 23:12:43 CET     974  1000   983   6 present   /usr/lib/drkonqi
> Wed 2021-01-13 23:12:43 CET     979  1000   983   6 present   /usr/lib/drkonqi
> Wed 2021-01-13 23:12:43 CET     736  1000   983   6 present   /usr/lib/kactivitymanagerd
> Wed 2021-01-13 23:12:43 CET     976  1000   983   6 present   /usr/lib/drkonqi
> Wed 2021-01-13 23:12:44 CET     971  1000   983   6 present   /usr/lib/org_kde_powerdevil
> Wed 2021-01-13 23:12:44 CET     989  1000   983   6 present   /usr/lib/drkonqi
> Wed 2021-01-13 23:12:44 CET     987  1000   983   6 present   /usr/bin/plasmashell
> Wed 2021-01-13 23:12:44 CET     726  1000   983   6 present   /usr/lib/org_kde_powerdevil
> Wed 2021-01-13 23:12:44 CET     681  1000   983   6 present   /usr/bin/kded5
> Wed 2021-01-13 23:12:45 CET     694  1000   983   6 present   /usr/bin/plasmashell

Oh, suprise: kwin_wayland is not in the list. The compositor doesn't crash. The only applications crashing are those which futilely attempt to interact with a compositor which is no longer running.

From my point of view as an user, having 16 core dumps generated each time I exit a Plasma Wayland session is absolutely unacceptable. There is no other description for this than disk thrashing. I don't see how this can be considered "RESOLVED UPSTREAM" when the patch fixing this in Qt has not even been accepted.

Therefore, I request this issue to be reopened.