<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 - data race in pa_queue_pop/pa_queue_push reported by TSan"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=99667">99667</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>data race in pa_queue_pop/pa_queue_push reported by TSan
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>PulseAudio
          </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>core
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>pulseaudio-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>fabrice@bellet.info
          </td>
        </tr>

        <tr>
          <th>QA Contact</th>
          <td>pulseaudio-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>lennart@poettering.net
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=129321" name="attach_129321" title="ThreadSanitizer: data race pulsecore/queue.c:98 in pa_queue_pop">attachment 129321</a> <a href="attachment.cgi?id=129321&action=edit" title="ThreadSanitizer: data race pulsecore/queue.c:98 in pa_queue_pop">[details]</a></span>
ThreadSanitizer: data race pulsecore/queue.c:98 in pa_queue_pop

This output from ThreadSanitizer suggests a data race with the glib mainloop.

The application is empathy. A pa_glib_mainloop is created in the main thread to
monitor the status of the microphone in the user interface, and a gstreamer
pipeline is constructed and running. This pipeline contains a pulsesrc element,
with its own pa_threaded_mainloop.

The problem, as I understand the output of the sanitizer, is that some events
concerning the pa_glib_mainloop are pushed by the pulsesrc thread, and pulled
by the main thread, without common locking, causing this possible race.

The first mutex owned by the pulsesrc thread concerns a GstPad, and the second
mutex is related to its pa_threaded_mainloop.

Can this race really happen, or should it be considered as a false positive ?
Where is locking missing ?</pre>
        </div>
      </p>


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

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