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

QT_THREAD_PARALLEL_FILLS macro causes semaphore_wait_trap on iOS

    XMLWordPrintable

Details

    • iOS/tvOS/watchOS
    • 80f210db3 (dev), 5c2796a07 (6.8), 713bbd134 (6.7), 80e746144 (tqtc/lts-6.5)

    Description

      iOS Grand Central Dispatch has a maximum limit of 64 threads in the pool..

      The problem is that our app already needs a few threads for its work, however, the QT_THREAD_PARALLEL_FILLS macro sometimes uses at least 32 threads at once which confuses the GCD and the application ends up in semaphore_wait_trap.

      In my opinion, the macro is poorly designed and thought through. I know that it already caused QTBUG-109511 and has been hotfixed two times since to avoid the most obvious crashes and halts.

      A patch has already been committed that addresses some other potential issues (and maybe even this one) but no sane discussion has been there (sorry for my emotional comment in there)

      The idea that the code can use 32 threads from the pool somewhere deep down (not documented anywhere) at the same time is somewhat crazy. Yes, I know that running a widgets application on iOS is a minority use-case, however, I think that while supported, it should work.

       

      Attached is the stack of one such halt.

      Attachments

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

        Activity

          People

            allan.jensen Allan Sandfeld Jensen
            teslan Marek Šanta
            Votes:
            4 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes