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

Releasing the last handle to a Qt-using library on Symbian might crash

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • P2: Important
    • None
    • 4.6.0
    • Other

    Description

      There are some possible bugs that cause problems when Qt is used from within a library. I.e. there is a main-application executable that isn't linking to Qt but loads a DLL that is using Qt. E.g. a Java virtual machine loading a Qt-using extension DLL would be such a case.

      Qt's global statics (Q_GLOBAL_STATIC, etc.) are constructed on demand in the thread that needs them. Usually in the GUI thread. In the above case they are destroyed in the thread closes the last handle to the Qt-using library causing also the Qt libraries to be detached.

      Question 1: Should it be safe to close the last handle to a Qt-using library in any thread? In other words, is it a bug if constructing a global static in Qt in one thread and then destroying it in another thread causes a crash?

      Attached are a simple main()-application and a DLL that can be used to reproduce a crash that occurs when the last handle to a Qt-using library is closed in a non-GUI thread. The crash happens in ~QFontDatabasePrivate(). See the file qtfontdatabase.txt for call stack created with the attached app.

      Question 2: When Qt is used in a library then there is a crash always in ~QS60PluginResolver() when the library is unloaded. See the file qtpluginresolver.txt for call stack created with the attached app. This happens even when everything is run in the main()-thread. Is this a bug?

      Attachments

        1. qtfontdatabase.txt
          3 kB
        2. qtpluginresolver.txt
          2 kB
        3. testapp.zip
          6 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            e0348803 Miikka Heikkinen
            suistoma Jussi Suistomaa
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes