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

QComboBox popup menu sometimes fails to open and causes crash on editor close

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Not Evaluated Not Evaluated
    • None
    • 6.8.1
    • None
    • Linux/Other display system

      I am using Qt 6.8.1 with Buildroot 2025.02.3 on an ARM board running embedded Linux.

      When using the framebuffer platform plugin, everything works fine with QComboBox, and I can open the popup menu without any issues. However, when using the VNC platform plugin, the popup menu sometimes fails to open when I click on the combo box. If I then close the editor (which destroys the combo box) after such a failed attempt, the application crashes with a segmentation fault (SEGV_MAPERR).

      If the popup menu does not open, I can continue to work normally as long as I don't close the editor. The popup menu often opens on the second attempt. However, if it had failed once, closing the editor afterwards will still cause a crash. The problem is easier to reproduce when the combo box contains more entries (for example, 27 entries). It occurs approximately once every 10 tries.

      I could not reproduce this issue on my X11 openSUSE build.

      The issue occurs both with the standard QComboBox and with my subclass QMyComboBox. In QMyComboBox, I only overrode showPopup(), hidePopup(), and eventFilter() to add logging (see QMyComboBox.h / logging.txt). The behavior of QComboBox was not modified.

      From the logs, I can see that the issue occurs if the mouse release event is processed while I am still in the showPopup() function of the QComboBox. In this case, it calls hidePopup() from within showPopup().

      As a workaround, I introduced a guard variable that fixes the issue for me (see QMyComboBox_workaround.h).

        1. logging.txt
          3 kB
        2. QMyComboBox.h
          2 kB
        3. QMyComboBox_workaround.h
          0.9 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            sts55 Stefan Simböck
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes