[asterisk-dev] [Code Review]: Don't run the atexit functions more than once

Terry Wilson reviewboard at asterisk.org
Mon Jan 9 00:15:10 CST 2012



> On Jan. 9, 2012, 12:11 a.m., Terry Wilson wrote:
> > Actually, I think just doing the locks like I did would make it so that you can't preempt a previous 'core stop gracefully' with a 'core stop now' so that won't work. I'll have to think about it some more and see what I can come up with.

Might be able to do an unlock/lock around the sleep, but I'm too tired to really give it the thought it deserves right now.


- Terry


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


On Jan. 8, 2012, 11:50 a.m., Terry Wilson wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/1658/
> -----------------------------------------------------------
> 
> (Updated Jan. 8, 2012, 11:50 a.m.)
> 
> 
> Review request for Asterisk Developers, wdoekes and Matt Jordan.
> 
> 
> Summary
> -------
> 
> Asterisk can get multiple calls to the quit_handler from different threads. This can result in the atexit functions running multiple times. In one case, this causes multiple calls to the xmlCleanupParser() function which causes a double free and crash. I initially tried to handle things in quit_handler, but only succeeded in making some consoles never exit. :-)
> 
> 
> This addresses bug ASTERISK-18883.
>     https://issues.asterisk.org/jira/browse/ASTERISK-18883
> 
> 
> Diffs
> -----
> 
>   /trunk/main/asterisk.c 350018 
> 
> Diff: https://reviewboard.asterisk.org/r/1658/diff
> 
> 
> Testing
> -------
> 
> Threw tons of asterisk -rx "core stop gracefully" calls in a loop at a bunch of 'asterisk -vvvgc' instances that were also starting in loops until it crashed. After the patch, it stopped crashing.
> 
> 
> Thanks,
> 
> Terry
> 
>

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


More information about the asterisk-dev mailing list