Priority: P2: Important
Affects Version/s: 5.15.1
Fix Version/s: None
Component/s: Core: Date/Time
After updating from Qt 5.12.9 to 5.15.1, part of our multithreaded code which accesses QDate::FromString started firing a Q_ASSERT in qcalendar.cpp non determinstically, line 103. After debugging into Qt source code, the problem is with the global static calendar registry:
This registry is accessed concurrently when QDate::FromString is called, and the assert Q_ASSERT(byId[size_t(id)] == nullptr) fails whenever QDate::FromString is called using default calendar parameter which makes sense, since there is already a gregorian default calendar in registry.
Sample code to reproduce:
We worked around the problem using a constant global static QCalendar object which is passed as the last parameter in QDate::FromString