<html>
    <head>
      <base href="https://bugs.freedesktop.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Thread leak when changing context size"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=107092">107092</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Thread leak when changing context size
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>Mesa
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Drivers/Gallium/llvmpipe
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>mesa-dev@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>cory.quammen@kitware.com
          </td>
        </tr>

        <tr>
          <th>QA Contact</th>
          <td>mesa-dev@lists.freedesktop.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=140440" name="attach_140440" title="apitrace output from the example">attachment 140440</a> <a href="attachment.cgi?id=140440&action=edit" title="apitrace output from the example">[details]</a></span>
apitrace output from the example

I have observed a thread leak in Linux when using offscreen rendering in VTK
via llvmpipe. A minimal VTK example code is attached, as is the output of
running apitrace.

One can observe the thread leak by doing the following:

* down ParaView-5.5.2-Qt5-MPI-Linux-64bit.tar.gz from www.paraview.org/download
* tar xzf ParaView-5.5.2-Qt5-MPI-Linux-64bit.tar.gz
* cd ParaView-5.5.2-Qt5-MPI-Linux-64bit
* Run

  bin/pvbatch --mesa-llvm vtk-mesa-threads-growth.py

In this example, we are repeatedly resizing the render window. Each time the
window is resized, the current context is destroyed with glXDestroyContext. A
new context is created with the new desired size, but looking at the output of
htop, the threads used from the previous render never rejoin the main thread,
causing the total number of threads to grow each time the render window size is
changed. For long-running animation creation, this situation can lead to a
major system slow down.

If this is not a mesa bug and it looks like I am doing something not correct in
the trace, please let me know.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the QA Contact for the bug.</li>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>