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

Crash on process exit when the evdevtouch plugin is loaded and has active devices

    XMLWordPrintable

Details

    • I50c1edee7405aad308274538219698388c2cc9f9

    Description

      During normal process exit, QTouchDevicePrivate already cleans up all registered touch devices via a qAddPostRoutine. This happens before the plugins get cleaned up, so by the time the destructor for the plugin's QEvdevTouchScreenHandler gets called the device is already deleted, and calling unregisterTouchDevice() in the destructor again results in a double delete and crash.

      Unregistering the device in the destructor isn't needed anyway for any use case. The touch device will already be properly unregistered and deleted
      if the device gets removed, as the fd will report the read error
      in readData() and unregisterTouchDevice() will get called there. That's the only case where devices can be removed dynamically during regular execution, for all other cases the cleanup will happen during the QApplication shutdown.

      Note that there's already a long-standing change request for this bug: https://codereview.qt-project.org/#/c/142561/

      but it's been stalled and I haven't been able to get a decision. This needs to be adressed one way or another asap.

      Attachments

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

        Activity

          People

            kromain Romain Pokrzywka
            kromain Romain Pokrzywka
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes