Bug in acquire_call() in pjsua_call.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I think I found a bug in acquire_call() in pjsua_call.c.

Problem
------------
The local variable timeout, has type pj_time_val, isn't properly
initialized.

It's initialized like this:
timeout.msec = PJSUA_ACQUIRE_CALL_TIMEOUT;
pj_time_val_normalize(&timeout);

this means that timout.sec is never initialized.

Solution
------------
timeout.sec = 0; should be added like this:

timeout.msec = PJSUA_ACQUIRE_CALL_TIMEOUT;
timeout.sec = 0;
pj_time_val_normalize(&timeout);


Behavior
------------
Depending on the build and what happens to be on the stack one will
sometimes get the following log output for a multi-threaded build:
pjsua_call.c  Timed-out trying to acquire PJSUA mutex (possibly system has
deadlocked) in pjsua_call_reinvite()

That is acquire_call() will compare invalid time values and will not wait
for the locked mutex at all, or at least for a very short time.

Best regards
Birger
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20110125/ac0a69d7/attachment.html>


[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux