[Interest] Qt 5 app on Qt 6 crashes

Andrei Golubev andrei.golubev at qt.io
Thu May 5 09:05:49 CEST 2022


Hello,

The crash looks bad. At a glance, I'd say that we never expect status to be nullptr.
Could you submit a bug report to bugreports.qt.io/ and provide us with a minimal reproducer?
Do I get this right that in Qt 5 there is no crash? It might be some issue with QML Script Compiler then working instead of qmlcachegen. If so, you could try to use old qmlcachegen and see if it helps. The docs [1] more or less describe the thing, see the section with QT_QMLCACHEGEN_EXECUTABLE to force the usage of qmlcachegen.

[1]: https://doc.qt.io/qt-6/qt-add-qml-module.html#caching-compiled-qml-sources

--
Best Regards,
Andrei
________________________________
From: Interest <interest-bounces at qt-project.org> on behalf of Александр Иваш <elderorb at gmail.com>
Sent: Saturday, April 30, 2022 3:06 PM
To: interestqt-project.org <interest at qt-project.org>
Subject: [Interest] Qt 5 app on Qt 6 crashes

I'm in the process of porting the Qt 5 QML app to Qt 6. After having
some fun with the QML namespaces difference finally I've got all the
issues resolved and.... it crashed during startup.

Crash happened inside qproperty.cpp:

CompatPropertySafePoint::CompatPropertySafePoint(QBindingStatus
*status, QUntypedPropertyData *property)
    : property(property)
{
    // store a pointer to the currentBindingEvaluationState to avoid a
TLS lookup in
    // the destructor (as these come with a non zero cost)

    currentState = &status->currentCompatProperty; /////// this line crashes!
    previousState = *currentState;
    *currentState = this;

    currentlyEvaluatingBindingList = &bindingStatus.currentlyEvaluatingBinding;
    bindingState = *currentlyEvaluatingBindingList;
    *currentlyEvaluatingBindingList = nullptr;
}

It happened because 'status' turned out to be 0xfeeefeeefeeefeee

Just in case here is the stack trace:
1   QtPrivate::CompatPropertySafePoint::CompatPropertySafePoint

                                          qproperty.cpp
520  0x7ffa12c909f5
2   QObjectCompatProperty<QQuickItemPrivate,double,&QQuickItemPrivate::_qt_property_width_offset,{QQuickItemPrivate::setWidth,0},{QQuickItemPrivate::widthChanged,0},0>::bindingWrapper
qproperty_p.h                488  0x7ffa19b652f2
3   QPropertyBindingPrivate::evaluateRecursive_inline

                                          qproperty_p.h
805  0x7ffa12a7b9fc
4   QPropertyBindingPrivate::evaluateRecursive

                                          qproperty.cpp
297  0x7ffa12c90c2c
5   QQmlPropertyBindingJS::expressionChanged

                                          qqmlpropertybinding.cpp
191  0x7ffa13fc1084
6   QQmlJavaScriptExpressionGuard_callback

                                          qqmljavascriptexpression.cpp
585  0x7ffa13ef0dcd
7   QQmlNotifier::emitNotify

                                          qqmlnotifier.cpp
105  0x7ffa13f5132a
8   QQmlData::signalEmitted

                                          qqmlengine.cpp
387  0x7ffa13e84c2f
9   doActivate<0>

                                          qobject.cpp
3815 0x7ffa12c7c7e0
10  QMetaObject::activate

                                          qobject.cpp
3993 0x7ffa12c64ac1
11  QQmlVMEMetaObject::activate

                                          qqmlvmemetaobject.cpp
1297 0x7ffa140cd866
12  QQmlVMEMetaObject::writeVarProperty

                                          qqmlvmemetaobject.cpp
1112 0x7ffa140cd0f9
13  QQmlVMEMetaObject::setVMEProperty

                                          qqmlvmemetaobject.cpp
1215 0x7ffa140c9135
14  QV4::QObjectWrapper::setProperty

                                          qv4qobjectwrapper.cpp
580  0x7ffa13ccb93c
15  QV4::QObjectWrapper::setQmlProperty

                                          qv4qobjectwrapper.cpp
475  0x7ffa13cca868
16  QV4::QQmlContextWrapper::virtualPut

                                          qv4qmlcontext.cpp
438  0x7ffa13cc2676
17  QV4::Object::put

                                          qv4object_p.h
318  0x7ffa1396bbad
18  QV4::ExecutionContext::setProperty

                                          qv4context.cpp
318  0x7ffa13b7bd95
19  QV4::Runtime::StoreNameSloppy::call

                                          qv4runtime.cpp
1004 0x7ffa13d3bc69
20  QV4::Moth::VME::interpret

                                          qv4vme_moth.cpp
694  0x7ffa13da7b42
... <More>



Any hints on how to troubleshoot further?
_______________________________________________
Interest mailing list
Interest at qt-project.org
https://lists.qt-project.org/listinfo/interest
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20220505/964f0b64/attachment.htm>


More information about the Interest mailing list