[Blink] Mac 0.20.0 2 sip account active on same server, complete crash

A.M. agentm at themactionfaction.com
Mon Sep 6 23:59:50 CEST 2010

On Sep 6, 2010, at 11:53 AM, Adrian Georgescu wrote:

> Yes, this is the same elusive and randomly appearing crash that we were not able to find yet the reason for. The problem is somewhere in PortAudio/Pjmedia thread and it occurs randomly.  Maybe someone with more experience in these libraries can help find the reason for this.

From looking at the backtrace and pjproject-1.7/pjmedia/src/pjmedia/stream.c, it looks like pj_mutex_unlock is complaining that it is about to unlock a mutex which it did not lock. The relevant code path seems to be in pjmedia_stream_destroy. The jitter buffer is locked, then deallocated, and then the jitter buffer mutex is destroyed. It looks like there is potential for a race condition. The order should be:

1. lock mutex if available
2. deallocate jitter buffer
3. store pointer to mutex in temporary space
4. set jb_mutex to NULL
5. unlock mutex if necessary
6. deallocate mutex if necessary

It would be a lot cleaner if the destroy method would not be called from the initialization method...

P.S. It would be nice if symbols would be enabled even for the release versions. 


More information about the Blink mailing list