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

qmlls crashes on autocompletion

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P1: Critical
    • 6.8.0 FF, 6.8
    • 6.8
    • QML: Tooling
    • None
    • Qt dev as of 2024-04-26
    • 13761ee3c (dev)

    Description

      Trying to get autocompletion results crashes qmlls.

      import QtQuick
      Text {
          text: "foo"
          rend // ... waiting for it to suggest "renderType"
      }
      

      Instead, it crashes. Other checks, such as unused imports, find references, work.

      Thread 1 "qmlls" received signal SIGSEGV, Segmentation fault.
      doFilter<QQmlJSResourceFileMapper::entry(const Filter&) const::<lambda(const QQmlJSResourceFileMapper::Entry&)> > (handler=..., filter=..., qrcPathToFileSystemPath=...) at /home/kaiuwe/kde6/src/qtdeclarative/src/qmlcompiler/qqmljsresourcefilemapper.cpp:120
      120             } else if (it->filePath == filter.path && handler(*it)) {
      (gdb) bt
      #0  doFilter<QQmlJSResourceFileMapper::entry(const Filter&) const::<lambda(const QQmlJSResourceFileMapper::Entry&)> > (handler=..., filter=..., qrcPathToFileSystemPath=...)
          at /home/kaiuwe/kde6/src/qtdeclarative/src/qmlcompiler/qqmljsresourcefilemapper.cpp:120
      #1  QQmlJSResourceFileMapper::entry (this=this@entry=0x7f7ca0007320, filter=...) at /home/kaiuwe/kde6/src/qtdeclarative/src/qmlcompiler/qqmljsresourcefilemapper.cpp:163
      #2  0x00007f7caec5d7cb in QQmlJSImportVisitor::implicitImportDirectory (localFile=..., mapper=0x7f7ca0007320) at /home/kaiuwe/kde6/src/qtdeclarative/src/qmlcompiler/qqmljsimportvisitor.cpp:372
      #3  0x00007f7caed0bac0 in QQmlJSTypeReader::operator() (this=this@entry=0x7ffdc14e1820, scope=...) at /home/kaiuwe/kde6/src/qtdeclarative/src/qmlcompiler/qqmljstypereader.cpp:58
      #4  0x00007f7caeccda24 in QDeferredFactory<QQmlJSScope>::populate (this=this@entry=0x7ffdc14e18c0, scope=...) at /home/kaiuwe/kde6/src/qtdeclarative/src/qmlcompiler/qqmljsscope.cpp:1150
      #5  0x000055a084256643 in QDeferredSharedPointer<QQmlJSScope const>::lazyLoad (this=this@entry=0x7f7ca09c8d98) at /home/kaiuwe/kde6/src/qtdeclarative/src/qmlcompiler/qdeferredpointer_p.h:166
      #6  0x000055a08425ff48 in QDeferredSharedPointer<QQmlJSScope const>::operator QSharedPointer<QQmlJSScope const> (this=0x7f7ca09c8d98)
          at /home/kaiuwe/kde6/src/qtdeclarative/src/qmlcompiler/qdeferredpointer_p.h:71
      #7  QDeferredSharedPointer<QQmlJSScope const>::data (this=0x7f7ca09c8d98) at /home/kaiuwe/kde6/src/qtdeclarative/src/qmlcompiler/qdeferredpointer_p.h:88
      #8  QQmlJS::Dom::QmlFile::ensurePopulated (this=0x7f7ca09c8cf0) at /home/kaiuwe/kde6/src/qtdeclarative/src/qmldom/qqmldomexternalitems_p.h:467
      #9  QQmlJS::Dom::QmlFile::ensurePopulated (this=0x7f7ca09c8cf0) at /home/kaiuwe/kde6/src/qtdeclarative/src/qmldom/qqmldomexternalitems_p.h:457
      #10 0x000055a084432e79 in QQmlJS::Dom::QmlFile::lazyMembers (this=<optimized out>) at /home/kaiuwe/kde6/src/qtdeclarative/src/qmldom/qqmldomexternalitems_p.h:472
      #11 QQmlJS::Dom::QmlFile::fileLocationsTree (this=<optimized out>) at /home/kaiuwe/kde6/src/qtdeclarative/src/qmldom/qqmldomexternalitems_p.h:398
      #12 QQmlJS::Dom::QQmlDomAstCreator::QQmlDomAstCreator (this=0x55a085aa46e0, qmlFile=...) at /home/kaiuwe/kde6/src/qtdeclarative/src/qmldom/qqmldomastcreator.cpp:321
      #13 0x000055a0844330c9 in QQmlJS::Dom::QQmlDomAstCreatorWithQQmlJSScope::QQmlDomAstCreatorWithQQmlJSScope (this=this@entry=0x55a085aa43d0, current=..., qmlFile=..., 
          logger=logger@entry=0x7ffdc14e1ad0, importer=importer@entry=0x7f7c9c006c40) at /home/kaiuwe/kde6/src/qtdeclarative/src/qmldom/qqmldomastcreator.cpp:2922
      #14 0x000055a0843e2ca4 in std::make_unique<QQmlJS::Dom::QQmlDomAstCreatorWithQQmlJSScope, QDeferredSharedPointer<QQmlJSScope>&, QQmlJS::Dom::MutableDomItem&, QQmlJSLogger*, QQmlJSImporter*> ()
          at /usr/include/c++/12/bits/unique_ptr.h:1064
      #15 QQmlJS::Dom::DomEnvironment::populateFromQmlFile (this=0x55a085a57610, qmlFile=...) at /home/kaiuwe/kde6/src/qtdeclarative/src/qmldom/qqmldomtop.cpp:2193
      #16 0x000055a0843e495b in operator() (__closure=<optimized out>, p=..., importer=<optimized out>, rootNode=<optimized out>) at /home/kaiuwe/kde6/src/qtdeclarative/src/qmldom/qqmldomtop.cpp:1863
      #17 0x00007f7caec45159 in std::function<void (QQmlJS::AST::Node*, QQmlJSImporter*, QQmlJSImporter::ImportVisitorPrerequisites const&)>::operator()(QQmlJS::AST::Node*, QQmlJSImporter*, QQmlJSImporter::ImportVisitorPrerequisites const&) const (__args#2=..., __args#1=<optimized out>, __args#0=<optimized out>, this=<optimized out>) at /usr/include/c++/12/bits/std_function.h:591
      #18 QQmlJSImporter::runImportVisitor (this=<optimized out>, rootNode=rootNode@entry=0x55a085aa14d0, p=...) at /home/kaiuwe/kde6/src/qtdeclarative/src/qmlcompiler/qqmljsimporter.cpp:956
      #19 0x00007f7caed0bb5d in QQmlJSTypeReader::operator() (this=this@entry=0x7ffdc14e2770, scope=...) at /home/kaiuwe/kde6/src/qtdeclarative/src/qmlcompiler/qqmljstypereader.cpp:55
      #20 0x00007f7caeccda24 in QDeferredFactory<QQmlJSScope>::populate (this=this@entry=0x7ffdc14e2810, scope=...) at /home/kaiuwe/kde6/src/qtdeclarative/src/qmlcompiler/qqmljsscope.cpp:1150
      #21 0x000055a08428897a in QDeferredSharedPointer<QQmlJSScope const>::lazyLoad (this=<optimized out>) at /home/kaiuwe/kde6/src/qtdeclarative/src/qmlcompiler/qdeferredpointer_p.h:166
      #22 QDeferredSharedPointer<QQmlJSScope const>::operator QSharedPointer<QQmlJSScope const> (this=<optimized out>) at /home/kaiuwe/kde6/src/qtdeclarative/src/qmlcompiler/qdeferredpointer_p.h:71
      #23 QDeferredSharedPointer<QQmlJSScope const>::operator-> (this=0x7f7c9c12b178) at /home/kaiuwe/kde6/src/qtdeclarative/src/qmlcompiler/qdeferredpointer_p.h:78
      #24 0x000055a0842ab558 in testScopeSymbol (kind=QLspSpecification::CompletionItemKind::Class, options=..., scope=...) at /home/kaiuwe/kde6/src/qtdeclarative/src/qmlls/qqmllscompletion.cpp:265
      #25 QQmlLSCompletion::suggestReachableTypes (this=<optimized out>, el=..., options=..., kind=QLspSpecification::CompletionItemKind::Class, it=...)
          at /home/kaiuwe/kde6/src/qtdeclarative/src/qmlls/qqmllscompletion.cpp:310
      #26 0x000055a0842ab7de in QQmlLSCompletion::suggestBindingCompletion (this=this@entry=0x7ffdc14e4860, itemAtPosition=..., it=it@entry=...)
          at /home/kaiuwe/kde6/src/qtdeclarative/src/qmlls/qqmllscompletion.cpp:143
      #27 0x000055a0842af3f4 in QQmlLSCompletion::insideBindingCompletion (this=this@entry=0x7ffdc14e4860, currentItem=..., positionInfo=..., result=result@entry=...)
          at /home/kaiuwe/kde6/src/qtdeclarative/src/qmlls/qqmllscompletion.cpp:849
      #28 0x000055a0842afca9 in QQmlLSCompletion::collectCompletions (this=0x7ffdc14e4860, currentItem=..., contextStrings=..., result=result@entry=...)
          at /home/kaiuwe/kde6/src/qtdeclarative/src/qmlls/qqmllscompletion.cpp:1700
      #29 0x000055a0842afff8 in QQmlLSCompletion::completions (this=<optimized out>, currentItem=..., contextStrings=...) at /home/kaiuwe/kde6/src/qtdeclarative/src/qmlls/qqmllscompletion.cpp:1643
      #30 0x000055a084243248 in CompletionRequest::completions (this=<optimized out>, doc=..., completionEngine=...) at /home/kaiuwe/kde6/src/qtdeclarative/src/qmlls/qqmlcompletionsupport.cpp:192
      --Type <RET> for more, q to quit, c to continue without paging--
      #31 0x000055a084243d87 in QmlCompletionSupport::process (this=0x7ffdc14e4808, req=...) at /home/kaiuwe/kde6/src/qtdeclarative/src/qmlls/qqmlcompletionsupport.cpp:76
      #32 0x000055a0842455e1 in QQmlBaseModule<CompletionRequest>::updatedSnapshot (this=0x7ffdc14e4808, url=...) at /home/kaiuwe/kde6/src/qtdeclarative/src/qmlls/qqmlbasemodule_p.h:226
      #33 0x00007f7cae0a66c9 in QObject::event (this=0x7ffdc14e4808, e=0x7f7ca14c9c80) at /home/kaiuwe/kde6/src/qtbase/src/corelib/kernel/qobject.cpp:1419
      #34 0x00007f7cae0518e5 in doNotify (event=<optimized out>, receiver=<optimized out>) at /home/kaiuwe/kde6/src/qtbase/src/corelib/kernel/qcoreapplication.cpp:1246
      #35 QCoreApplication::notify (event=<optimized out>, receiver=<optimized out>, this=<optimized out>) at /home/kaiuwe/kde6/src/qtbase/src/corelib/kernel/qcoreapplication.cpp:1229
      #36 QCoreApplication::notifyInternal2 (receiver=0x7ffdc14e4808, event=0x7f7ca14c9c80) at /home/kaiuwe/kde6/src/qtbase/src/corelib/kernel/qcoreapplication.cpp:1145
      #37 0x00007f7cae0552a3 in QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x55a085a54470) at /home/kaiuwe/kde6/src/qtbase/src/corelib/kernel/qcoreapplication.cpp:1944
      #38 0x00007f7cae3326f7 in postEventSourceDispatch (s=0x55a085a59520) at /home/kaiuwe/kde6/src/qtbase/src/corelib/kernel/qeventdispatcher_glib.cpp:245
      #39 0x00007f7cad080d3b in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
      #40 0x00007f7cad0d6258 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
      #41 0x00007f7cad07e3e3 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
      #42 0x00007f7cae331e40 in QEventDispatcherGlib::processEvents (this=0x55a085a568e0, flags=...) at /home/kaiuwe/kde6/src/qtbase/src/corelib/kernel/qeventdispatcher_glib.cpp:395
      #43 0x00007f7cae05dee2 in QEventLoop::exec (this=this@entry=0x7ffdc14e4210, flags=..., flags@entry=...) at /home/kaiuwe/kde6/src/qtbase/src/corelib/global/qflags.h:34
      #44 0x00007f7cae059af4 in QCoreApplication::exec () at /home/kaiuwe/kde6/src/qtbase/src/corelib/global/qflags.h:74
      #45 0x000055a0842043d7 in main (argv=<optimized out>, argc=<optimized out>) at /home/kaiuwe/kde6/src/qtdeclarative/tools/qmlls/qmllanguageservertool.cpp:311
      

      Attachments

        Issue Links

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

          Activity

            People

              sami.shalayel Sami Shalayel
              broulik Kai Uwe Broulik
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes