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

Crash in qstylehelper

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P1: Critical
    • None
    • 5.13.2, 5.14.2, 5.15.1
    • Widgets: Styles
    • None
    • Win 10 (x64) v1909
    • Windows

    Description

      We have a large-ish Qt 5.13.2 application that would experience reproducible crashes when the user clicked certain buttons in the interface quickly in conditions that caused a number of Qt elements to be re-created. While we are unsure of the exact underlying issue, we have remediated the problem in a way that that might benefit others.

      The crash appeared in QStyleHelper::isInstanceOf where it would attempt to obtain a role() from an invalid QAccessibleInterface object. We were able to prevent the crashes by making sure the QAccessibleInterface object was valid before asking it for a role.  This appears to be similar to https://bugreports.qt.io/browse/QTBUG-47093.

       

      We recommend changing the 3rd line of the function from 

      match = iface && iface->role() == role;

      to

      match = iface && iface->isValid() && iface->role() == role;

       

      The code for QStyleHelper::isInstanceOf appears to be unchanged from 5.13.2 to the present, so we assume the same crash would occur in newer versions as well, but we have not tested to be sure.

       

       

      Attachments

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

        Activity

          People

            tpochep Timur Pocheptsov
            jkimmel Jason Kimmel
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes