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

Qt should exit, not abort, when Wayland connection closes

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • None
    • 5.15.0, 6.0.0
    • QPA: Wayland
    • None
    • Linux/Wayland
    • 91625c591c9854c7b6934c12a83df6cbcfcbfbd4

    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

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            csslayer Weng Xuetian
            mstoeckl M Stoeckl
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes