Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
5.8.0 Alpha, 5.8.0 Beta, 5.8.0 RC, 5.8.0, 5.9.0 Beta 3
-
Reproduced in 2 environments:
VM(VMWare 12):
- Ubuntu(Unity) 15.10 64-bit
- gcc 4.7
Native:
- neon 16.04(Ubuntu)
- gcc 6.2
Description
While trying to reduce the code for this issue I observed that: when a QML Item(with a ListView - without it, it doesn't crash) is reusing another QML item as a base and a call is made to QML Engine's clearComponentCache, the QML Engine is crashing.
This issue is not reproducible on: Qt 5.2.1, 5.5.0, 5.6.1, 5.7.0.
It is reproducible on: Qt 5.8-alpha and Qt 5.8-beta.
I attached the "shortened" code that can reproduce this issue.
Note that it is flaky, you might need to run it 1-5 times until it hits the issue.
When I had the entire code with more QML Items, it was crahing 100%.
Also, I had an "Image" component in the ListView.
Removing "Image" from ListView and ListModel made 2 other asserts to disappear.
Before removing the "Image", the application would alternate between:
- The crash reproducible here: QAtomicOps::load
- Assert in QQmlRefCount::release after QAtomicOps::load returns. Q_ASSERT(refCount.load() > 0) - in -> void QQmlRefCount::release() (qqmlrefcount_p.h))
- Assert in QArrayData. size == 0 || offset < 0 || size_t(offset) >= sizeof(QArrayData) from another cache->clear()/release().
One common code-path hit by all 3 issues was the call to: QV4::ExecutionEngine::~ExecutionEngine -> QV4::CompileData::CompilationUnit::unlink
I have compiled locally the Qt 5.8-beta. If you want, I am willing to try to apply patches and see on the bigger code-base if it is still reproducible(asserts included).
When looking at the code, please pay attention to:
- Crash.qml - there is a comment
- viewer.cpp - line 80(with the line commented out, the issue is not reproducible)