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

Crash in qstylehelper

XMLWordPrintable

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

      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.

       

       

        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
            jkimmel Jason Kimmel
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes