Summary:ASTERISK-19361: Asterisk exited on signal 6: Related to sip show peers?
Reporter:Jamuel Starkey (jamuel)Labels:
Date Opened:2012-02-14 13:54:34.000-0600Date Closed:2012-02-22 08:54:19.000-0600
Versions: Frequency of
One Time
is related toASTERISK-19231 Abort signal 6 raises when using 'sip show peers' with realtime peers
is related toASTERISK-18423 Crash in AMI initiated sip show peers
Environment:Attachments:( 0) backtrace.txt
( 1) core-2012-02-07T110524-0800.gz
Description:Saw a segfault on a server that had Don't Optimize and Debug Threads enabled.  Asked Matt Jordan on IRC if he wanted to see if it was related to the patch he was developing on Review Board (https://reviewboard.asterisk.org/r/1738/).

Uploading core for review.
Comments:By: Jamuel Starkey (jamuel) 2012-02-14 13:55:38.311-0600

Gzipped core.

By: Jamuel Starkey (jamuel) 2012-02-14 15:30:29.224-0600

Backtrace uploaded.

By: Jamuel Starkey (jamuel) 2012-02-14 15:32:58.958-0600

Backtrace created with # gdb -se "asterisk" -ex "bt full" -ex "thread apply all bt" --batch -c my_core > /tmp/backtrace.txt

By: Matt Jordan (mjordan) 2012-02-14 17:13:30.596-0600

Looks to be related to ASTERISK-19231, as the object count of the number of peers in the container is less then the total number of peers added to the array (which would be indicative of this failure)

By: Matt Jordan (mjordan) 2012-02-20 10:54:50.902-0600

Do you mind testing the patch sip_show_peers_2012_02_16.diff on ASTERISK-19231?

By: Jamuel Starkey (jamuel) 2012-02-21 15:13:11.832-0600

Tested supplied patch with by running two different shells executing:

(Shell 1) {{# while [ 1 ]; do asterisk -rx "sip show peers"; done}}

(Shell 2) {{# while [ 1 ]; do echo reload;asterisk -rx "reload chan_sip.so"; done}}

Prior to the patch--asterisk would fall-over a few times per minute (with safe_asterisk auto restarting).  The back traces all pointed to the same failure exhibited in the original bug report.

After the patch no segfaults seen for over an hour.

Please note that the supplied patch did *NOT* apply cleanly.  Hunks #2 and #3 both had issues that were trivial and easily corrected by modifying the original {{chan_sip.c}} source.  It appears that at lines 16473/16474 (just after {{int k;}} and at lines 16500/16501 (just after {{ast_cli(fd, FORMAT2, "Name/username", "Host", "Dyn", "Forcerport", "ACL", "Port", "Status", (realtimepeers ? "Realtime" : ""));}} that there are double linefeeds rather than a single linefeed that is assumed in the supplied diff.  Removing one linefeed from each pair allowed the patch to apply cleanly ({{patch -p0 -l}})

By: Jamuel Starkey (jamuel) 2012-02-21 15:14:02.401-0600

See last comment.