Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-25708

Possible crash in SemanticHighlighter on shutdown (or on session switch)

    XMLWordPrintable

Details

    Description

      To reproduce:
      1. Apply this patch: https://codereview.qt-project.org/c/qt-creator/qt-creator/+/348559
      2. Load creator project into creator and open any qml file
      3. As soon as you see the "Switch session or shutdown now!" printout, close creator (or switch the session). It should crash.

      The reason is that SemanticHighlighter::rerun() starts a new task, and this task is not stopped on shutdown or on session switch.

      Call stack (on shutdown):

      1  raise                                                                                                                                                                                                                                                                                                                       2  abort                                                                                                                                                                                                                                                                                                                       3  __gnu_cxx::__verbose_terminate_handler() [clone .cold]                                                                                                                                                                                                                                                                      
      4  __cxxabiv1::__terminate(void ( *)())                                                                                                                                                                                                                                                                                        
      5  std::terminate()                                                                                                                                                                                                                                                                                                            
      6  qt_check_pointer                                                   qglobal.cpp                  3328 0x7ffff60d57c2 
      7  QVector<(anonymous namespace)::Property>::realloc                  qvector.h                    700  0x7ffff6c378bc 
      8  QVector<(anonymous namespace)::Property>::append                   qvector.h                    806  0x7ffff6c3755f 
      9  QTextFormatPrivate::insertProperty                                 qtextformat.cpp              213  0x7ffff6c39261 
      10 QTextFormat::setProperty                                           qtextformat.cpp              1164 0x7ffff6c3592e 
      11 QTextCharFormat::setToolTip                                        qtextformat.h                563  0x7fffbb5bf2cc 
      12 QmlJSEditor::(anonymous namespace)::CollectionTask::addMessages    qmljssemantichighlighter.cpp 415  0x7fffbb5faa5a 
      13 QmlJSEditor::(anonymous namespace)::CollectionTask::CollectionTask qmljssemantichighlighter.cpp 196  0x7fffbb5f98d5 
      14 QmlJSEditor::SemanticHighlighter::run                              qmljssemantichighlighter.cpp 601  0x7fffbb5fba01 
      ...
      

      Call stack (on session switch)

                                                                                                                                                                                                                                                                                                                                                   
                                                                                                                                                                                                                                                                                                                                                   
      1  std::__atomic_base<int>::load                          atomic_base.h                479 0x7fffbb5bdb36 
      2  QAtomicOps<int>::loadRelaxed<int>                      qatomic_cxx11.h              239 0x7fffbb5bdb36 
      3  QBasicAtomicInteger<int>::loadRelaxed                  qbasicatomic.h               107 0x7fffbb5bd06a 
      4  QtPrivate::RefCount::deref                             qrefcount.h                  66  0x7fffbb5bc98a 
      5  QHash<int, QTextCharFormat>::operator=                 qhash.h                      643 0x7fffbb6279e3 
      6  QmlJSEditor::SemanticHighlighter::reportMessagesInfo   qmljssemantichighlighter.cpp 630 0x7fffbb6261ed 
      7  QmlJSEditor::SemanticHighlighter::run                  qmljssemantichighlighter.cpp 602 0x7fffbb625a53 
      ...
      

      Attachments

        Issue Links

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

          Activity

            People

              jkobus Jarek Kobus
              jkobus Jarek Kobus
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes