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

Race condition in input aspect causing segmentation fault on shutdown

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P1: Critical
    • Resolution: Unresolved
    • Affects Version/s: 5.11
    • Fix Version/s: None
    • Component/s: Qt3D
    • Labels:
      None

      Description

      The example attached reproduces the problem (it looks a bit contrived but reproduces the problem we're having in our application). We have a QStackedLayout containing a widget on top, and a QQuickWidget with a Scene3D element behind it. The Scene3D has an input aspect. At some point, render() is called on the top widget. When the application is closed without the QQuickWidget being shown, there's a segmentation fault.

      It looks like the segfault happens because calling render() on the top widget triggers a render() on the QQuickWidget; this starts the rendering loop, QInputSettings::setEventSource is eventually called, and a QPropertyUpdatedChange is created, with "eventSource" as property name and a pointer to the Scene3DItem as value. When the application is closed, the property change is delivered to the InputSettings backend node, but at this point the Scene3DItem was already destroyed, causing the crash.

      The crash is 100% reproducible in this sample, but this looks like a race that could also happen in a more "normal" application.

        Attachments

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

          Activity

            People

            Assignee:
            seanharmer Sean Harmer
            Reporter:
            mauro.persano Mauro Persano
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes