Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-106360

qunicodetools.cpp: libthai's th_brk is not thread-safe [1/2]: try fix using old API

    XMLWordPrintable

Details

    • 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

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              ievgenii.meshcheriakov Ievgenii Meshcheriakov
              mmutz Marc Mutz
              Vladimir Minenko Vladimir Minenko
              Alex Blasche Alex Blasche
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes