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

Race condition in input aspect causing segmentation fault on shutdown

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P1: Critical
    • None
    • 5.11
    • Qt3D
    • 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

            seanharmer Sean Harmer
            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