Uploaded image for project: 'Qt Installer Framework'
  1. Qt Installer Framework
  2. QTIFW-905

Occasional crash on Linux systems at end of installer

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Not Evaluated
    • None
    • 3.1.0
    • General
    • None
    • Linux 64bit
    • 9bd807684eabd4623ee3cdfb02573d5cbe6ef4f7

    Description

      We had various users reporting that the installer crashes on Linux systems at the very end of the installation process. In many cases, the core file showed that multiple threads were trying to use qDebug() concurrently at the moment the crash occurred, e.g. this is a sample:

      (gdb) thread apply all bt
      
      Thread 5 (Thread 0x7f48fde91740 (LWP 18819)):
      #0  __lll_lock_wait_private () at ../sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:95
      #1  0x00007f48fbdbab60 in _int_free (av=0x7f48e0000020, p=0x7f48e0322dc0, have_lock=0) at malloc.c:3997
      #2  0x000000000199a911 in QString::operator=(QString const&) ()
      #3  0x00000000007460bd in QString::clear() ()
      #4  0x0000000001a21099 in QTextStreamPrivate::flushWriteBuffer() ()
      #5  0x0000000001a22eb3 in endl(QTextStream&) ()
      #6  0x00000000005271b7 in messageHandler(QtMsgType, QMessageLogContext const&, QString const&) ()
      #7  0x00000000018eaa59 in qt_message_print(QtMsgType, QMessageLogContext const&, QString const&) ()
      #8  0x00000000018eab88 in qt_message_output(QtMsgType, QMessageLogContext const&, QString const&) ()
      #9  0x00000000019f65d0 in QDebug::~QDebug() ()
      #10 0x00000000004e65c9 in QInstaller::PackageManagerGui::showFinishedPage() ()
      #11 0x0000000001b06b9e in QObject::event(QEvent*) ()
      #12 0x0000000000dc0874 in QWidget::event(QEvent*) ()
      #13 0x0000000000d7be4d in QApplicationPrivate::notify_helper(QObject*, QEvent*) ()
      #14 0x0000000000d83a8d in QApplication::notify(QObject*, QEvent*) ()
      #15 0x000000000047399a in SDKApp<QApplication>::notify(QObject*, QEvent*) ()
      #16 0x0000000001ad6e4b in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) ()
      #17 0x0000000001b2f16b in QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
      #18 0x00000000015386b6 in QUnixEventDispatcherQPA::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
      #19 0x0000000001ad3e92 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) ()
      #20 0x00000000004aca15 in QInstaller::PackageManagerCorePrivate::performOperationThreaded(KDUpdater::UpdateOperation*, QInstaller::PackageManagerCorePrivate::OperationType) ()
      #21 0x0000000000498a80 in QInstaller::PackageManagerCore::performOperation(QString const&, QStringList const&) ()
      #22 0x00000000005ae12a in QInstaller::PackageManagerCore::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) ()
      #23 0x00000000005af12f in QInstaller::PackageManagerCore::qt_metacall(QMetaObject::Call, int, void**) ()
      #24 0x00000000012270a2 in QQmlObjectOrGadget::metacall(QMetaObject::Call, int, void**) const ()
      #25 0x00000000011becfc in CallMethod(QQmlObjectOrGadget const&, int, int, int, int*, QV4::ExecutionEngine*, QV4::CallData*) ()
      #26 0x00000000011beea9 in CallPrecise(QQmlObjectOrGadget const&, QQmlPropertyData const&, QV4::ExecutionEngine*, QV4::CallData*) ()
      #27 0x00000000011bf6d9 in QV4::QObjectMethod::callInternal(QV4::CallData*) ()
      #28 0x00000000011d107b in QV4::Runtime::callProperty(QV4::ExecutionEngine*, int, QV4::CallData*) ()
      #29 0x00007f48f34f094d in ?? ()
      #30 0x00007ffd7bdaea10 in ?? ()
      #31 0x000000000117dd7f in QV4::MemberData::Data* QV4::MemoryManager::allocManaged<QV4::MemberData>(unsigned long) ()
      #32 0x000000000117dd34 in QV4::MemberData::reallocate(QV4::ExecutionEngine*, QV4::Heap::MemberData*, unsigned int) ()
      #33 0x00007f48f38010e8 in ?? ()
      #34 0x0000000003d239d0 in ?? ()
      #35 0x00007ffd7bdae9b0 in ?? ()
      #36 0x00007f48f34b3030 in ?? ()
      #37 0x0000000000000000 in ?? ()
      
      Thread 4 (Thread 0x7f48f34b2700 (LWP 18894)):
      #0  pthread_cond_timedwait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:225
      #1  0x0000000001902417 in QWaitCondition::wait(QMutex*, unsigned long) ()
      #2  0x00000000018fd67a in QThreadPoolThread::run() ()
      #3  0x00000000019018cb in QThreadPrivate::start(void*) ()
      #4  0x00007f48fc984464 in start_thread (arg=0x7f48f34b2700) at pthread_create.c:333
      #5  0x00007f48fbe2b9df in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:105
      
      Thread 3 (Thread 0x7f48fa0b6700 (LWP 18821)):
      #0  0x00007f48fbe2438c in __pselect (nfds=14, readfds=0x7f48ec000a78, writefds=0x7f48ec000d08, exceptfds=0x7f48ec000f98, timeout=<optimized out>, 
          sigmask=<optimized out>) at ../sysdeps/unix/sysv/linux/pselect.c:69
      #1  0x0000000001b2ca10 in qt_safe_select(int, fd_set*, fd_set*, fd_set*, timespec const*) ()
      #2  0x0000000001b2eb05 in QEventDispatcherUNIXPrivate::doSelect(QFlags<QEventLoop::ProcessEventsFlag>, timespec*) ()
      #3  0x0000000001b2f214 in QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
      #4  0x0000000001ad3e92 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) ()
      #5  0x00000000018faf85 in QThread::exec() ()
      #6  0x00000000019018cb in QThreadPrivate::start(void*) ()
      #7  0x00007f48fc984464 in start_thread (arg=0x7f48fa0b6700) at pthread_create.c:333
      #8  0x00007f48fbe2b9df in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:105
      
      Thread 2 (Thread 0x7f48fad3d700 (LWP 18820)):
      #0  0x00007f48fbe2256d in poll () at ../sysdeps/unix/syscall-template.S:84
      ---Type <return> to continue, or q <return> to quit---
      #1  0x00000000014d931a in _xcb_conn_wait (c=0x3a964b0, cond=<optimized out>, vector=0x0, count=0x0) at xcb_conn.c:459
      #2  0x00000000014db9aa in xcb_wait_for_event (c=0x3a964b0) at xcb_in.c:623
      #3  0x00000000014abf19 in QXcbEventReader::run() ()
      #4  0x00000000019018cb in QThreadPrivate::start(void*) ()
      #5  0x00007f48fc984464 in start_thread (arg=0x7f48fad3d700) at pthread_create.c:333
      #6  0x00007f48fbe2b9df in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:105
      
      Thread 1 (Thread 0x7f48f2b76700 (LWP 19091)):
      #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:58
      #1  0x00007f48fbd7740a in __GI_abort () at abort.c:89
      #2  0x00007f48fbdb3bd0 in __libc_message (do_abort=do_abort@entry=2, fmt=fmt@entry=0x7f48fbea8c70 "*** Error in `%s': %s: 0x%s ***\n")
          at ../sysdeps/posix/libc_fatal.c:175
      #3  0x00007f48fbdb9fa6 in malloc_printerr (action=3, str=0x7f48fbea58ac "realloc(): invalid next size", ptr=<optimized out>, ar_ptr=<optimized out>)
          at malloc.c:5046
      #4  0x00007f48fbdbcf7c in _int_realloc (av=av@entry=0x7f48e0000020, oldp=oldp@entry=0x7f48e0322dc0, oldsize=oldsize@entry=144, nb=nb@entry=272)
          at malloc.c:4287
      #5  0x00007f48fbdbe549 in __GI___libc_realloc (oldmem=0x7f48e0322dd0, bytes=256) at malloc.c:3080
      #6  0x000000000199d24f in QString::reallocData(unsigned int, bool) ()
      #7  0x0000000001a22f53 in endl(QTextStream&) ()
      #8  0x00000000005271b7 in messageHandler(QtMsgType, QMessageLogContext const&, QString const&) ()
      #9  0x00000000018eaa59 in qt_message_print(QtMsgType, QMessageLogContext const&, QString const&) ()
      #10 0x00000000018eab88 in qt_message_output(QtMsgType, QMessageLogContext const&, QString const&) ()
      #11 0x00000000019f65d0 in QDebug::~QDebug() ()
      #12 0x00000000004cda2b in QInstaller::OperationTracer::trace(QString const&) ()
      #13 0x00000000004c26ae in QInstaller::runOperation(KDUpdater::UpdateOperation*, QInstaller::PackageManagerCorePrivate::OperationType) ()
      #14 0x00000000004c99de in QtConcurrent::StoredFunctorCall2<bool, bool (*)(KDUpdater::UpdateOperation*, QInstaller::PackageManagerCorePrivate::OperationType), KDUpdater::UpdateOperation*, QInstaller::PackageManagerCorePrivate::OperationType>::runFunctor() ()
      #15 0x00000000004a8bf8 in QtConcurrent::RunFunctionTask<bool>::run() ()
      #16 0x00000000018fd5b9 in QThreadPoolThread::run() ()
      #17 0x00000000019018cb in QThreadPrivate::start(void*) ()
      #18 0x00007f48fc984464 in start_thread (arg=0x7f48f2b76700) at pthread_create.c:333
      #19 0x00007f48fbe2b9df in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:105
      

      I.e. it appears that some operation is still using OperationTracer::trace to print status output while the UI thread tries to use qDebug in the showFinishedPage slot to print a (not-so-useful) 'SHOW FINISHED PAGE' message. Maybe qDebug() is (incorrectly?) assumed to be thread safe?

      Attachments

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

        Activity

          People

            installerteam Installer Team
            frerich Frerich Raabe
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes