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

Crash when trying to build QML files (qmlcachegen)

    XMLWordPrintable

Details

    • Linux/Wayland
    • 0d1462b3a (dev), 8f7ee940d (6.7), 2a8eb5a35 (tqtc/lts-6.5)

    Description

      It happens reproduceably when I try to build plasma-mobile. I've had this issue before, today I refreshed my Qt before reporting to make sure it's still an issue:
      https://invent.kde.org/plasma/plasma-mobile

      This is one of the files that trigger this crash:
      plasma-mobile/components/mobileshell/qml/widgets/notifications/NotificationItem.qml

      {{
      (gdb) where
      #0 __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
      #1 0x00007a61500ab393 in __pthread_kill_internal (signo=6, threadid=<optimized out>) at pthread_kill.c:78
      #2 0x00007a615005a6c8 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
      #3 0x00007a61500424b8 in __GI_abort () at abort.c:79
      #4 0x00007a6150a31279 in qAbort () at /home/apol/devel/frameworks6/qt6/qtbase/src/corelib/global/qglobal.cpp:161
      #5 0x00007a6150a41f18 in qt_message_fatal<QString&> (context=..., message=...) at /home/apol/devel/frameworks6/qt6/qtbase/src/corelib/global/qlogging.cpp:2060
      #6 0x00007a6150a3c1a5 in qt_message (msgType=QtFatalMsg, context=..., msg=0x7a61509d01fd <.L.str> "ASSERT: \"%s\" in file %s, line %d", ap=0x7ffc9571da60) at /home/apol/devel/frameworks6/qt6/qtbase/src/corelib/global/qlogging.cpp:374
      #7 0x00007a6150a3d7f8 in QMessageLogger::fatal (this=0x7ffc9571daa8, msg=0x7a61509d01fd <.L.str> "ASSERT: \"%s\" in file %s, line %d") at /home/apol/devel/frameworks6/qt6/qtbase/src/corelib/global/qlogging.cpp:897
      #8 0x00007a6150a2f10a in qt_assert (assertion=0x7a6152321ff0 <.L.str.196> "m_state.accumulatorOut().isProperty()", file=0x7a6152320787 <.L.str.32> "/home/apol/devel/frameworks6/qt6/qtdeclarative/src/qmlcompiler/qqmljscodegenerator.cpp", line=1312)
      at /home/apol/devel/frameworks6/qt6/qtbase/src/corelib/global/qassert.cpp:68
      #9 0x00007a615239a129 in QQmlJSCodeGenerator::generate_GetLookupHelper (this=0x7ffc957228a8, index=68) at /home/apol/devel/frameworks6/qt6/qtdeclarative/src/qmlcompiler/qqmljscodegenerator.cpp:1312
      #10 0x00007a615239984c in QQmlJSCodeGenerator::generate_GetLookup (this=0x7ffc957228a8, index=68) at /home/apol/devel/frameworks6/qt6/qtdeclarative/src/qmlcompiler/qqmljscodegenerator.cpp:1238
      #11 0x00007a6151a46cbe in QV4::Moth::ByteCodeHandler::decode (this=0x7ffc957228a8, code=0x587ee87d7c04 "\030\a.E\030\n\254F\a\001\n\030\006\002", len=18) at /home/apol/devel/frameworks6/qt6/qtdeclarative/src/qml/compiler/qv4bytecodehandler.cpp:41
      #12 0x00007a6152385c49 in QQmlJSCodeGenerator::run (this=0x7ffc957228a8, function=0x7ffc95723418, annotations=0x7ffc95722790, error=0x7ffc957234c8, basicBlocksValidationFailed=false)
      at /home/apol/devel/frameworks6/qt6/qtdeclarative/src/qmlcompiler/qqmljscodegenerator.cpp:153
      #13 0x00007a61523f4722 in QQmlJSAotCompiler::doCompile (this=0x7ffc957255e8, context=0x587ee87f3980, function=0x7ffc95723418, error=0x7ffc957234c8) at /home/apol/devel/frameworks6/qt6/qtdeclarative/src/qmlcompiler/qqmljscompiler.cpp:801
      #14 0x00007a61523f40de in QQmlJSAotCompiler::compileBinding (this=0x7ffc957255e8, context=0x587ee87f3980, irBinding=..., astNode=0x587ee761d748) at /home/apol/devel/frameworks6/qt6/qtdeclarative/src/qmlcompiler/qqmljscompiler.cpp:707
      #15 0x00007a61523f5d60 in qCompileQmlFile(QmlIR::Document&, QString const&, std::function<bool (QV4::CompiledData::SaveableUnitPointer const&, QMap<int, QQmlJSAotFunction> const&, QString*)>, QQmlJSAotCompiler*, QQmlJSCompileError*, bool, QV4::Compiler::CodegenWarningInterface*, QString const*)::$_0::operator()(BindingOrFunction const&) const (this=0x7ffc95723a20, bindingOrFunction=...) at /home/apol/devel/frameworks6/qt6/qtdeclarative/src/qmlcompiler/qqmljscompiler.cpp:327
      #16 0x00007a61523f17bc in std::for_each<_gnu_cxx::normal_iterator<BindingOrFunction*, std::vector<BindingOrFunction, std::allocator<BindingOrFunction> > >, qCompileQmlFile(QmlIR::Document&, QString const&, std::function<bool (QV4::CompiledData::SaveableUnitPointer const&, QMap<int, QQmlJSAotFunction> const&, QString*)>, QQmlJSAotCompiler*, QQmlJSCompileError*, bool, QV4::Compiler::CodegenWarningInterface*, QString const*)::$_0>(gnu_cxx::normal_iterator<BindingOrFunction*, std::vector<BindingOrFunction, std::allocator<BindingOrFunction> > >, __gnu_cxx::normal_iterator<BindingOrFunction*, std::vector<BindingOrFunction, std::allocator<BindingOrFunction> > >, qCompileQmlFile(QmlIR::Document&, QString const&, std::function<bool (QV4::CompiledData::SaveableUnitPointer const&, QMap<int, QQmlJSAotFunction> const&, QString*)>, QQmlJSAotCompiler*, QQmlJSCompileError*, bool, QV4::Compiler::CodegenWarningInterface*, QString const*)::$_0) (_first=..., __last=..., __f=...)
      at /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/13.2.1/../../../../include/c++/13.2.1/bits/stl_algo.h:3833
      #17 0x00007a61523f0f2a in qCompileQmlFile(QmlIR::Document&, QString const&, std::function<bool (QV4::CompiledData::SaveableUnitPointer const&, QMap<int, QQmlJSAotFunction> const&, QString*)>, QQmlJSAotCompiler*, QQmlJSCompileError*, bool, QV4::Compiler::CodegenWarningInterface*, QString const*) (irDocument=..., inputFileName=..., saveFunction=..., aotCompiler=0x7ffc957255e8, error=0x7ffc95724b70, storeSourceLocation=true, interface=0x587ee6a7b2d8 <QV4::Compiler::defaultCodegenWarningInterface()::iface>, fileContents=0x0)
      at /home/apol/devel/frameworks6/qt6/qtdeclarative/src/qmlcompiler/qqmljscompiler.cpp:270
      #18 0x00007a61523f0570 in qCompileQmlFile(QString const&, std::function<bool (QV4::CompiledData::SaveableUnitPointer const&, QMap<int, QQmlJSAotFunction> const&, QString*)>, QQmlJSAotCompiler*, QQmlJSCompileError*, bool, QV4::Compiler::CodegenWarningInterface*, QString const*) (inputFileName=..., saveFunction=..., aotCompiler=0x7ffc957255e8, error=0x7ffc95724b70, storeSourceLocation=true, interface=0x587ee6a7b2d8 <QV4::Compiler::defaultCodegenWarningInterface()::iface>, fileContents=0x0)
      at /home/apol/devel/frameworks6/qt6/qtdeclarative/src/qmlcompiler/qqmljscompiler.cpp:186
      #19 0x0000587ee6a6063e in main (argc=151, argv=0x7ffc95725e48) at /home/apol/devel/frameworks6/qt6/qtdeclarative/tools/qmlcachegen/qmlcachegen.cpp:259
      (gdb)
      }}


      I've spent some more time trying to debug this issue and it seems like the problem is when linking js code from a qml unit.

      So given the following command:

      /home/apol/devel/kde6/libexec/qmlcachegen -i /home/apol/build-devel/frameworks6/plasma-mobile/components/mobileshell/qmldir --resource /home/apol/build-devel/frameworks6/plasma-mobile/components/mobileshell/.rcc/qmake_org_kde_plasma_private_mobileshell.qrc --resource /home/apol/build-devel/frameworks6/plasma-mobile/components/mobileshell/.rcc/mobileshellplugin_raw_qml_0.qrc -o /home/apol/build-devel/frameworks6/plasma-mobile/components/mobileshell/.rcc/qmlcache/mobileshellplugin_qml/widgets/notifications/NotificationItem_qml.cpp /home/apol/devel/frameworks6/plasma-mobile/components/mobileshell/qml/widgets/notifications/NotificationItem.qml

      We see that the qmldir file has a NotificationsUtils.js file.

      If I open NotificationsItem.qml and comment out the NotificationsUtils.somethingCall(), it doesn't crash.
      If I modify the project not to include NotificationsUtils.js in the qt6_target_qml_sources() call, it builds successfully.

      I understand that if qt6_target_qml_sources() accepts js files it's that it's supposed to work.

      I do not know why it seems to work for others.

      If you give me some kind of patch I can easily test it.

      Attachments

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

        Activity

          People

            ulherman Ulf Hermann
            apol Aleix Pol
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes