Il 07/05/2016 20:05, David Faure ha scritto:
We disable seed randomisation and sse4.2 (can't remember why that mattered,
that was something Volker found out iirc), and that made it pass until recently,
I'm not sure what changed.

Isn't that inherently dangerous though?

Even with those disabled, iteration in a hash / set depends on the "history" of that set:

#include <QtCore>

int main()
{
    qputenv("QT_HASH_SEED", "0");
    qputenv("QT_NO_CPU_FEATURE", "sse4.2");

    QSet<QString> set1, set2;

    // add 0-999, remove 10-999
    for (int i = 0; i < 1000; ++i)
        set1.insert(QString::number(i));

    for (int i = 10; i < 1000; ++i)
        set1.remove(QString::number(i));

    // just add 0-9
    for (int i = 0; i < 10; ++i)
        set2.insert(QString::number(i));

    qDebug() << (set1 == set2); // true
    qDebug() << (set1.toList() == set2.toList()); // unpredictable, likely false
}


Cheers,
--
Giuseppe D'Angelo | giuseppe.dang...@kdab.com | Senior Software Engineer
KDAB (UK) Ltd., a KDAB Group company | Tel: UK +44-1625-809908
KDAB - The Qt Experts

Attachment: smime.p7s
Description: Firma crittografica S/MIME

_______________________________________________
Kde-frameworks-devel mailing list
Kde-frameworks-devel@kde.org
https://mail.kde.org/mailman/listinfo/kde-frameworks-devel

Reply via email to