-
Bug
-
Resolution: Fixed
-
P1: Critical
-
6.7.0 Beta1
-
None
-
49ea766c8 (dev), 1a2faa748 (6.7), be481412c (dev), 4f873815a (6.7)
The following example crashes qmlsc:
import QtQuick import QtQuick.Controls.Basic import QtQuick.Window Window { width: 640 height: 480 visible: true title: qsTr("Hello World") Control { id: root contentItem: Item { id: remaining function foo() { let remainingTime = 123 if (remainingTime < 0) { remainingTime += 24 * 60 * 60 } remaining.bar = isNaN(remainingTime) ? 0 : remainingTime } property int bar: 0 } } }
From the stacktrace point of view, there seems to be some kind of loop in qqmljscodegenerator.cpp 3756/4104:
#0 0x00007f01a2c20c75 in QQmlJSUtils::searchBaseAndExtensionTypes<QDeferredSharedPointer<const QQmlJSScope>, QQmlJSTypeResolver::canHold(const ConstPtr&, const ConstPtr&) const::<lambda(const ConstPtr&)> >(QDeferredSharedPointer<QQmlJSScope const>, const struct {...} &) (type=..., check=...) at /home/qt/work/qt/qtdeclarative/src/qmlcompiler/qqmljsutils_p.h:203
#1 0x00007f01a2c23fd2 in QQmlJSTypeResolver::canHold (this=0x7fff0c2ab6c0, container=..., contained=...) at /home/qt/work/qt/qtdeclarative/src/qmlcompiler/qqmljstyperesolver.cpp:817
#2 0x00007f01a2c24067 in QQmlJSTypeResolver::canPopulate (this=0x7fff0c2ab6c0, type=..., passedArgumentType=..., isExtension=isExtension@entry=0x7fff0baaef57)
at /home/qt/work/qt/qtdeclarative/src/qmlcompiler/qqmljstyperesolver.cpp:1131
#3 0x00007f01a2b0d8f9 in QQmlJSCodeGenerator::convertContained (this=this@entry=0x7fff0c2aa000, from=..., to=..., variable=...) at /home/qt/work/qt/qtdeclarative/src/qmlcompiler/qqmljscodegenerator.cpp:4060
#4 0x00007f01a2b1d5d8 in QQmlJSCodeGenerator::conversion (this=this@entry=0x7fff0c2aa000, from=..., to=..., variable=...) at /home/qt/work/qt/qtdeclarative/src/qmlcompiler/qqmljscodegenerator.cpp:3756
#5 0x00007f01a2b0f451 in QQmlJSCodeGenerator::convertContained (this=this@entry=0x7fff0c2aa000, from=..., to=..., variable=...) at /home/qt/work/qt/qtdeclarative/src/qmlcompiler/qqmljscodegenerator.cpp:4104
#6 0x00007f01a2b1d5d8 in QQmlJSCodeGenerator::conversion (this=this@entry=0x7fff0c2aa000, from=..., to=..., variable=...) at /home/qt/work/qt/qtdeclarative/src/qmlcompiler/qqmljscodegenerator.cpp:3756
...
#6006 0x00007f01a2b1d5d8 in QQmlJSCodeGenerator::conversion (this=this@entry=0x7fff0c2aa000, from=..., to=..., variable=...) at /home/qt/work/qt/qtdeclarative/src/qmlcompiler/qqmljscodegenerator.cpp:3756
#6007 0x00007f01a2b0f451 in QQmlJSCodeGenerator::convertContained (this=this@entry=0x7fff0c2aa000, from=..., to=..., variable=...)
at /home/qt/work/qt/qtdeclarative/src/qmlcompiler/qqmljscodegenerator.cpp:4104
#6008 0x00007f01a2b1d5d8 in QQmlJSCodeGenerator::conversion (this=this@entry=0x7fff0c2aa000, from=..., to=..., variable=...) at /home/qt/work/qt/qtdeclarative/src/qmlcompiler/qqmljscodegenerator.cpp:3756
#6009 0x00007f01a2b0f3db in QQmlJSCodeGenerator::convertContained (this=this@entry=0x7fff0c2aa000, from=..., to=..., variable=...)
at /home/qt/work/qt/qtdeclarative_build/include/QtQmlCompiler/6.7.0/QtQmlCompiler/private/../../../../../../qtdeclarative/src/qmlcompiler/qqmljsregistercontent_p.h:206
#6010 0x00007f01a2b1d5d8 in QQmlJSCodeGenerator::conversion (this=this@entry=0x7fff0c2aa000, from=..., to=..., variable=...) at /home/qt/work/qt/qtdeclarative/src/qmlcompiler/qqmljscodegenerator.cpp:3756
#6011 0x00007f01a2b35406 in QQmlJSCodeGenerator::generate_SetLookup (this=0x7fff0c2aa000, index=<optimized out>, baseReg=8) at /home/qt/work/qt/qtdeclarative/src/qmlcompiler/qqmljscodegenerator.cpp:1479
#6012 0x00007f01a2530a11 in QV4::Moth::ByteCodeHandler::decode (this=this@entry=0x7fff0c2aa000, code=0x5587c9908d16 "\016\002", len=<optimized out>)
at /home/qt/work/qt/qtdeclarative/src/qml/compiler/qv4bytecodehandler.cpp:41
#6013 0x00007f01a2b38775 in QQmlJSCodeGenerator::run (this=0x7fff0c2aa000, function=0x7fff0c2aa8e0, annotations=<optimized out>, error=<optimized out>, basicBlocksValidationFailed=<optimized out>)
at /home/qt/work/qt/qtdeclarative/src/qmlcompiler/qqmljscodegenerator.cpp:153
#6014 0x00005587c8e26e1f in ?? ()
#6015 0x00005587c8e2000e in ?? ()
#6016 0x00005587c8e20c6c in ?? ()
#6017 0x00007f01a2b59f47 in operator() (bindingOrFunction=..., __closure=<synthetic pointer>) at /home/qt/work/qt/qtdeclarative/src/qmlcompiler/qqmljscompiler.cpp:338
#6018 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&)> > (__f=..., __last=..., __first=...)
at /opt/rh/gcc-toolset-10/root/usr/include/c++/10/bits/stl_algo.h:3844
#6019 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=aotCompiler@entry=0x7fff0c2ab6b0, error=error@entry=0x7fff0c2ab450,
--Type <RET> for more, q to quit, c to continue without paging--
storeSourceLocation=<optimized out>, interface=<optimized out>, fileContents=<optimized out>) at /home/qt/work/qt/qtdeclarative/src/qmlcompiler/qqmljscompiler.cpp:351
#6020 0x00007f01a2b5b466 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=0x7fff0c2ab6b0, error=0x7fff0c2ab450, storeSourceLocation=<optimized out>,
interface=0x5587c8e35490, fileContents=0x0) at /home/qt/work/qt/qtdeclarative/src/qmlcompiler/qqmljscompiler.cpp:186
#6021 0x00005587c8e187c6 in ?? ()
#6022 0x00007f01a15f5b8a in __libc_start_call_main () from /lib64/libc.so.6
#6023 0x00007f01a15f5c4b in __libc_start_main_impl () from /lib64/libc.so.6
#6024 0x00005587c8e18aee in ?? ()
.
| For Gerrit Dashboard: QTBUG-120322 | ||||||
|---|---|---|---|---|---|---|
| # | Subject | Branch | Project | Status | CR | V |
| 527148,2 | QmlCompiler: Return early after reject() | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
| 527220,4 | QmlCompiler: Allow primitive conversion if output is stored in var | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
| 527469,2 | QmlCompiler: Return early after reject() | 6.7 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
| 529624,4 | QmlCompiler: Allow primitive conversion if output is stored in var | 6.7 | qt/qtdeclarative | Status: MERGED | +2 | 0 |