Priority: P2: Important
Affects Version/s: 5.9.3, 5.10.0, 5.9.4, 5.9.5, 5.10.1, 5.11.0
Fix Version/s: None
Environment:windows 7 x64, ubuntu 16.04 x64, android, Qt 5.9.1, 5.9.3, 5.9.4, 5.10, gcc 5.3 x32, gcc 4.9 arm32, gcc 7.2 x64
Originally reported here:
Later duplicated by:
Which was supposedly fixed
However, the failure still occurs. The difference is that now it is not every time but occasionally. As illustrated in the attached clip, it doesn't occur in version 5.9.1.
5.9.1 - 9 runs, 9 succeeded, 0 failed
5.9.3 - 22 runs, 15 succeeded, 7 failed
The application fails to load up the QML stuff property about 1/3 of the time. There is no apparent pattern to it. The code or external data doesn't change in between runs. Using the same Creator version in one session, simply switching kits, indicating that the problem is not with Creator but with Qt 5.9.3
Updated the report to reflect that the same behavior occurs under 5.10 as well. I am getting the same behavior running apps in windows, linux and android.
The issue exists in 5.9.4 as well.
Update: The issue continues to manifest in every version of Qt ever since 5.9.1, which is still the last to never manifest it.
The latest changes to the QML engine in 5.11 did not affect it in any way.
Meanwhile, I tried to mitigate it by repeatedly attempting to create the application while still in the current process:
This basically sets a `success` property to true if the qml manages to load, so I can check immediately after the call to `load()`, and on failure attempt to set up and run things anew so that it hopefully kicks in.
However, that doesn't seem to help either, the problem appears to manifest on a per process run basis, if the first attempt to load fails, so do all subsequent, and I've let it to try thousands of times.
I also tried reordering the registration of singletons in every possible order, to no effect.
I made a note that doing an engine object dump gives me:
Which may be relevant to pinpoint the problem.
So I get the component and try to do some introspection to see what is going on in there:
The output is respectively `QQmlComponent::Status(Loading) 1 0 "" QUrl("qrc:/main.qml")`
It still says loading although progress is 1 (finished) with no errors.
just in case the engine might not happen to load things in time (presuming there is some multithreading going in there), I gave it a half a second pause between loading each singleton and before and after loading the main qml file for the main thread. No effect, once it fails it keeps failing.
As usual, `load()` fails in complete silence, there is no output in the console, no application window, no warnings or errors are emitted via the signals.