[Home]

Summary:ASTERISK-23103: [patch]Crash in ast_format_cmp, in ao2_find
Reporter:JoshE (n8ideas)Labels:
Date Opened:2014-01-06 13:38:45.000-0600Date Closed:2014-03-27 13:28:26
Priority:CriticalRegression?
Status:Closed/CompleteComponents:Formats/General
Versions:11.7.0 Frequency of
Occurrence
Related
Issues:
is duplicated byASTERISK-23339 Segfault in __ao2_find at astobj2.c, in find_interface at format.c
Environment:Attachments:( 0) ast_register_cleanup-formats.patch
( 1) backtrace.txt
( 2) format-shutdown-segv.patch
( 3) format-shutdown-segv-r2.patch
Description:I am seeing a crash in ao2_find in the ast_format_helper function.  It's possible this is related to ASTERISK-22875.

It's possible that this is related to the addition of SIP_CODEC_INBOUND and SIP_CODEC_OUTBOUND to the dialplan.
Comments:By: JoshE (n8ideas) 2014-01-06 13:39:04.382-0600

Full backtrace is attached.

By: Rusty Newton (rnewton) 2014-01-08 14:24:07.984-0600

@JoshE,

Thanks for the backtrace, can you provide a little information about when the crash occurs. Especially if you know how to reproduce it or can provide Asterisk logs with DEBUG and VERBOSE type messages up to the crash?

By: Corey Farrell (coreyfarrell) 2014-01-20 07:19:44.188-0600

find_interface does not check for interfaces==NULL, causing ao2_find to segfault when called after format_attr_shutdown. This happens when shutting down fast with active channels.

Originally posted to duplicate ticket ASTERISK-23147.

By: Rusty Newton (rnewton) 2014-02-07 10:21:52.521-0600

Thanks Corey!

JoshE can you confirm the patch fixes your issue?

By: Corey Farrell (coreyfarrell) 2014-02-07 10:29:44.018-0600

@wdoekes pointed out that my first patch is not thread safe.

format-shutdown-segv-r2.patch should resolve this bug and the thread safety issue by leaving the interfaces container untouched when shutting down with channels active.