Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-85631

Qt should exit, not abort, when Wayland connection closes

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: 5.15.0, 6.0.0
    • Fix Version/s: None
    • Component/s: QPA: Wayland
    • Labels:
      None
    • Platform/s:
      Linux/Wayland

      Description

      If you run an Qt GUI application under a Wayland compositor (not via XWayland), and kill the compositor, the Qt application will produce the error message: "The Wayland connection broke. Did the Wayland compositor die?", and crash. For comparison, if you run such an application under X11, and kill the X server, it will print "The X11 connection broke (error 1). Did the X11 server die?", and exit.

      To reproduce this behavior:

      • run `weston`
      • Inside Weston, open a terminal, and run `XDG_SESSION_TYPE=wayland a-qt-application & disown` ;
      • kill the Weston process
      • Observe that k

      I think the the X11 behavior is more correct, because the connection breaking is generally the fault of the compositor, not the application; aborting 1) generally does not call any shutdown routines a program may have 2) often produces a useless core dump. (By now, I've accumulated a few hundred such core dumps. )-: On the other hand, if the Wayland connection has a fatal (non-disconnection) error, it is still appropriate to abort, as these errors generally signify a misuse of a protocol.

      The source code for the X11 and Wayland disconnection routines is at: https://github.com/qt/qtbase/blob/dev/src/plugins/platforms/xcb/qxcbconnection.cpp#L985-L988 and https://github.com/qt/qtwayland/blob/dev/src/client/qwaylanddisplay.cpp#L209-L212 .

        Attachments

        For Gerrit Dashboard: QTBUG-85631
        # Subject Branch Project Status CR V

          Activity

            People

            Assignee:
            qt.team.graphics.and.multimedia Qt Graphics Team
            Reporter:
            mstoeckl M Stoeckl
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes