[jitsi-dev] WASAPI (dead?)lock


#1

Hey

I just had it multiple times that I couldn't start a new call. Looking at a
thread dump it seems WASAPI is the culprit as it didn't close a stream
properly and hence blocking the entire SIP account.

With a quick look, it seems that
    private synchronized void waitWhileProcessThread()
    {
        while (processThread != null)
            yield();
    }

will never return as the processThread variable is never set to null...

Ingo

wasapi_lock.txt (91 KB)


#2

Hello, Ingo!

Thank you very much for the thread dump! I haven't been able to fully comprehend it yet but I wanted to make sure that we are on the same page with respect to the piece of code that you mentioned.

На 18.8.2013 г. 14:16, Ingo Bauersachs написа:

With a quick look, it seems that
     private synchronized void waitWhileProcessThread()
     {
         while (processThread != null)
             yield();
     }

will never return as the processThread variable is never set to null...

The processThread field read in waitWhileProcessThread should be set to null in the following code:

private void runInProcessThread(Thread processThread)
{
try
{
...
}
finally
{
synchronized (this)
{
if (processThread.equals(this.processThread))
{
this.processThread = null;
notifyAll();
}

Could you please clarify what you meant when you said that "the processThread variable is never set to null"?

Best regards,
Lyubomir


#3

Dear Ingo,

I pushed commit cfe766cddfd4cb841cb860433e253f93035b1e62 in
jitsi/libjitsi and commit 10aae5aeb3860339463d0018e7573c9cd9f71d17 in
jitsi/jitsi as a resolution to the deadlock that I saw described in
the thread dump that you provided.

Best regards,
Lyubomir


#4

Hey Lyubo

Thanks for looking at it!

Hello, Ingo!

Thank you very much for the thread dump! I haven't been able to fully comprehend it yet but I wanted to make sure that we are on the same page with respect to the piece of code that you mentioned.

I had that at least twice while doing lots of sometimes relatively short calls against an Asterisk box, but nothing special (no conf, no video).

На 18.8.2013 г. 14:16, Ingo Bauersachs написа:

With a quick look, it seems that
    private synchronized void waitWhileProcessThread()
    {
        while (processThread != null)
            yield();
    }

will never return as the processThread variable is never set to null...

The processThread field read in waitWhileProcessThread should be set to null in the following code:

private void runInProcessThread(Thread processThread)
{
try
{
...
}
finally
{
synchronized (this)
{
if (processThread.equals(this.processThread))
{
this.processThread = null;
notifyAll();
}
}
}
}

Could you please clarify what you meant when you said that "the processThread variable is never set to null"?

Humm... Either Eclipse didn't show me this reference or I was just blind. Forget about that comment then... As I said, it was quick :slight_smile:

Best regards,
Lyubomir

Ingo

···

On 18.08.2013, at 22:14, "Lyubomir Marinov" <lyubomir.marinov@jitsi.org> wrote: