[Home]

Summary:ASTERISK-22416: [patch] Segmentation fault (in process_applicationmap_line, at features.c) when using improper feature mapping syntax
Reporter:CGI.NET (nsnake)Labels:
Date Opened:2013-08-28 04:21:47Date Closed:2013-09-17 20:38:01
Priority:MajorRegression?
Status:Closed/CompleteComponents:Resources/res_features
Versions:1.8.23.0 11.4.0 Frequency of
Occurrence
Constant
Related
Issues:
Environment:Centos 6.4 Linux 2.6.32-358.11.1.el6.i686 #1 SMP Wed Jun 12 01:01:27 UTC 2013 i686 i686 i386 GNU/LinuxAttachments:( 0) asterisk-22416-check-syntax-first_v2.diff
( 1) asterisk-22416-dynamic-feature-check-syntax-first.diff
( 2) backtrace.txt
Description:In features.conf
I set the error syntax look like

[applicationmap]
automon=*6

when restart asterisk will crash and see 'Segmentation fault'.

normal
[applicationmap]
automon=*6,self/both,AGI,agi://127.0.0.1/automon
is ok.
Comments:By: Michael L. Young (elguero) 2013-08-28 10:05:33.313-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: Rusty Newton (rnewton) 2013-08-28 15:26:09.996-0500

I went ahead and grabbed a backtrace for this. Attaching backtrace.txt

By: Michael L. Young (elguero) 2013-08-28 16:24:04.495-0500

Thanks Rusty!

Try this patch out and see if that solves this segfault.

By: Michael L. Young (elguero) 2013-08-28 21:29:00.586-0500

Umm... isn't that what my patch did?  Why did you upload a whole file as well as a patch?

Can you confirm that the original patch, [^asterisk-22416-dynamic-feature-check-syntax-first.diff], was the correct fix?

By: CGI.NET (nsnake) 2013-08-28 21:33:22.559-0500

Thanks Rusty Newton and Michael L. Young, It's resolved. but not perfect, because have some warning when make it

By: CGI.NET (nsnake) 2013-08-28 21:36:20.378-0500

Hi Michael L. Young,  your path had an warn 'activateon is undefined' so i had some edit.

By: CGI.NET (nsnake) 2013-08-28 21:43:26.423-0500

Michael L. Young:
I delete my path, but the difference is:
+
+ activateon = strsep(&args.activatedby, "/");
+    
+ if (ast_strlen_zero(args.app)
+                || ast_strlen_zero(args.exten)
+                || ast_strlen_zero(activateon)
+                || ast_strlen_zero(var->name)) {
+                ast_log(LOG_NOTICE,
+                        "Please check the feature Mapping Syntax, either extension, name, or app aren't provided %s %s %s %s\n",
+                        args.app, args.exten, activateon, var->name);
+                return;
+        }
+

By: Michael L. Young (elguero) 2013-08-28 22:08:06.560-0500

CGI.NET

Thanks for the feedback.  That was very helpful.  I just uploaded a second patch that fixes the compile error that you were getting.

Thanks again and we will work on getting this into the code base.