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

Terry Wilson reviewboard at asterisk.org
Sat Jan 7 15:42:09 CST 2012


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

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
-----

  /branches/1.8/main/asterisk.c 349967 

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/20120107/67c85bf7/attachment.htm>


More information about the asterisk-dev mailing list