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

QtCreator crash due to SEGFAULT when opening a malformed ui.qml

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P1: Critical
    • Resolution: Done
    • Affects Version/s: Qt Creator 4.13.0-rc1, Qt Creator 4.13.0
    • Component/s: Quick / QML Support
    • Environment:
      Tested from ArchLinux provided QtCreator and from QtMaintainer
      This problem only occurs when the filename ends with .ui.qml (the suffix hint make QtCreator open the designer)

    • Platform/s:
      Linux/X11
    • Commits:
      2f584585e3c34871396c8dd1de4e4c03c1188492 (qt-creator/qt-creator/4.13)

      Description

      QtCreator will crash when opening a malformed `ui.qml` file (the QML file has a problematic "property" field, see below)

       

      Even though the QML is problematic, QtCreator should not crash.

      Changing the "=" to ":" makes it work again (since the original one is not following the QML syntax).

       

      Digging further, gdb will produce the following backtrace:

       
       #0 QmlJS::ScopeChain::document (this=0x0) at /home/qt/work/build/qt-creator/src/libs/qmljs/qmljsscopechain.cpp:111
       #1 0x00007fffdc99a4e9 in QmlDesigner::Internal::TextToModelMerger::getQMLSingletons (this=0x3d40130) at /home/qt/work/build/qt-creator/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp:2183
       #2 0x00007fffdc9315c4 in QmlDesigner::RewriterView::getQMLTypes (this=<optimized out>) at /home/qt/work/build/qt-creator/src/plugins/qmldesigner/designercore/model/rewriterview.cpp:967
       #3 0x00007fffdc8e0a3c in QmlDesigner::NodeInstanceView::createCreateSceneCommand (this=this@entry=0x1b5f928) at /home/qt/work/build/qt-creator/src/plugins/qmldesigner/designercore/instances/nodeinstanceview.cpp:957
       #4 0x00007fffdc8e1eb3 in QmlDesigner::NodeInstanceView::modelAttached (this=0x1b5f928, model=0x3becad0) at /home/qt/work/build/qt-creator/src/plugins/qmldesigner/designercore/instances/nodeinstanceview.cpp:202
       #5 0x00007fffdc95aa3c in QmlDesigner::Internal::ModelPrivate::setNodeInstanceView (this=0x3dc2d90, nodeInstanceView=nodeInstanceView@entry=0x1b5f928) at /home/qt/work/build/qt-creator/src/plugins/qmldesigner/designercore/model/model.cpp:1761
       #6 0x00007fffdc95aad9 in QmlDesigner::Model::setNodeInstanceView (this=<optimized out>, nodeInstanceView=nodeInstanceView@entry=0x1b5f928) at /home/qt/work/build/qt-creator/src/plugins/qmldesigner/designercore/model/model.cpp:2032
       #7 0x00007fffdc9e79e0 in QmlDesigner::ViewManager::attachNodeInstanceView (this=this@entry=0x1b23500) at /home/qt/work/build/qt-creator/src/plugins/qmldesigner/designercore/model/viewmanager.cpp:122
       #8 0x00007fffdc9e8b4d in QmlDesigner::ViewManager::attachViewsExceptRewriterAndComponetView (this=0x1b23500) at /home/qt/work/build/qt-creator/src/plugins/qmldesigner/designercore/model/viewmanager.cpp:276
       #9 0x00007fffdc88e688 in QmlDesigner::QmlDesignerPlugin::activateAutoSynchronization (this=this@entry=0xd67300) at /home/qt/work/build/qt-creator/src/plugins/qmldesigner/qmldesignerplugin.cpp:461
       #10 0x00007fffdc8908b0 in QmlDesigner::QmlDesignerPlugin::showDesigner (this=0xd67300) at /home/qt/work/build/qt-creator/src/plugins/qmldesigner/qmldesignerplugin.cpp:374
       #11 0x00007fffdc890e09 in QmlDesigner::QmlDesignerPlugin::<lambda(Core::Id, Core::Id)>::operator() (oldMode=..., newMode=..., __closure=0x24f0140) at /home/qt/work/build/qt-creator/src/plugins/qmldesigner/qmldesignerplugin.cpp:341
       #12 QtPrivate::FunctorCall<QtPrivate::IndexesList<0, 1>, QtPrivate::List<Utils::Id, Utils::Id>, void, QmlDesigner::QmlDesignerPlugin::integrateIntoQtCreator(QWidget*)::<lambda(Core::Id, Core::Id)> >::call (arg=<optimized out>, f=...) at /home/qt/work/build/qt5_install_dir/include/QtCore/qobjectdefs_impl.h:146
       #13 QtPrivate::Functor<QmlDesigner::QmlDesignerPlugin::integrateIntoQtCreator(QWidget*)::<lambda(Core::Id, Core::Id)>, 2>::call<QtPrivate::List<Utils::Id, Utils::Id>, void> (arg=<optimized out>, f=...) at /home/qt/work/build/qt5_install_dir/include/QtCore/qobjectdefs_impl.h:256
       #14 QtPrivate::QFunctorSlotObject<QmlDesigner::QmlDesignerPlugin::integrateIntoQtCreator(QWidget*)::<lambda(Core::Id, Core::Id)>, 2, QtPrivate::List<Utils::Id, Utils::Id>, void>::impl(int, QtPrivate::QSlotObjectBase *, QObject *, void **, bool *) (which=<optimized out>, this_=0x24f0130, r=<optimized out>, a=<optimized out>, ret=<optimized out>) at /home/qt/work/build/qt5_install_dir/include/QtCore/qobjectdefs_impl.h:443
       #15 0x00007ffff5a6ce80 in void doActivate<false>(QObject*, int, void**) () from /home/leroy/Qt/Tools/QtCreator/bin/../lib/Qt/lib/libQt5Core.so.5
       #16 0x00007fffe9111ceb in Core::ModeManager::currentModeChanged (this=this@entry=0x1167070, _t1=..., _t2=...) at .moc/release-shared/moc_modemanager.cpp:198
       #17 0x00007fffe8ffad11 in Core::ModeManager::currentTabChanged (this=0x1167070, index=2) at /home/qt/work/build/qt-creator/src/plugins/coreplugin/modemanager.cpp:348
       #18 0x00007ffff5a6ce80 in void doActivate<false>(QObject*, int, void**) () from /home/leroy/Qt/Tools/QtCreator/bin/../lib/Qt/lib/libQt5Core.so.5
       #19 0x00007fffe9109ca1 in Core::Internal::FancyTabWidget::currentChanged (this=<optimized out>, _t1=2) at .moc/release-shared/moc_fancytabwidget.cpp:462
       #20 0x00007ffff5a6ce80 in void doActivate<false>(QObject*, int, void**) () from /home/leroy/Qt/Tools/QtCreator/bin/../lib/Qt/lib/libQt5Core.so.5
       #21 0x00007fffe9109c21 in Core::Internal::FancyTabBar::currentChanged (this=<optimized out>, _t1=2) at .moc/release-shared/moc_fancytabwidget.cpp:280
       #22 0x00007fffe8f9cd7b in Core::Internal::EditorManagerPrivate::activateEditor (view=view@entry=0x10c32a0, editor=editor@entry=0x2ca76a0, flags=..., flags@entry=...) at /home/qt/work/build/qt-creator/src/plugins/coreplugin/editormanager/editormanager.cpp:1401
       #23 0x00007fffe8fa0816 in Core::Internal::EditorManagerPrivate::openEditor (view=0x10c32a0, fileName=..., editorId=..., flags=..., newEditor=newEditor@entry=0x0) at /home/qt/work/build/qt-creator/src/plugins/coreplugin/editormanager/editormanager.cpp:787
       #24 0x00007fffe8fa2ab1 in Core::EditorManager::openEditor (fileName=..., editorId=..., editorId@entry=..., flags=..., flags@entry=..., newEditor=newEditor@entry=0x0) at /home/qt/work/build/qt-creator/src/plugins/coreplugin/editormanager/editormanager.cpp:2894
       #25 0x00007fffe8f61bc2 in Core::Internal::MainWindow::openFiles (this=this@entry=0xcbb300, fileNames=..., flags=flags@entry=Core::ICore::SwitchMode, workingDirectory=...) at /home/qt/work/build/qt-creator/src/plugins/coreplugin/mainwindow.cpp:880
       #26 0x00007fffe8f6200a in Core::Internal::MainWindow::openFile (this=0xcbb300) at /home/qt/work/build/qt-creator/src/plugins/coreplugin/mainwindow.cpp:825
       #27 0x00007ffff5a6ce80 in void doActivate<false>(QObject*, int, void**) () from /home/leroy/Qt/Tools/QtCreator/bin/../lib/Qt/lib/libQt5Core.so.5
       #28 0x00007ffff6fd5382 in QAction::triggered(bool) () from /home/leroy/Qt/Tools/QtCreator/bin/../lib/Qt/lib/libQt5Widgets.so.5
       #29 0x00007ffff5a6ce80 in void doActivate<false>(QObject*, int, void**) () from /home/leroy/Qt/Tools/QtCreator/bin/../lib/Qt/lib/libQt5Core.so.5
       #30 0x00007ffff6fd5382 in QAction::triggered(bool) () from /home/leroy/Qt/Tools/QtCreator/bin/../lib/Qt/lib/libQt5Widgets.so.5
       #31 0x00007ffff6fd77ae in QAction::activate(QAction::ActionEvent) () from /home/leroy/Qt/Tools/QtCreator/bin/../lib/Qt/lib/libQt5Widgets.so.5
       #32 0x00007ffff5a63cf3 in QObject::event(QEvent*) () from /home/leroy/Qt/Tools/QtCreator/bin/../lib/Qt/lib/libQt5Core.so.5
       #33 0x00007ffff6fd8091 in QAction::event(QEvent*) () from /home/leroy/Qt/Tools/QtCreator/bin/../lib/Qt/lib/libQt5Widgets.so.5
       #34 0x00007ffff6fdb13c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /home/leroy/Qt/Tools/QtCreator/bin/../lib/Qt/lib/libQt5Widgets.so.5
       #35 0x00007ffff6fe1d10 in QApplication::notify(QObject*, QEvent*) () from /home/leroy/Qt/Tools/QtCreator/bin/../lib/Qt/lib/libQt5Widgets.so.5
       #36 0x00007ffff5a348f8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /home/leroy/Qt/Tools/QtCreator/bin/../lib/Qt/lib/libQt5Core.so.5
       #37 0x00007ffff5a37962 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /home/leroy/Qt/Tools/QtCreator/bin/../lib/Qt/lib/libQt5Core.so.5
       #38 0x00007ffff5a90a83 in postEventSourceDispatch(_GSource*, int (void*), void*) () from /home/leroy/Qt/Tools/QtCreator/bin/../lib/Qt/lib/libQt5Core.so.5
       #39 0x00007ffff255443c in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
       #40 0x00007ffff25a21d9 in ?? () from /usr/lib/libglib-2.0.so.0
       #41 0x00007ffff2553221 in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
       #42 0x00007ffff5a9011c in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /home/leroy/Qt/Tools/QtCreator/bin/../lib/Qt/lib/libQt5Core.so.5
       #43 0x00007ffff5a3330a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /home/leroy/Qt/Tools/QtCreator/bin/../lib/Qt/lib/libQt5Core.so.5
       #44 0x00007ffff5a3c2b3 in QCoreApplication::exec() () from /home/leroy/Qt/Tools/QtCreator/bin/../lib/Qt/lib/libQt5Core.so.5
       #45 0x000000000040a853 in main (argc=<optimized out>, argv=<optimized out>) at /home/qt/work/build/qt-creator/src/app/main.cpp:740
       (gdb)
      

       

        Attachments

        For Gerrit Dashboard: QTCREATORBUG-24587
        # Subject Branch Project Status CR V

          Activity

            People

            Assignee:
            fawzi Fawzi Mohamed
            Reporter:
            leroy Haoyu Liu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes