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

QThreadStorageData crash

    XMLWordPrintable

Details

    • Bug
    • Resolution: Incomplete
    • Not Evaluated
    • None
    • 4.8.1
    • Core: Threads, Network
    • None
    • Linux i5 3.3.6-1-ARCH #1 SMP PREEMPT Sun May 13 10:52:32 CEST 2012 x86_64 GNU/Linux

    Description

      To share a QNetworkAccessManager among different objects running in the GUI thread, I create a QNetworkAccessManager instance in a static scoped pointer

      static QScopedPointer<QNetworkAccessManager> networkAccessManager;
      

      Once I exit the application, I occasionally get a crash (not always, but often). The stack trace says:

      [Thread debugging using libthread_db enabled]
      Using host libthread_db library "/lib/libthread_db.so.1".
      Traceback (most recent call last):
        File "/usr/share/gdb/auto-load/usr/lib/libgobject-2.0.so.0.3200.2-gdb.py", line 9, in <module>
          from gobject import register
        File "/usr/share/glib-2.0/gdb/gobject.py", line 3, in <module>
          import gdb.backtrace
      ImportError: No module named backtrace
      [New Thread 0x7ffff160d700 (LWP 13420)]
      [New Thread 0x7fffebfff700 (LWP 13421)]
      [New Thread 0x7fffeb7fe700 (LWP 13422)]
      content-type missing in HTTP POST, defaulting to application/octet-stream
      [Thread 0x7ffff160d700 (LWP 13420) exited]
      [Thread 0x7fffeb7fe700 (LWP 13422) exited]
      QThreadStorage: Thread 0x741340 exited after QThreadStorage 7 destroyed
      QThreadStorage: Thread 0x741340 exited after QThreadStorage 2 destroyed
      
      Program received signal SIGSEGV, Segmentation fault.
      [Switching to Thread 0x7fffebfff700 (LWP 13421)]
      0x00007ffff67a269b in QThreadStorageData::finish(void**) () from /usr/lib/libQtCore.so.4
      (gdb) bt
      #0  0x00007ffff67a269b in QThreadStorageData::finish(void**) () from /usr/lib/libQtCore.so.4
      #1  0x00007ffff67a374a in ?? () from /usr/lib/libQtCore.so.4
      #2  0x00007ffff67a4693 in ?? () from /usr/lib/libQtCore.so.4
      #3  0x00007ffff6514e0e in start_thread () from /lib/libpthread.so.0
      #4  0x00007ffff5d371ed in clone () from /lib/libc.so.6
      

      I suspect because the QNetworkAccessManager is deleted after QApplication is already destroyed.

      Attachments

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

        Activity

          People

            thiago Thiago Macieira
            janezzabc Janez Žemva
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes