Skip to content

Avoid test-crash because of QStringBuilder

Adriaan de Groot requested to merge work/adridg/fix-test-crash into master

Test application ./bin/KActivitiesStatsTest crashes during run (FreeBSD, clang):

==90637== Invalid read of size 4 ==90637== at 0x2174BA: __cxx_atomic_load (atomic:998) ==90637== by 0x2174BA: load (atomic:1602) ==90637== by 0x2174BA: loadRelaxed (qatomic_cxx11.h:239) ==90637== by 0x2174BA: loadRelaxed (qbasicatomic.h:107) ==90637== by 0x2174BA: ref (qrefcount.h:55) ==90637== by 0x2174BA: QString (qstring.h:1094) ==90637== by 0x2174BA: operator QString (qstringbuilder.h:147) ==90637== by 0x2174BA: ResultSetTest::initTestCase() (invent/kactivities-stats/autotests/ResultSetTest.cpp:182)

The const auto makes databaseFile a QStringBuilder, not a QString, and by the time it is (re-)used in the qDebug() call, one of the temporaries it holds on to is gone.

Merge request reports