Details
-
Bug
-
Resolution: Fixed
-
P1: Critical
-
6.5
-
None
-
-
8190f5bd6 (dev), 6049b22c9 (6.6), e8470c0b3 (tqtc/lts-6.5)
Description
QmlCacheGen simply segfaulted. We first extracted the command with `ninja -t commands`, then executed it in GDB to see where it crashed. The following is the backtrace
#0 0x00007ffff7d5b540 in QQmlJSScope::accessSemantics (this=0x0) at /home/user/vcpkg-clone/buildtrees/qtdeclarative/x64-linux-dynamic-dbg/include/QtQmlCompiler/6.5.3/QtQmlCompiler/private/../../../../../../src/here-src-6-916c66c7af.clean/src/qmlcompiler/qqmljsscope_p.h:567 #1 0x00007ffff7d56cd8 in QQmlJSCodeGenerator::conversion (this=0x7fffffffb880, from=..., to=..., variable=...) at /home/user/vcpkg-clone/buildtrees/qtdeclarative/src/here-src-6-916c66c7af.clean/src/qmlcompiler/qqmljscodegenerator.cpp:2958 #2 0x00007ffff7d38a41 in QQmlJSCodeGenerator::generate_MoveConst (this=0x7fffffffb880, constIndex=6, destTemp=7) at /home/user/vcpkg-clone/buildtrees/qtdeclarative/src/here-src-6-916c66c7af.clean/src/qmlcompiler/qqmljscodegenerator.cpp:452 #3 0x00007ffff749cc62 in QV4::Moth::ByteCodeHandler::decode (this=0x7fffffffb880, code=0x5555562bfff3 "\022r\030\b\022h\030\t\022s\030\n\350\004\a\030\006\002", len=21) at /home/user/vcpkg-clone/buildtrees/qtdeclarative/src/here-src-6-916c66c7af.clean/src/qml/compiler/qv4bytecodehandler.cpp:41 #4 0x00007ffff7d351a3 in QQmlJSCodeGenerator::run (this=0x7fffffffb880, function=0x7fffffffc3d0, annotations=0x7fffffffbe20, error=0x7fffffffc4a0) at /home/user/vcpkg-clone/buildtrees/qtdeclarative/src/here-src-6-916c66c7af.clean/src/qmlcompiler/qqmljscodegenerator.cpp:142 #5 0x00007ffff7d74d3c in QQmlJSAotCompiler::doCompile (this=0x7fffffffdab0, context=0x5555556c0850, function=0x7fffffffc3d0, error=0x7fffffffc4a0) at /home/user/vcpkg-clone/buildtrees/qtdeclarative/src/here-src-6-916c66c7af.clean/src/qmlcompiler/qqmljscompiler.cpp:798 #6 0x00007ffff7d7410f in QQmlJSAotCompiler::compileBinding (this=0x7fffffffdab0, context=0x5555556c0850, irBinding=..., astNode=0x5555555dd1c8) at /home/user/vcpkg-clone/buildtrees/qtdeclarative/src/here-src-6-916c66c7af.clean/src/qmlcompiler/qqmljscompiler.cpp:707 #7 0x00007ffff7d70b17 in operator() (__closure=0x7fffffffcaa0, bindingOrFunction=...) at /home/user/vcpkg-clone/buildtrees/qtdeclarative/src/here-src-6-916c66c7af.clean/src/qmlcompiler/qqmljscompiler.cpp:327 #8 0x00007ffff7d74ef7 in std::for_each<__gnu_cxx::__normal_iterator<BindingOrFunction*, std::vector<BindingOrFunction> >, qCompileQmlFile(QmlIR::Document&, const QString&, QQmlJSSaveFunction, QQmlJSAotCompiler*, QQmlJSCompileError*, bool, QV4::Compiler::CodegenWarningInterface*, const QString*)::<lambda(const BindingOrFunction&)> >(__gnu_cxx::__normal_iterator<BindingOrFunction*, std::vector<BindingOrFunction, std::alloca tor<BindingOrFunction> > >, __gnu_cxx::__normal_iterator<BindingOrFunction*, std::vector<BindingOrFunction, std::allocator<BindingOrFunction> > >, struct {...}) (__first=..., __last=..., __f=...) at /usr/include/c++/10/bits/stl_algo.h:3839 #9 0x00007ffff7d71a4c in qCompileQmlFile(QmlIR::Document&, QString const&, std::function<bool (QV4::CompiledData::SaveableUnitPointer const&, QMap<int, QQmlJSAotFunction> const&, QString*)>, QQmlJSAotCompiler*, Q QmlJSCompileError*, bool, QV4::Compiler::CodegenWarningInterface*, QString const*) (irDocument=..., inputFileName=..., saveFunction=..., aotCompiler=0x7fffffffdab0, error=0x7fffffffd710, storeSourceLocation=true, interface=0x555555567a38 <QV4::Compiler::defaultCodegenWarningInterface()::iface>, fileContents=0x0) at /home/user/vcpkg-clone/buildtrees/qtdeclarative/src/here-src-6-916c66c7af.clean/src/qmlcompiler/qqmljscompiler.cpp:351
Inspecting the astNode, we found that we had a syntax error here:
property var settings: [/*"Sensor"*/,"Scale","Utrms","Delay"]
Moving the comma into the commentary fixes it. Since a major motivation for cachegen is to get syntax-checking at buildtime, this should not crash at all, but give a clear diagnostic.
Please ask if we need to provide any more information beyond the above backtrace.
Attachments
For Gerrit Dashboard: QTBUG-119091 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
519274,2 | QmlCompiler: When rejecting empty constants, don't crash afterwards | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
519586,2 | QmlCompiler: When rejecting empty constants, don't crash afterwards | 6.6 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
519595,2 | QmlCompiler: When rejecting empty constants, don't crash afterwards | tqtc/lts-6.5 | qt/tqtc-qtdeclarative | Status: MERGED | +2 | 0 |