[asterisk-dev] Possible deadlock situation in chan_sip.c?

Harald Raetscher hra at teamware-gmbh.de
Wed Mar 21 07:48:03 MST 2007


Hi!

 

Can this code section from chan_sip.c (begin at line 14920) cause
deadlocks if any error occurs between the mutex lock for iflock?

 

--- snip ---

            /* Check for interfaces needing to be killed */

            ast_mutex_lock(&iflock);

restartsearch:          

            t = time(NULL);

            /* don't scan the interface list if it hasn't been a
reasonable period

               of time since the last time we did it (when MWI is being
sent, we can

               get back to this point every millisecond or less)

            */

            for (sip = iflist; !fastrestart && sip; sip = sip->next) {

                  ...

            }

            ast_mutex_unlock(&iflock);

--- snip ---

 

Asterisk log:

 

--- snip ---

[Mar 16 12:31:18] ERROR[11927]
/usr/src/asterisk/asterisk-1.4.1/include/asterisk/lock.h: chan_sip.c
line 4303 (sip_alloc): Deadlock? waited 5 sec for mutex '

&iflock'?

[Mar 16 12:31:18] ERROR[11927]
/usr/src/asterisk/asterisk-1.4.1/include/asterisk/lock.h: chan_sip.c
line 14920 (do_monitor): '&iflock' was locked here.

[Mar 16 12:31:18] ERROR[11942]
/usr/src/asterisk/asterisk-1.4.1/include/asterisk/lock.h: pbx.c line
2105 (ast_extension_state_del): Deadlock? waited 5 sec fo

r mutex '&(&hints)->lock'?

[Mar 16 12:31:18] ERROR[11942]
/usr/src/asterisk/asterisk-1.4.1/include/asterisk/lock.h: pbx.c line
1982 (ast_hint_state_changed): '&(&hints)->lock' was lock

ed here.

[Mar 16 12:31:18] ERROR[11927]
/usr/src/asterisk/asterisk-1.4.1/include/asterisk/lock.h: chan_sip.c
line 4303 (sip_alloc): Deadlock? waited 5 sec for mutex '

&iflock'?

[Mar 16 12:31:18] ERROR[11927]
/usr/src/asterisk/asterisk-1.4.1/include/asterisk/lock.h: chan_sip.c
line 14920 (do_monitor): '&iflock' was locked here.

[Mar 16 12:31:18] ERROR[11942]
/usr/src/asterisk/asterisk-1.4.1/include/asterisk/lock.h: pbx.c line
2105 (ast_extension_state_del): Deadlock? waited 5 sec fo

r mutex '&(&hints)->lock'?

[Mar 16 12:31:18] ERROR[11942]
/usr/src/asterisk/asterisk-1.4.1/include/asterisk/lock.h: pbx.c line
1982 (ast_hint_state_changed): '&(&hints)->lock' was lock

ed here.

[Mar 16 12:31:18] ERROR[11927]
/usr/src/asterisk/asterisk-1.4.1/include/asterisk/lock.h: chan_sip.c
line 4303 (sip_alloc): Deadlock? waited 5 sec for mutex '

&iflock'?

[Mar 16 12:31:18] ERROR[11927]
/usr/src/asterisk/asterisk-1.4.1/include/asterisk/lock.h: chan_sip.c
line 14920 (do_monitor): '&iflock' was locked here.

[Mar 16 12:31:18] ERROR[11942]
/usr/src/asterisk/asterisk-1.4.1/include/asterisk/lock.h: pbx.c line
2105 (ast_extension_state_del): Deadlock? waited 5 sec fo

r mutex '&(&hints)->lock'?

[Mar 16 12:31:18] ERROR[11942]
/usr/src/asterisk/asterisk-1.4.1/include/asterisk/lock.h: pbx.c line
1982 (ast_hint_state_changed): '&(&hints)->lock' was lock

ed here.

--- snip ---

 

Cheers

 

Harald

 

-------

Teamware GmbH
Stahlgruberring 11, D-81829 München
Registergericht München, HRB 104293
Geschäftsführer: Dr.-Ing. Thomas Kupec, Armin Sperber

Telefon:   089-427 005.15
E-Mail:    hra at tmwr.de
Web:       http://www.tmwr.de

 <http://www.tmwr.de/> 

 



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-dev/attachments/20070321/1179b509/attachment.htm


More information about the asterisk-dev mailing list