[asterisk-dev] [Code Review] 2743: quickfix against ast_log infinite recursion when out of memory

wdoekes reviewboard at asterisk.org
Tue Aug 6 03:55:08 CDT 2013



> On Aug. 5, 2013, 5:51 p.m., Matt Jordan wrote:
> > /trunk/main/pbx.c, lines 8222-8224
> > <https://reviewboard.asterisk.org/r/2743/diff/1/?file=43786#file43786line8222>
> >
> >     So, I think the actual log message fix is okay.
> >     
> >     This, however, is *** dangerous ***
> >     
> >     While MALLOC_DEBUG is a build option used for debugging purposes, this still essentially adds what amounts to an auto-DOS command to Asterisk. Toss in the number of people who expose the 'command' class authorization on their AMI accounts, and you have a recipe for something frightening.
> >     
> >     I'm potentially fine keeping it in as a handy 'test that you system can survive running out of memory' - but if so, let's just #ifdef 0 the whole block.

Haha :D

I hadn't intended on leaving the code in there just like that, no.

I left it in the review so people could test it if they wanted. Like suggested on IRC, it might be appropriate in the TEST_FRAMEWORK autodestruct module. But I'll #ifdef 0 it out for now.


- wdoekes


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/2743/#review9335
-----------------------------------------------------------


On Aug. 5, 2013, 5:11 p.m., wdoekes wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/2743/
> -----------------------------------------------------------
> 
> (Updated Aug. 5, 2013, 5:11 p.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Repository: Asterisk
> 
> 
> Description
> -------
> 
> Dirty quickfix to tackle ast_log() killing the asterisk when we're out of memory.
> 
> I don't like this fix at all. But I like the problem even less.
> 
> If anyone has a better idea, do come forward. (Aside from fixing the problem that caused me to run out of memory in the first place. But that's for another day.)
> 
> 
> Diffs
> -----
> 
>   /trunk/include/asterisk/utils.h 396181 
>   /trunk/main/pbx.c 396181 
>   /trunk/main/utils.c 396181 
> 
> Diff: https://reviewboard.asterisk.org/r/2743/diff/
> 
> 
> Testing
> -------
> 
> When MALLOC_DEBUG is disabled,
> 
> CLI> core eat memory
> 
> did what it's supposed to do: without the patch, asterisk crashed (stack full). With it, it didn't.
> 
> 
> Thanks,
> 
> wdoekes
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20130806/e8de281e/attachment.htm>


More information about the asterisk-dev mailing list