[Home]

Summary:ASTERISK-24322: Asterisk crashes on execution when compiled with MALLOC_DEBUG compiler flag - in region_data_wipe at astmm.c
Reporter:Rusty Newton (rnewton)Labels:
Date Opened:2014-09-11 18:13:07Date Closed:2017-10-23 15:42:50
Priority:CriticalRegression?Yes
Status:Closed/CompleteComponents:Core/General
Versions:SVN Frequency of
Occurrence
Constant
Related
Issues:
Environment:Asterisk SVN-branch-11-r422903 Description: Ubuntu 12.04.4 LTS 3.5.0-54-generic #81~precise1-Ubuntu SMP Tue Jul 15 04:05:58 UTC 2014 i686 i686 i386 GNU/Linux gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)Attachments:( 0) asterisk.conf.txt
( 1) backtrace.txt
Description:h1. Reproduction:

* Compile Asterisk SVN-branch-11-r422903 with MALLOC_DEBUG compiler flag.
* Attempt to execute Asterisk with commands such as {{asterisk}} or {{asterisk -gcvvvv}}, both result in the same output of {{Segmentation fault (core dumped)}}
* Asterisk crashes! Claims a core is dumped, but no core is dumped.

{noformat}
root@rnewton-office-lab:/tmp# asterisk -gcvvvvv
Privilege escalation protection disabled!
See https://wiki.asterisk.org/wiki/x/1gKfAQ for more details.
Segmentation fault (core dumped)
{noformat}

I'm running as root, permissions are of course fine.

Recompiling with DONT_OPTIMIZE results in Asterisk running fine.
Recompiling without DONT_OPTIMIZE results in the crash again (MALLOC_DEBUG is still selected).
Recompiling without MALLOC_DEBUG results in Asterisk running fine.
Wiped config files, used samples made with "make samples", same crash.
Recompiled after a "make uninstall", same crash.

Attaching backtrace obtained from running Asterisk with gdb attached.
Comments:By: Rusty Newton (rnewton) 2014-09-12 09:45:19.836-0500

I wiped the /etc/asterisk/ directory and ran a make samples before getting the backtrace, but I'm attaching asterisk.conf regardless.

By: Walter Doekes (wdoekes) 2014-09-17 10:15:51.457-0500

Cannot reproduce with gcc 4.8.2-19ubuntu1.

As for the dumped core that is not dumped, check your `sysctl kernel.core_pattern`.

By: Walter Doekes (wdoekes) 2014-10-09 04:59:16.192-0500

Rusty: does this happen with trunk as well?

By: Rusty Newton (rnewton) 2014-10-31 14:15:58.975-0500

Taking a look at this today. I'll let you know.

By: Rusty Newton (rnewton) 2014-11-14 17:52:59.454-0600

Just kidding! How about today?

Tested again on SVN-branch-11-r427874, still occurs.

Tested on Trunk r427932, same gcc version and OS versions, the issue *does not* occur.

My core pattern is the same on both the Ubuntu machines I use:

{noformat}
|/usr/share/apport/apport %p %s %c
{noformat}

With that pattern I get the core file dumped in the current working directory with any typical Asterisk crash.

For testing, I modified the pattern to simply {{core}} and there is still no core dumped.


By: Corey Farrell (coreyfarrell) 2017-10-23 15:42:50.969-0500

Since 11 is out of support and this was fixed in trunk as of Nov 2016 I'm marking this fixed.  I suspect it was fixed by creation of astmm.h libc wrapper macro's.