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

qmlcachegen crashing with Qt 6.7.0-rc2

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P1: Critical
    • 6.7.1, 6.7, 6.8.0 FF
    • 6.7.0 RC2
    • QML: Tooling
    • None
    • macOS 14.4 (23E214)
      Apple M2 Pro
    • macOS, Windows
    • f47df45b4 (dev), cb6b62f4e (6.7)

    Description

      qmlcachegen crashes for one of our QML files on both macOS and Windows with the following backtrace:

      * thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0xd0)
        * frame #0: 0x0000000100855854 QtQmlCompiler`QQmlJSCodeGenerator::registerVariable(int) const [inlined] QArrayDataPointer<char16_t>::QArrayDataPointer(this=0x000000016fdfbd98, other=0x00000000000000d0) at qarraydatapointer.h:38:19 [opt]
          frame #1: 0x0000000100855854 QtQmlCompiler`QQmlJSCodeGenerator::registerVariable(int) const [inlined] QArrayDataPointer<char16_t>::QArrayDataPointer(this=0x000000016fdfbd98, other=0x00000000000000d0) at qarraydatapointer.h:39:5 [opt]
          frame #2: 0x0000000100855854 QtQmlCompiler`QQmlJSCodeGenerator::registerVariable(int) const [inlined] QString::QString(this=0x000000016fdfbd98, other=0x00000000000000d0) at qstring.h:1186:51 [opt]
          frame #3: 0x0000000100855854 QtQmlCompiler`QQmlJSCodeGenerator::registerVariable(int) const [inlined] QString::QString(this=0x000000016fdfbd98, other=0x00000000000000d0) at qstring.h:1187:1 [opt]
          frame #4: 0x0000000100855854 QtQmlCompiler`QQmlJSCodeGenerator::registerVariable(int) const [inlined] QQmlJSScope::internalName(this=0x0000000000000000) const at qqmljsscope_p.h:254:43 [opt]
          frame #5: 0x0000000100855854 QtQmlCompiler`QQmlJSCodeGenerator::registerVariable(this=0x000000016fdfcb48, index=17) const at qqmljscodegenerator.cpp:3669:31 [opt]
          frame #6: 0x000000010084fb34 QtQmlCompiler`QQmlJSCodeGenerator::consumedRegisterVariable(this=0x000000016fdfcb48, index=17) const at qqmljscodegenerator.cpp:3690:25 [opt]
          frame #7: 0x0000000100871658 QtQmlCompiler`QQmlJSCodeGenerator::generate_DefineObjectLiteral(this=0x000000016fdfcb48, internalClassId=0, argc=9, args=7) at qqmljscodegenerator.cpp:2577:31 [opt]
          frame #8: 0x0000000101366c68 QtQml`QV4::Moth::ByteCodeHandler::decode(this=0x000000016fdfcb48, code="\U00000018\U00000006\U00000002", len=<unavailable>) at qv4bytecodehandler.cpp:41:9 [opt]
          frame #9: 0x0000000100843a44 QtQmlCompiler`QQmlJSCodeGenerator::run(this=0x000000016fdfcb48, function=0x000000016fdfd738, annotations=0x000000016fdfd1b8, error=<unavailable>, basicBlocksValidationFailed=false) at qqmljscodegenerator.cpp:153:5 [opt]
          frame #10: 0x00000001008906a0 QtQmlCompiler`QQmlJSAotCompiler::doCompile(this=0x000000016fdfe490, context=0x00000001486dd450, function=0x000000016fdfd738, error=0x000000016fdfd800) at qqmljscompiler.cpp:801:40 [opt]
          frame #11: 0x000000010088fd9c QtQmlCompiler`QQmlJSAotCompiler::compileBinding(this=<unavailable>, context=<unavailable>, irBinding=<unavailable>, astNode=<unavailable>) at qqmljscompiler.cpp:707:43 [opt]
          frame #12: 0x000000010088c3c8 QtQmlCompiler`qCompileQmlFile(QmlIR::Document&, QString const&, std::__1::function<bool (QV4::CompiledData::SaveableUnitPointer const&, QMap<int, QQmlJSAotFunction> const&, QString*)>, QQmlJSAotCompiler*, QQmlJSCompileError*, bool, QV4::Compiler::CodegenWarningInterface*, QString const*) at qqmljscompiler.cpp:327:43 [opt]
          frame #13: 0x000000010088bc00 QtQmlCompiler`qCompileQmlFile(QmlIR::Document&, QString const&, std::__1::function<bool (QV4::CompiledData::SaveableUnitPointer const&, QMap<int, QQmlJSAotFunction> const&, QString*)>, QQmlJSAotCompiler*, QQmlJSCompileError*, bool, QV4::Compiler::CodegenWarningInterface*, QString const*) [inlined] qCompileQmlFile(QmlIR::Document&, QString const&, std::__1::function<bool (QV4::CompiledData::SaveableUnitPointer const&, QMap<int, QQmlJSAotFunction> const&, QString*)>, QQmlJSAotCompiler*, QQmlJSCompileError*, bool, QV4::Compiler::CodegenWarningInterface*, QString const*)::$_0 std::__1::for_each<std::__1::__wrap_iter<BindingOrFunction*>, qCompileQmlFile(QmlIR::Document&, QString const&, std::__1::function<bool (QV4::CompiledData::SaveableUnitPointer const&, QMap<int, QQmlJSAotFunction> const&, QString*)>, QQmlJSAotCompiler*, QQmlJSCompileError*, bool, QV4::Compiler::CodegenWarningInterface*, QString const*)::$_0>(__first=__wrap_iter<BindingOrFunction *> @ scalar, __last=__wrap_iter<BindingOrFunction *> @ scalar, __f=(unnamed class) @ 0x00006000037b8080) at for_each.h:29:5 [opt]
          frame #14: 0x000000010088bbf4 QtQmlCompiler`qCompileQmlFile(irDocument=0x000000016fdfdc50, inputFileName=<unavailable>, saveFunction=QQmlJSSaveFunction @ 0x000000016fdfdfb8, aotCompiler=0x000000016fdfe490, error=<unavailable>, storeSourceLocation=false, interface=<unavailable>, fileContents=0x0000000000000000) at qqmljscompiler.cpp:270:13 [opt]
          frame #15: 0x000000010088b16c QtQmlCompiler`qCompileQmlFile(inputFileName=0x000000016fdfe358, saveFunction=QQmlJSSaveFunction @ 0x000000016fdfe470, aotCompiler=0x000000016fdfe490, error=0x000000016fdfe2f8, storeSourceLocation=true, interface=0x00000001000142c0, fileContents=0x0000000000000000) at qqmljscompiler.cpp:186:12 [opt]
          frame #16: 0x0000000100008f8c qmlcachegen`main(argc=17, argv=<unavailable>) at qmlcachegen.cpp:259:18 [opt]
          frame #17: 0x0000000194e6e0e0 dyld`start + 2360
      

      The same project builds fine with Qt 6.5 and 6.6.

      The issue is reproducible by adding the following line to a QML file:

      property var x: { "1": null }

      The issue seems to be using a number for the property name: changing "1" to e.g. "a" makes the crash go away.

      Attachments

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

        Activity

          People

            ulherman Ulf Hermann
            fseiffert Frederik Seiffert
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes