Summary:ASTERISK-10162: IAX channel failure/crash in Trunk and Branch
Reporter:jeffery palmer (darren1713)Labels:
Date Opened:2007-08-24 11:08:43Date Closed:2007-09-06 17:26:56
Versions:Frequency of
Environment:Attachments:( 0) btfull.txt
( 1) btthreads.txt
Description:Every outbound call placed to an iax channel causes a crash:

*CLI>     -- Executing [919547097232@outbound:1] Dial("SIP/john-08253840", "IAX2/ftloffice/919547097232@gsoutbound") in new stack
Core dumped

failure at
#0  peer_hash_cb (obj=0xbf1ff884, flags=8) at strings.h:279

gdb bt's will be attached as files.
Comments:By: jeffery palmer (darren1713) 2007-08-24 11:11:09

Also, my iax entry is:


By: Russell Bryant (russell) 2007-08-24 11:35:45

I can't reproduce this problem.  Is there a test system that I could log in to where you can reproduce this problem?

By: Russell Bryant (russell) 2007-08-24 11:43:09

Also, if you could build Asterisk with DONT_OPTIMIZE turned on, it would probably get a much nicer backtrace.  This one isn't quite right ...

By: jeffery palmer (darren1713) 2007-08-24 13:43:44

I sure could get access to the system for you, but it will have to be late night or weekend. The system is in use 9-5 mon-sat.

By: Russell Bryant (russell) 2007-08-24 14:43:41

I'll make it work with whatever time is available.

If you'd like to communicate any details to me in a secure means, you can send me encrypted email.  My public gpg key for russell@digium.com is on the keyserver, pgp.mit.edu.

By: jeffery palmer (darren1713) 2007-08-25 08:33:34

I have done some digging into this crash, at I do think it is related to the recent update, but not convinced it actually fixed the problem and not just avoid it.

Index: channels/chan_iax2.c
--- channels/chan_iax2.c        (revision 80878)
+++ channels/chan_iax2.c        (working copy)
@@ -8490,8 +8490,8 @@

static int iax2_poke_peer(struct iax2_peer *peer, int heldcall)
-       if (!peer->maxms || (!peer->addr.sin_addr.s_addr && !peer->dnsmgr)) {
-               /* IF we have no IP without dnsmgr, or this isn't to be monitored, return
+       if (!peer->maxms || !peer->addr.sin_addr.s_addr) {
+               /* IF we have no IP, or this isn't to be monitored, return
                 immediately after clearing things out */
               peer->lastms = 0;
               peer->historicms = 0;

On my box, I do not have a dnsmgr.conf file, and therefore, dnsmgr is off. Does iax2_poke_peer get called at the beginning, setup, duration, or end of an IAX call?

The real question is should iax2_poke_peer really return 0 if there is a fixed IP address, and no dnsmgr? I would think a fixed IP would function fine with no dnsmgr.

By: Russell Bryant (russell) 2007-08-25 11:09:18

iax2_poke_peer() is not called in the context of a regular call at all.  It is called for all peers in iax.conf when Asterisk loads.  At this time, if it knows the IP address, it will go ahead and start pinging them with this POKE.  It also gets called on a registration.  When a peer registers, Asterisk now knows its IP and can start pinging it.

"The real question is should iax2_poke_peer really return 0 if there is a fixed IP address, and no dnsmgr? I would think a fixed IP would function fine with no dnsmgr."

No, it should not.  However, it doesn't do that.  It only returns early in the case that there is _no_ IP specified, and dnsmgr is not in use, meaning that the address is not going to magically show up at some point in the future.

By: jeffery palmer (darren1713) 2007-08-25 11:54:26

I did a "make distclean ; ./configure ; make ; make install" and it's still crashing. Would you like to have a hand at it?

By: Russell Bryant (russell) 2007-08-25 21:06:02

Sure, if you're willing to let me log in, I'll see if I can figure it out.

By: Russell Bryant (russell) 2007-09-06 17:26:56

Well, since it doesn't happen with the latest version, I'm just assuming this is fixed ... let me know if something comes up again