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

[REG 6.8.1 -> 6.8.2] Crash on exit during logging of thread destruction

XMLWordPrintable

    • Linux/Wayland, Linux/X11
    • ba18ae386 (dev), c6fdf954e (6.9), 802beaa3f (6.8), fd857d400 (dev), 56993ad55 (6.9), 2c8b1dc95 (6.8)

      After upgrading from Qt 6.8.1 to 6.8.2, both Tumbleweed and Fedora hit crashes of some executables: https://openqa.opensuse.org/tests/4830727#step/coredump_collect/7 https://bugs.kde.org/show_bug.cgi?id=499537

      Backtrace from the kde bug report:

      #0  std::__atomic_base<QReadWriteLockPrivate*>::load (this=0x0, __m=std::memory_order_relaxed) at /usr/include/c++/15/bits/atomic_base.h:829
      #1  std::atomic<QReadWriteLockPrivate*>::load (this=0x0, __m=std::memory_order_relaxed) at /usr/include/c++/15/atomic:585
      #2  QAtomicOps<QReadWriteLockPrivate*>::loadRelaxed<QReadWriteLockPrivate*> (_q_value=<error reading variable: Cannot access memory at address 0x0>)
          at /usr/src/debug/qt6-qtbase-6.8.2-1.fc42.x86_64/src/corelib/thread/qatomic_cxx11.h:202
      #3  QBasicAtomicPointer<QReadWriteLockPrivate>::loadRelaxed (this=0x0) at /usr/src/debug/qt6-qtbase-6.8.2-1.fc42.x86_64/src/corelib/thread/qbasicatomic.h:170
      #4  QReadWriteLock::tryLockForWrite (this=0x0, timeout=...) at /usr/src/debug/qt6-qtbase-6.8.2-1.fc42.x86_64/src/corelib/thread/qreadwritelock.cpp:302
      #5  0x00007f68d9e4badd in QReadWriteLock::lockForWrite (this=<optimized out>) at /usr/src/debug/qt6-qtbase-6.8.2-1.fc42.x86_64/src/corelib/thread/qreadwritelock.h:78
      #6  0x00007f68da0d2f50 in QWriteLocker::relock (this=<synthetic pointer>) at /usr/src/debug/qt6-qtbase-6.8.2-1.fc42.x86_64/src/corelib/thread/qreadwritelock.h:167
      #7  QWriteLocker::QWriteLocker (this=<synthetic pointer>, areadWriteLock=0x0) at /usr/src/debug/qt6-qtbase-6.8.2-1.fc42.x86_64/src/corelib/thread/qreadwritelock.h:180
      #8  QSystemLocaleData::readEnvironment (this=0x0) at /usr/src/debug/qt6-qtbase-6.8.2-1.fc42.x86_64/src/corelib/text/qlocale_unix.cpp:44
      #9  0x00007f68da0d362c in QSystemLocale::query (this=<optimized out>, type=QSystemLocale::LocaleChanged, in=...)
          at /usr/src/debug/qt6-qtbase-6.8.2-1.fc42.x86_64/src/corelib/text/qlocale_unix.cpp:132
      #10 0x00007f68d9fb8df5 in updateSystemPrivate () at /usr/src/debug/qt6-qtbase-6.8.2-1.fc42.x86_64/src/corelib/text/qlocale.cpp:786
      #11 0x00007f68d9fb931b in systemData (sysIndex=0x0) at /usr/src/debug/qt6-qtbase-6.8.2-1.fc42.x86_64/src/corelib/text/qlocale.cpp:831
      #12 QLocale::QLocale (this=this@entry=0x7fffadc3b1f8) at /usr/src/debug/qt6-qtbase-6.8.2-1.fc42.x86_64/src/corelib/text/qlocale.cpp:1118
      #13 0x00007f68d9ea99b7 in QResourceFileEnginePrivate::QResourceFileEnginePrivate (this=0x55f42801e2a0)
          at /usr/src/debug/qt6-qtbase-6.8.2-1.fc42.x86_64/src/corelib/io/qresource.cpp:1381
      #14 QResourceFileEngine::QResourceFileEngine (this=this@entry=0x55f428023bc0, file=...)
          at /usr/src/debug/qt6-qtbase-6.8.2-1.fc42.x86_64/src/corelib/io/qresource.cpp:1413
      #15 0x00007f68d9e90ad8 in std::make_unique<QResourceFileEngine, QString const&> () at /usr/include/c++/15/bits/unique_ptr.h:1076
      #16 _q_createLegacyEngine_recursive (entry=..., data=..., engine=std::unique_ptr<QAbstractFileEngine> = {...}, resolvingEntry=resolvingEntry@entry=false)
          at /usr/src/debug/qt6-qtbase-6.8.2-1.fc42.x86_64/src/corelib/io/qfilesystemengine.cpp:114
      #17 0x00007f68d9e90c03 in QFileSystemEngine::createLegacyEngine (entry=..., data=...)
          at /usr/src/debug/qt6-qtbase-6.8.2-1.fc42.x86_64/src/corelib/io/qfilesystemengine.cpp:168
      #18 0x00007f68d9e8a852 in QFileInfo::exists (path=...) at /usr/src/debug/qt6-qtbase-6.8.2-1.fc42.x86_64/src/corelib/io/qfileinfo.cpp:752
      #19 0x00007f68d9e827e9 in QFile::exists (fileName=...) at /usr/src/debug/qt6-qtbase-6.8.2-1.fc42.x86_64/src/corelib/io/qfile.cpp:370
      #20 0x00007f68d9e4f818 in findConfiguration () at /usr/src/debug/qt6-qtbase-6.8.2-1.fc42.x86_64/src/corelib/global/qlibraryinfo.cpp:106
      #21 0x00007f68d9e4fb7b in QLibrarySettings::load (
          this=0x7f68da47dff0 <QGlobalStatic<QtGlobalStatic::Holder<(anonymous namespace)::Q_QGS_qt_library_settings> >::instance()::holder>)
          at /usr/src/debug/qt6-qtbase-6.8.2-1.fc42.x86_64/src/corelib/global/qlibraryinfo.cpp:79
      --Type <RET> for more, q to quit, c to continue without paging--c
      #22 0x00007f68d9e507ce in QLibrarySettings::QLibrarySettings (
          this=0x7f68da47dff0 <QGlobalStatic<QtGlobalStatic::Holder<(anonymous namespace)::Q_QGS_qt_library_settings> >::instance()::holder>)
          at /usr/src/debug/qt6-qtbase-6.8.2-1.fc42.x86_64/src/corelib/global/qlibraryinfo.cpp:59
      #23 (anonymous namespace)::Q_QGS_qt_library_settings::innerFunction (
          pointer=0x7f68da47dff0 <QGlobalStatic<QtGlobalStatic::Holder<(anonymous namespace)::Q_QGS_qt_library_settings> >::instance()::holder>)
          at /usr/src/debug/qt6-qtbase-6.8.2-1.fc42.x86_64/src/corelib/global/qlibraryinfo.cpp:55
      #24 QtGlobalStatic::Holder<(anonymous namespace)::Q_QGS_qt_library_settings>::Holder (
          this=0x7f68da47dff0 <QGlobalStatic<QtGlobalStatic::Holder<(anonymous namespace)::Q_QGS_qt_library_settings> >::instance()::holder>)
          at /usr/src/debug/qt6-qtbase-6.8.2-1.fc42.x86_64/src/corelib/global/qglobalstatic.h:37
      #25 QGlobalStatic<QtGlobalStatic::Holder<(anonymous namespace)::Q_QGS_qt_library_settings> >::instance ()
          at /usr/src/debug/qt6-qtbase-6.8.2-1.fc42.x86_64/src/corelib/global/qglobalstatic.h:100
      #26 QGlobalStatic<QtGlobalStatic::Holder<(anonymous namespace)::Q_QGS_qt_library_settings> >::operator() (this=<optimized out>)
          at /usr/src/debug/qt6-qtbase-6.8.2-1.fc42.x86_64/src/corelib/global/qglobalstatic.h:82
      #27 havePaths () at /usr/src/debug/qt6-qtbase-6.8.2-1.fc42.x86_64/src/corelib/global/qlibraryinfo.cpp:148
      #28 QLibraryInfoPrivate::paths (p=p@entry=QLibraryInfo::DataPath, usageMode=usageMode@entry=QLibraryInfoPrivate::RegularUsage)
          at /usr/src/debug/qt6-qtbase-6.8.2-1.fc42.x86_64/src/corelib/global/qlibraryinfo.cpp:610
      #29 0x00007f68d9e51346 in QLibraryInfoPrivate::path (p=p@entry=QLibraryInfo::DataPath, usageMode=usageMode@entry=QLibraryInfoPrivate::RegularUsage)
          at /usr/src/debug/qt6-qtbase-6.8.2-1.fc42.x86_64/src/corelib/global/qlibraryinfo.cpp:669
      #30 0x00007f68d9e51434 in QLibraryInfo::path (p=p@entry=QLibraryInfo::DataPath)
          at /usr/src/debug/qt6-qtbase-6.8.2-1.fc42.x86_64/src/corelib/global/qlibraryinfo.cpp:523
      #31 0x00007f68d9ea2e89 in QLoggingRegistry::initializeRules (
          this=this@entry=0x7f68da47ed20 <QGlobalStatic<QtGlobalStatic::Holder<(anonymous namespace)::Q_QGS_qtLoggingRegistry> >::instance()::holder>)
          at /usr/src/debug/qt6-qtbase-6.8.2-1.fc42.x86_64/src/corelib/io/qloggingregistry.cpp:310
      #32 0x00007f68d9ea3cdd in QLoggingRegistry::QLoggingRegistry (
          this=0x7f68da47ed20 <QGlobalStatic<QtGlobalStatic::Holder<(anonymous namespace)::Q_QGS_qtLoggingRegistry> >::instance()::holder>)
          at /usr/src/debug/qt6-qtbase-6.8.2-1.fc42.x86_64/src/corelib/io/qloggingregistry.cpp:239
      #33 (anonymous namespace)::Q_QGS_qtLoggingRegistry::innerFunction (
          pointer=0x7f68da47ed20 <QGlobalStatic<QtGlobalStatic::Holder<(anonymous namespace)::Q_QGS_qtLoggingRegistry> >::instance()::holder>)
          at /usr/src/debug/qt6-qtbase-6.8.2-1.fc42.x86_64/src/corelib/io/qloggingregistry.cpp:29
      #34 QtGlobalStatic::Holder<(anonymous namespace)::Q_QGS_qtLoggingRegistry>::Holder (
          this=0x7f68da47ed20 <QGlobalStatic<QtGlobalStatic::Holder<(anonymous namespace)::Q_QGS_qtLoggingRegistry> >::instance()::holder>)
          at /usr/src/debug/qt6-qtbase-6.8.2-1.fc42.x86_64/src/corelib/global/qglobalstatic.h:37
      #35 QGlobalStatic<QtGlobalStatic::Holder<(anonymous namespace)::Q_QGS_qtLoggingRegistry> >::instance ()
          at /usr/src/debug/qt6-qtbase-6.8.2-1.fc42.x86_64/src/corelib/global/qglobalstatic.h:100
      #36 QGlobalStatic<QtGlobalStatic::Holder<(anonymous namespace)::Q_QGS_qtLoggingRegistry> >::operator() (this=<optimized out>)
          at /usr/src/debug/qt6-qtbase-6.8.2-1.fc42.x86_64/src/corelib/global/qglobalstatic.h:82
      #37 QLoggingRegistry::instance () at /usr/src/debug/qt6-qtbase-6.8.2-1.fc42.x86_64/src/corelib/io/qloggingregistry.cpp:427
      #38 0x00007f68d9e9ee6f in QLoggingCategory::init (
          this=0x7f68da47ecd0 <QGlobalStatic<QtGlobalStatic::Holder<(anonymous namespace)::Q_QGS_qtDefaultCategory> >::instance()::holder>, category=<optimized out>, 
          severityLevel=QtDebugMsg) at /usr/src/debug/qt6-qtbase-6.8.2-1.fc42.x86_64/src/corelib/io/qloggingcategory.cpp:188
      #39 0x00007f68d9e9f01d in (anonymous namespace)::Q_QGS_qtDefaultCategory::innerFunction (
          pointer=0x7f68da47ecd0 <QGlobalStatic<QtGlobalStatic::Holder<(anonymous namespace)::Q_QGS_qtDefaultCategory> >::instance()::holder>)
          at /usr/src/debug/qt6-qtbase-6.8.2-1.fc42.x86_64/src/corelib/io/qloggingcategory.cpp:10
      #40 QtGlobalStatic::Holder<(anonymous namespace)::Q_QGS_qtDefaultCategory>::Holder (
          this=0x7f68da47ecd0 <QGlobalStatic<QtGlobalStatic::Holder<(anonymous namespace)::Q_QGS_qtDefaultCategory> >::instance()::holder>)
          at /usr/src/debug/qt6-qtbase-6.8.2-1.fc42.x86_64/src/corelib/global/qglobalstatic.h:37
      #41 QGlobalStatic<QtGlobalStatic::Holder<(anonymous namespace)::Q_QGS_qtDefaultCategory> >::instance ()
          at /usr/src/debug/qt6-qtbase-6.8.2-1.fc42.x86_64/src/corelib/global/qglobalstatic.h:100
      #42 QGlobalStatic<QtGlobalStatic::Holder<(anonymous namespace)::Q_QGS_qtDefaultCategory> >::operator() (this=<optimized out>)
          at /usr/src/debug/qt6-qtbase-6.8.2-1.fc42.x86_64/src/corelib/global/qglobalstatic.h:82
      #43 QLoggingCategory::defaultCategory () at /usr/src/debug/qt6-qtbase-6.8.2-1.fc42.x86_64/src/corelib/io/qloggingcategory.cpp:317
      #44 0x00007f68d9e52c1c in qt_message_print (msgType=QtWarningMsg, context=..., message=...)
          at /usr/src/debug/qt6-qtbase-6.8.2-1.fc42.x86_64/src/corelib/global/qlogging.cpp:2084
      #45 0x00007f68d9e52da6 in qt_message(QtMsgType, const QMessageLogContext &, const char *, typedef __va_list_tag __va_list_tag *) (msgType=msgType@entry=QtWarningMsg, 
          context=..., msg=msg@entry=0x7f68da2cfae8 "QThreadStorage: Thread %p exited after QThreadStorage %d destroyed", ap=ap@entry=0x7fffadc3bc28)
          at /usr/src/debug/qt6-qtbase-6.8.2-1.fc42.x86_64/src/corelib/global/qlogging.cpp:379
      #46 0x00007f68d9e00fbc in QMessageLogger::warning (this=this@entry=0x7fffadc3be70, 
          msg=msg@entry=0x7f68da2cfae8 "QThreadStorage: Thread %p exited after QThreadStorage %d destroyed")
          at /usr/src/debug/qt6-qtbase-6.8.2-1.fc42.x86_64/src/corelib/global/qlogging.cpp:634
      #47 0x00007f68da0ac25e in QThreadStorageData::finish (p=0x55f42801d598) at /usr/src/debug/qt6-qtbase-6.8.2-1.fc42.x86_64/src/corelib/thread/qthreadstorage.cpp:160
      #48 0x00007f68da09f23a in operator() (__closure=<optimized out>) at /usr/src/debug/qt6-qtbase-6.8.2-1.fc42.x86_64/src/corelib/thread/qthread_unix.cpp:406
      #49 (anonymous namespace)::terminate_on_exception<QThreadPrivate::finish()::<lambda()> >(struct {...} &&) (t=...)
          at /usr/src/debug/qt6-qtbase-6.8.2-1.fc42.x86_64/src/corelib/thread/qthread_unix.cpp:311
      #50 0x00007f68da09f4d5 in QThreadPrivate::finish (this=<optimized out>) at /usr/src/debug/qt6-qtbase-6.8.2-1.fc42.x86_64/src/corelib/thread/qthread_unix.cpp:386
      #51 destroy_current_thread_data (p=0x55f42801d520) at /usr/src/debug/qt6-qtbase-6.8.2-1.fc42.x86_64/src/corelib/thread/qthread_unix.cpp:130
      #52 Cleanup::~Cleanup (this=<optimized out>) at /usr/src/debug/qt6-qtbase-6.8.2-1.fc42.x86_64/src/corelib/thread/qthread_unix.cpp:180
      #53 0x00007f68d99914c1 in __run_exit_handlers (status=0, listp=0x7f68d9b5e680 <__exit_funcs>, run_list_atexit=run_list_atexit@entry=true, 
          run_dtors=run_dtors@entry=true) at exit.c:118
      #54 0x00007f68d999159e in __GI_exit (status=<optimized out>) at exit.c:148
      #55 0x00007f68d99785fc in __libc_start_call_main (main=main@entry=0x55f3f396f5d0 <main>, argc=argc@entry=1, argv=argv@entry=0x7fffadc3c0b8)
          at ../sysdeps/nptl/libc_start_call_main.h:74
      #56 0x00007f68d99786a8 in __libc_start_main_impl (main=0x55f3f396f5d0 <main>, argc=1, argv=0x7fffadc3c0b8, init=<optimized out>, fini=<optimized out>, 
          rtld_fini=<optimized out>, stack_end=0x7fffadc3c0a8) at ../csu/libc-start.c:360
      #57 0x000055f3f396f8f5 in _start ()
      

      Apparently thread data destruction on exit triggers a warning message, but initialization of the logging system doesn't work at this stage of program teardown anymore.

      Reverting 38f287443c82510719079a254910424b5e510b25. and 5acbda4b06ea5f494b56353ff9df60e1a016b55a makes the crashes disappear.

        For Gerrit Dashboard: QTBUG-133500
        # Subject Branch Project Status CR V

            thiago Thiago Macieira
            vogtinator Fabian Vogt
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: