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

Crash in QAccessibleComboBox::focusChild()

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P1: Critical
    • 6.2.11, 6.5.4, 6.6.1, 6.7.0 FF
    • 6.2.4, 6.5.1
    • None
    • Qt 6.5.1 (x86_64-little_endian-llp64 shared (dynamic) release build; by MSVC 2022) on "windows"
      OS: Windows Server 2019 Version 1809 [winnt version 10.0.17763]
    • Windows
    • fc556e357 (dev), 718bb1170 (6.6), bc97aa94d (6.5), 1f655480d (tqtc/lts-6.2)

    Description

      I understand to fix the crash we need some way to reproduce the problem. But it is not trivial to reproduce the problem and is happening in our product only on Windows Server 2019. We have QComboBox created in a table cell as part of the QStyleItemDelegate::createEditor() call. Table has many rows, and crash doesn't happen right away when editing the cell. We have to edit multiple rows before we get a crash.

      Here is the stack trace of the crash:

       

           Qt6Widgets_fme.dll!QComboBox::isEditable() Line 1703    C++
           Qt6Widgets_fme.dll!QAccessibleComboBox::focusChild() Line 328    C++
      >    Qt6Widgets_fme.dll!QAccessibleWidget::focusChild() Line 333    C++
           qwindows_fme.dll!QWindowsUiaMainProvider::GetFocus(IRawElementProviderFragment * * pRetVal) Line 733    C++
           UIAutomationCore.dll!00007ffe1d738fee()    Unknown
       
      QAccessibleInterface *QAccessibleComboBox::focusChild() const
      {
          // The editable combobox is the focus proxy of its lineedit, so the
          // lineedit itself never gets focus. But it is the accessible focus
          // child of an editable combobox.
          if (comboBox()->isEditable())
              return child(1);
          return nullptr;
      }
      

      Issue seems like the comboBox() call returns a null because editing of the cell has finished and the QComboBox has been destroyed. If change that line to 

      if (comboBox() && comboBox()->isEditable())
      

      then it no longer crashes.

       

      Attachments

        Issue Links

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

          Activity

            People

              liaqi Liang Qi
              uggas Harbinder Saggu
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes