Sometimes calling QQmlEngine::clearComponentCache() causes a crash deep in the QML engine. This problem seems to be timing-dependant, attached is a testcase that reproduces the problem after some iterations. Sometimes the program aborts with a segfault, sometimes with different asserts.
Attached is also a GDB backtrace for one of the crashes, and a valgrind log of another crash. Note that the valgrind log is from another project, I did not manage to reproduce this with valgrind and the minimal testcase, probably because the timings under valgrind are very different.
While the attached testcase might seem silly, the real-world usecase of this is to provide quick reloading of the QML files while a program is running, to reduce the time between changing QML source and testing it in a program to almost nothing.
|For Gerrit Dashboard: QTBUG-41465|
|223393,3||Fix crash when calling QQmlEngine::clearComponentCache()||5.11||qt/qtdeclarative||Status: MERGED||+2||0|
|223394,4||Reduce the overhead of type loader locking||5.11||qt/qtdeclarative||Status: MERGED||+2||0|
|225621,2||Fix crash when calling QQmlEngine::clearComponentCache()||5.9||qt/qtdeclarative||Status: MERGED||+2||0|