Summary:ASTERISK-18743: Asterisk Crash with host unknown
Reporter:Michele (mickyvoip)Labels:
Date Opened:2011-10-22 04:17:48Date Closed:2011-11-08 11:59:15.000-0600
Versions: Frequency of
is duplicated byASTERISK-19030 Invalid host= declaration causes crash
Environment:linux, fedoraAttachments:( 0) backtrace.txt
( 1) issueA18743-fix_dynamic_exclude_static_bad_host_log.patch
Description:If in sip.conf host is configured with a domain that is not resolved asterisk crash
Comments:By: Michele (mickyvoip) 2011-10-22 06:45:58.784-0500

The crash is due
since the struct v is empty

#0  0x00007f6cd6d812d0 in build_peer (name=0x104ecc0 "pippo", v=0x0, alt=0x0, realtime=0, devstate_only=0) at chan_sip.c:27097

(gdb) print v
$3 = (struct ast_variable *) 0x0

The this call fails
ast_log(LOG_ERROR, "Bad ACL entry in configuration line %d : %s\n", v->lineno, v->value);

By: Paul Belanger (pabelanger) 2011-10-22 10:45:59.136-0500

Thank you for your bug report. In order to move your issue forward, we require a backtrace[1] from the core file produced after the crash. Also, be sure you have DONT_OPTIMIZE enabled in menuselect within the Compiler Flags section, then:

make install

After enabling, reproduce the crash, and then execute the backtrace[1] instructions. When complete, attach that file to this issue report.

[1] https://wiki.asterisk.org/wiki/display/AST/Getting+a+Backtrace

By: Paul Belanger (pabelanger) 2011-10-22 10:46:30.752-0500

Also, please attach a minimal sip.conf file that reproduces the issue.

By: Michele (mickyvoip) 2011-10-22 11:01:00.487-0500

This is part of the sip.conf

host =chepipop.i
disallow = all
allow = ulaw,alaw,gsm,ilbc,g722,g726,g726aal2,g723,g729

By: Michele (mickyvoip) 2011-10-22 11:36:50.649-0500


By: Leif Madsen (lmadsen) 2011-10-31 13:54:40.399-0500

You're also using res_timing_pthread -- you shouldn't use that. Use res_timing_dahdi instead. At the very least use res_timing_timerfd in version or later.

By: Michele (mickyvoip) 2011-11-01 08:10:53.808-0500

I tried with the same result

By: Walter Doekes (wdoekes) 2011-11-07 02:43:23.942-0600

Attached patch should fix it. (I added error=1 in case of enomem in main/acl, unrelated, but I was in the neighbourhood.)

Walter Doekes

By: Michele (mickyvoip) 2011-11-07 12:47:50.045-0600

Hi Walter
yes with the patch the server does not crash
However, something strange happen.
After 6 hours asterisk was not able to register the provider.
My bad, I did the mods and pushed to production I was not able to debug it, since my priority was to put everything online asap, I pushed the old version (1.8.5)