Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
5.3.1
-
None
-
56d9fb4881ec75ceccfe96babc2acb429d76b5ca (qtdeclarative)
Description
Quick and dirty "test-case" here:
https://github.com/oleavr/qml-leak-testcase
It emits a hard-coded QJsonObject containing 1000 keys 100 times and then exits.
Running it in Valgrind:
valgrind --leak-check=full --show-leak-kinds=all ./testcase
Yields:
==29589== 4,378,600 bytes in 100,000 blocks are definitely lost in loss record 203 of 203 ==29589== at 0x4C2AB80: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==29589== by 0x6973359: QArrayData::allocate(unsigned long, unsigned long, unsigned long, QFlags<QArrayData::AllocationOption>) (qarraydata.cpp:101) ==29589== by 0x6A9B900: QTypedArrayData<unsigned short>::allocate(unsigned long, QFlags<QArrayData::AllocationOption>) (qarraydata.h:223) ==29589== by 0x6A8943C: QString::fromLatin1_helper(char const*, int) (qstring.cpp:4400) ==29589== by 0x694DFEB: QString::fromLatin1(char const*, int) (qstring.h:493) ==29589== by 0x6C91193: QJsonPrivate::Latin1String::toString() const (qjson_p.h:426) ==29589== by 0x6C9021E: QJsonPrivate::Entry::key() const (qjson_p.h:623) ==29589== by 0x6C8FE32: QJsonObject::keyAt(int) const (qjsonobject.cpp:1050) ==29589== by 0x6558BE4: QJsonObject::const_iterator::key() const (qjsonobject.h:160) ==29589== by 0x6556EF3: QV4::JsonObject::fromJsonObject(QV4::ExecutionEngine*, QJsonObject const&) (qv4jsonobject.cpp:1003) ==29589== by 0x66C4165: QV8Engine::fromVariant(QVariant const&) (qv8engine.cpp:295) ==29589== by 0x65BD6F9: QV4::QObjectSlotDispatcher::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) (qv4qobjectwrapper.cpp:795)
Attachments
For Gerrit Dashboard: QTBUG-41167 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
94328,3 | Fix String leak by calling the correct destructor | 5.4 | qt/qtdeclarative | Status: MERGED | +2 | 0 |