1
0

Accepting request 247846 from KDE:Qt5

- Update to 5.3.2~git20140904 (r05670f5):
  * Tip of the bugfix 5.3.2 branch

Please copy to 13.2 if possible, as can be seen from the changelog, it contains many useful bugfixes. The 'snapshot' is artificial, as the probably won't be any commits between now and 5.3.2, but release is waiting on some bureaucratic procedures. Thanks!

OBS-URL: https://build.opensuse.org/request/show/247846
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libqt5-qtdeclarative?expand=0&rev=18
This commit is contained in:
Stephan Kulow 2014-09-08 19:28:19 +00:00 committed by Git OBS Bridge
parent e274cb3f76
commit 290618e6cb
5 changed files with 120 additions and 161 deletions

View File

@ -1,142 +0,0 @@
From b0835b31fd456c30ea3fcaae6edc58212556477d Mon Sep 17 00:00:00 2001
From: Simon Hausmann <simon.hausmann@digia.com>
Date: Thu, 21 Aug 2014 13:10:33 +0200
Subject: [PATCH] Fix crash with early QObject property access
In the reported bug, it can happen that we try to access the compile-time resolved
QObject property of an object that is referenced by id. The binding that uses this is
triggered when the property changes but _also_ when the id referenced object gets either
created or deleted. The first time the binding is evaluated is very early on, when the
id referenced object is not created yet, so the binding evaluation fails. However the
dependency is set up, and so later then the id referenced object is created and the id
property is set on the context, the notification triggers and the binding is re-evaluated.
During that binding evaluation a QObject property access happens by index on an object that
doesn't have its VME meta-object set up yet. Therefore the property access fails and a
crash occurs or the Q_ASSERT(property) assertion fails.
The fix is to set register the id named object in the context _after_ the VME meta-object is
setup.
Task-number: QTBUG-40018
Change-Id: Ic2d7b4a0c49635efe68e93f2f6c316eb65f0c309
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
---
src/qml/qml/qqmlobjectcreator.cpp | 18 ++++++++++++-----
src/qml/qml/qqmlobjectcreator_p.h | 2 ++
.../qml/qqmllanguage/data/earlyIdObjectAccess.qml | 23 ++++++++++++++++++++++
tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp | 10 ++++++++++
4 files changed, 48 insertions(+), 5 deletions(-)
create mode 100644 tests/auto/qml/qqmllanguage/data/earlyIdObjectAccess.qml
--- qtdeclarative-opensource-src-5.3.1.orig/src/qml/qml/qqmlobjectcreator.cpp
+++ qtdeclarative-opensource-src-5.3.1/src/qml/qml/qqmlobjectcreator.cpp
@@ -1013,6 +1013,13 @@ void QQmlObjectCreator::recordError(cons
errors << error;
}
+void QQmlObjectCreator::registerObjectWithContextById(int objectIndex, QObject *instance) const
+{
+ QHash<int, int>::ConstIterator idEntry = objectIndexToId.find(objectIndex);
+ if (idEntry != objectIndexToId.constEnd())
+ context->setIdProperty(idEntry.value(), instance);
+}
+
QObject *QQmlObjectCreator::createInstance(int index, QObject *parent, bool isContextObject)
{
QQmlObjectCreationProfiler profiler(sharedState->profiler.profiler);
@@ -1112,10 +1119,6 @@ QObject *QQmlObjectCreator::createInstan
parserStatus->d = &sharedState->allParserStatusCallbacks.top();
}
- QHash<int, int>::ConstIterator idEntry = objectIndexToId.find(index);
- if (idEntry != objectIndexToId.constEnd())
- context->setIdProperty(idEntry.value(), instance);
-
// Register the context object in the context early on in order for pending binding
// initialization to find it available.
if (isContextObject)
@@ -1130,8 +1133,10 @@ QObject *QQmlObjectCreator::createInstan
}
}
- if (isComponent)
+ if (isComponent) {
+ registerObjectWithContextById(index, instance);
return instance;
+ }
QQmlRefPointer<QQmlPropertyCache> cache = propertyCaches.at(index);
Q_ASSERT(!cache.isNull());
@@ -1288,6 +1293,9 @@ bool QQmlObjectCreator::populateInstance
} else {
vmeMetaObject = QQmlVMEMetaObject::get(_qobject);
}
+
+ registerObjectWithContextById(index, _qobject);
+
qSwap(_propertyCache, cache);
qSwap(_vmeMetaObject, vmeMetaObject);
--- qtdeclarative-opensource-src-5.3.1.orig/src/qml/qml/qqmlobjectcreator_p.h
+++ qtdeclarative-opensource-src-5.3.1/src/qml/qml/qqmlobjectcreator_p.h
@@ -110,6 +110,8 @@ private:
QString stringAt(int idx) const { return qmlUnit->header.stringAt(idx); }
void recordError(const QV4::CompiledData::Location &location, const QString &description);
+ void registerObjectWithContextById(int objectIndex, QObject *instance) const;
+
enum Phase {
Startup,
CreatingObjects,
--- /dev/null
+++ qtdeclarative-opensource-src-5.3.1/tests/auto/qml/qqmllanguage/data/earlyIdObjectAccess.qml
@@ -0,0 +1,23 @@
+import QtQuick 2.0
+
+Item {
+ visible: false
+ property bool success: false
+ property bool loading: true
+
+ Item {
+ visible: someOtherItem.someProperty
+ onVisibleChanged: {
+ if (!visible) {
+ success = loading
+ }
+ }
+ }
+
+ Item {
+ id: someOtherItem
+ property bool someProperty: true
+ }
+
+ Component.onCompleted: loading = false
+}
--- qtdeclarative-opensource-src-5.3.1.orig/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
+++ qtdeclarative-opensource-src-5.3.1/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
@@ -240,6 +240,8 @@ private slots:
void noChildEvents();
+ void earlyIdObjectAccess();
+
private:
QQmlEngine engine;
QStringList defaultImportPathList;
@@ -3791,6 +3793,14 @@ void tst_qqmllanguage::noChildEvents()
QCOMPARE(object->childAddedEventCount(), 0);
}
+void tst_qqmllanguage::earlyIdObjectAccess()
+{
+ QQmlComponent component(&engine, testFileUrl("earlyIdObjectAccess.qml"));
+ QScopedPointer<QObject> o(component.create());
+ QVERIFY(!o.isNull());
+ QVERIFY(o->property("success").toBool());
+}
+
QTEST_MAIN(tst_qqmllanguage)
#include "tst_qqmllanguage.moc"

View File

@ -1,3 +1,114 @@
-------------------------------------------------------------------
Thu Sep 4 20:37:34 UTC 2014 - hrvoje.senjan@gmail.com
- Update to 5.3.2~git20140904 (rd8bc98b):
* Tip of the bugfix 5.3.2 branch
* Contains many bugfixes over 5.3.1 release:
* Doc: Added a link to the QML advanced tutorial
* Don't use d->instanceModel after free'ing it
* Fix crash with early QObject property access
* Fix typo in DelegateModelGroup documentation
* Protect some members in QQmlObjectCreator
* Initialize variable
* Don't abuse new to do a reinterpret_cast
* Protect incubation against its creator being deleted.
* Add 5.3.2 changelog for qtdeclarative
* Fix crash with recursively loading cached compilation units
* Fix typo in StateChangeScript documentation.
* Added the QtSQL dependency info. to the project file
* tst_dialogs: verify that rootObject is valid
* tst_dialogs: QTRY_ on the expression
(spyVisibilityChanged.count) not the variable.
* The cached objects can be deleted, so keep them in a QPointer
* Fix potential deadlook in threaded renderloop.
* Added a signal handler
* Fix typo in Context2D documentation.
* Disable threaded FBO canvas drawing when not supported.
* V4 JIT: fix JS stack frame size calculation.
* Correct strokeRect documentation.
* Silence harmless compiler warning.
* benchmarks: Skip compilation of (and mark with FIXME) a few
benchmarks that don't build.
* benchmarks/particles: fix projects to actually build
* Fix compilation of tst_compilation (:-P) benchmark.
* Avoid double deletion when deleting an incubating component.
* Invalidate the scenegraph properly in the rendercontrol
* Fix crash when loading invalid QML with behavior on
invalid group property
* Fix crash when animators are deleted just after being started
* Don't try to reload QQuick images when changing to
null screen
* Clarify Component.onCompleted/onDestruction docs
* Fix fbo creation and resize logic in QQuickWidget
* Fix Qt.include with cached compilation units and resources
* Synchronize PathView gesture grabbing with other items.
* Fix FBO recreated every time the QSG node is updated under
some conditions
* More QQuickCanvas cleanup handling.
* Make canvas cleanup work propertly...
* Use the current context to resolve extensions.
* qmlplugindumper: do not pop up a window if
an assert is triggered
* Fix assertion: ASSERT: "hasException" in file
jsruntime/qv4engine.cpp, line 933
* Fix QQmlDelegateModel getting out of sync
* QQuickWindow: add some links to resetOpenGLState
* Remove metaobject revisioning for QQuickScreenAttached
* Don't dereference null pointer.
* Flickable: Cancel interaction on interactive changes
* Don't try to draw shader effect sources with dims < 0.
* QQuickMouseArea: Mark override functions with Q_DECL_OVERRIDE
* Fix interaction of garbage collector with JS objects during
QML type instantiation
* Do not use mark() when marking ExecutionContexts
* Don't recreate header and footer unnecessarily
* Clear the visibleImgTags list when setting up the text layout
* Improve programmatic flicking of ListView (and Flickable).
* V4: work around a bug in libc++'s std::vector<bool>
* QQmlComponent::create(): visual items must have
a visual parent
* Clean up the textures when deleting the content
* Schedule layout changes to avoid refill() recursion.
* Add autotest for incorrect steal of flick.
* Do not crash AtlasTexture if image is null
* Fix Node object leak in QQuickTextEditPrivate
* shift and unshift fail for QQmlSequence types
* Check for window != 0 in QuickTestResult::grabImage().
* Doc: add documentation for the RSS News example
* Fix typo in documentation
* Binding Text width to implicitWidth can result in
incorrect layout
* Docs: fix "classname" indentation in the qmldir specs
* Fix role for generic Accessible items
* Calqlatr demo: Remove unused files
* Remove usage of external dependencies from the RSS News demo
* Fix crash on QQmlEngine destruction.
* Don't dereference null QQuickWindowPrivate.
* Add opt-out environment variable for @2x images
* Doc: correct link/compilation errors in Qt Declarative
* Fix crash in Flickable with pressDelay.
* Skip rssnews demo if xmlpatterns is not present
* Delete objects created by qmlplugindump
* Avoid double deletion of QQuickWindow
* Fix QQmlDelegateModel ignoring layoutChange in
certain situations
* Fix intermittent crash with older MinGW releases
* Doc: Add documentation for the Maroon in Trouble example
* Fix crash when deleting component in Component.onComplete
through loader
* Fix memory leak in QQmlComponent::createObject
* Update QtQuick import value to 2.3
* Set locked state while locking for grab.
* QQmlObjectCreator: Clear sharedState componentAttached
in destruction/clear
* Initialize velocity
* Improve RSS News Qt Quick Demo
* Fix QQmlComponent detailed description.
* Add a QQuickWidget - QQuickView comparison example
* Fix crash in QObjectWrapper
- libqt5-fix-crash-with-early-QObject-property-access.patch,
merged upstream
-------------------------------------------------------------------
Fri Aug 29 09:49:55 UTC 2014 - mlin@suse.com

View File

@ -16,29 +16,23 @@
#
%define qt5_snapshot 0
%define qt5_snapshot 1
%define libname libQtQuick5
Name: libqt5-qtdeclarative
Version: 5.3.1
Version: 5.3.2~git20140904
Release: 0
Summary: Qt 5 Declarative Library
License: SUSE-LGPL-2.1-with-digia-exception-1.1 or GPL-3.0
Group: Development/Libraries/X11
Url: http://qt.digia.com
%define base_name libqt5
%define real_version 5.3.1
%define so_version 5.3.1
%if %qt5_snapshot
%define tar_version qtdeclarative-%{real_version}
%else
%define real_version 5.3.2
%define so_version 5.3.2
%define tar_version qtdeclarative-opensource-src-%{real_version}
%endif
Source: %{tar_version}.tar.xz
Source1: baselibs.conf
# PATCH-FIX-UPSTREAM libqt5-fix-crash-with-early-QObject-property-access.patch -- QTBUG-40018
Patch1000: libqt5-fix-crash-with-early-QObject-property-access.patch
BuildRequires: fdupes
BuildRequires: libQt5Core-private-headers-devel >= %{version}
BuildRequires: libQt5Gui-private-headers-devel >= %{version}
@ -67,12 +61,7 @@ This package contains base tools, like string, xml, and network
handling.
%prep
%if %qt5_snapshot
%setup -q -n qtdeclarative-%{real_version}
%else
%setup -q -n qtdeclarative-opensource-src-%{real_version}
%endif
%patch1000 -p1
%package -n %libname
Summary: Qt 5 Declarative Library
@ -168,7 +157,8 @@ for i in * ; do
done
popd
%fdupes -s %{buildroot}/%{_libqt5_includedir}
%fdupes -s %{buildroot}%{_libqt5_includedir}
%fdupes -s %{buildroot}%{_libqt5_examplesdir}
%files -n %libname
%defattr(-,root,root,755)

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:9a80d401dfbb64f109abf210cb32775a102f7b2420b3a3175b8dab0792220380
size 17611096

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:02bd64b60824ac61e6e38c4ba3f2d00b757526ab420af225777cd1b5d5e01ba8
size 18443472