<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
I've compiled Asterisk 1.4.17 with DEBUG_CHANNEL_LOCKS, DEBUG_THREADS, DETECT_DEADLOCKS, DONT_OPTIMIZE and MALLOC_DEBUG. After running for some time, I noticed this. It's happened several times. I do have a custom-developed app for call direction.<div><br class="webkit-block-placeholder"></div><div><div>=== Thread ID: 3061398448 (do_monitor           started at [15638] chan_sip.c restart_monitor())</div><div>=== ---&gt; Tried and failed to get Lock #0 (channel.c): MUTEX 5012 ast_channel_trylock &amp;chan-&gt;lock 0xb6b7cee8 (4)</div><div>=== ---&gt; Lock #1 (channel.c): MUTEX 5012 ast_channel_trylock &amp;chan-&gt;lock 0xb50032c0 (1)</div><div><br class="webkit-block-placeholder"></div><div>I generally think I can ignore the "tried and failed", but it thinks it's holding a lock (and for hours.) There are no active channels "core show channels" gives 0 active. "sip show channels" also has nothing. chan_sip.c:do_monitor seems to only get a channel lock in one place, and I can't see how it can exit without unlocking it.</div><div><br class="webkit-block-placeholder"></div><div>First, what happens to LOG_DEBUG messages?</div><div><br class="webkit-block-placeholder"></div><div>Placing a breakpoint in ast_channel_trylock, I get this:</div><div><br class="webkit-block-placeholder"></div><div><div>#0  ast_channel_trylock (chan=0xb502a7a0) at channel.c:5009</div><div>#1  0xb67ddf2f in sipsock_read (id=0x82b0310, fd=17, events=1, ignore=0x0) at chan_sip.c:15344</div><div>#2  0x080ba8e7 in ast_io_wait (ioc=0x82a3728, howlong=1) at io.c:279</div><div>#3  0xb67ded49 in do_monitor (data=0x0) at chan_sip.c:15579</div><div>#4  0x08117762 in dummy_start (data=0x82afc38) at utils.c:857</div><div>#5  0xb7f30240 in start_thread () from /lib/tls/i686/cmov/libpthread.so.0</div><div>#6  0xb701f49e in clone () from /lib/tls/i686/cmov/libc.so.6</div><div><br class="webkit-block-placeholder"></div><div>So sipsock_read is doing the locking, I'd guess. But that all seems OK.</div><div><br class="webkit-block-placeholder"></div><div>I also noticed one instance of this:</div><div><br class="webkit-block-placeholder"></div><div><div>[Jan 31 16:19:36] ERROR[19715]: chan_sip.c:15360 sipsock_read: We could NOT get the channel lock for SIP/station026-b5024440!</div><div>[Jan 31 16:19:36] ERROR[19715]: chan_sip.c:15361 sipsock_read: SIP transaction failed: 5cd800000cbd000041a7</div><div><br class="webkit-block-placeholder"></div><div>Could that cause it?</div><div><br></div></div></div><div> <span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div><div>Norman Franke</div><div>Answering Service for Directors, Inc.</div><div>www.myasd.com</div></div></span></span></span> </div><br></div></body></html>