Details
-
Bug
-
Resolution: Won't Do
-
P2: Important
-
None
-
6.2.0, 6.3.1, 6.4.0 Beta4
-
None
-
5
-
Foundation Sprint 73
Description
The facilities in qunicodetools.cpp are not limited to the GUI thread, so they need to be re-entrant.
Besides QTBUG-105543 there is another threading issue in qunicodetools' thai support: The th_brk() function is apparently not re-entrant, so https://github.com/tlwg/libthai/pull/1 (available from symbol version 0.1.25) added a new, thread-safe, API where the initialization of global state is explicit (and must be protected by the user with a mutex), but following calls to the th_brk replacement are then thread-safe.
This is a research prequel task. Before fixing the issue by porting to the new API in 0.1.25,, we should find out whether we can fix the data race in a less-intrusive manner. AFAIU, the problem is that the first call loads a dictionary into a global variable, and that initialisation of global state isn't thread-safe. So if we run the function once under mutex protection, on some sample data, we will at least have Qt's uses of the library covered. Application code that calls these functions circumventing Qt APIs is then still a problem, but SEP.
Attachments
Issue Links
- depends on
-
QTBUG-105543 Several data races in qunicodetools.cpp thai support initalization
- Closed
- is required for
-
QTBUG-105544 qunicodetools.cpp: libthai's th_brk is not thread-safe [2/2]: new API
- Closed
- resulted from
-
QTBUG-103531 Finish migration to qsizetype [qtbase/src/corelib/text]
- Closed