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

QSerialPort does not notice the disappearance of the device and generates 100% CPU load

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.8
    • Serial Port
    • None
    • Linux/Yocto

    Description

      If the serial interface disappears (in this case a USB-serial adapter), no error is sent to the application via the errorOccurred() signal.
      Instead, the Qt library generates 100% CPU load on the CPU core.

       

      I have the program (in attachment) running with strace. There you can see that a ppoll call returns. (See “< DEVICE REMOVED HERE >”).
      The following two lines are then output endlessly at high speed:

      ppoll([{fd=3, events=POLLIN}, {fd=5, events=POLLIN}], 2, NULL, NULL, 0) = 1 ([{fd=5, revents=POLLIN|POLLERR|POLLHUP}])
      read(5, "", 32768)  

      It seems that the error in the Qt source code is somehow ignored.

      I tried to reproduce the problem in a VirtualBox VM with Debian Bookworm and the Qt 6.4.2 from the Debian repository. Here the problem does not occur, and the errorOccurred() signal returns a clean “QSerialPort error: 5, No such file or directory”.

      Attachments

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

        Activity

          People

            vhilshei Volker Hilsheimer
            matthias_klein Matthias Klein
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes