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

QThreadPool produces zombie [Thread (pooled)] threads

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.13.1, 5.13.2
    • Core: Threads
    • None
    • Debian 9 (stretch) amd64,
      Qt 5.13.[1,2] from Online Installer,
      gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516
    • Linux/X11

    Description

      Since about 2019-10-10, when we launched production applications rebuilt with Qt 5.13.1 (now 5.13.2) after upgrading from 5.9.x, we started seeing zombie threads slowly popping up (brownish color):

      Currently, it looks like this via ps and pstree (first two threads in pstree are zombies):

      $ ps aux | grep -v grep | grep Zs
      root     14582  0.0  0.0      0     0 ?        Zs   Jan15   0:00 [Thread (pooled)] <defunct>
      root     14591  0.0  0.0      0     0 ?        Zs   Jan15   0:00 [Thread (pooled)] <defunct>
      
       
      GPTScheduler(31254)─┬─Thread (pooled)(14582) 
                          ├─Thread (pooled)(14591) 
                          ├─{Thread (pooled)}(14578) 
                          ├─{Thread (pooled)}(14580) 
                          └─{Thread (pooled)}(14586)
      

      I do not know how to reproduce it with smaller application. What QRunnables are doing, is either invoking QProcess p; ..., p.startDetached();,(launches PHP process), or executing some QSqlQuery. Zombies are not seem to be produced on every QThreadPool::globalInstance()->start(foo); - as seen in munin graph, the growth of zombie "garden" is rather slow. Looking at the logs and munin graph, it seems as if zombies, at least these latest zombies seen in ps output provided, where produce on idle moment, after almost an hour after doing any work.

      Attachments

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

        Activity

          People

            thiago Thiago Macieira
            talkless Vincas Dargis
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes