[asterisk-dev] [Code Review] Use loader flag to solve ABI differences of DEBUG_THREADS

Kevin Fleming reviewboard at asterisk.org
Mon Jan 3 12:14:55 UTC 2011


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


The functionality you've added already exists; the loader checks the MODFLAG_SUM and won't load modules that have different sums. The underlying issue here was caused by the fact that this facility is optional (modules can choose not to provide a sum, and thus always be loaded), and the primary producer of binary modules for Asterisk chooses that option to avoid having to produce a myriad of different builds of the modules.

Given that this change resulted in a significant increase in memory consumption, and the change was made primarily to benefit users of Digium's binary modules, we'll have to have a discussion this week about how best to address this problem. Stay tuned.

- Kevin


On 2011-01-02 19:31:42, Tilghman Lesher wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/1066/
> -----------------------------------------------------------
> 
> (Updated 2011-01-02 19:31:42)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> Eight months ago, a fix went in to solve the problem of loading modules that were compiled with a different value of DEBUG_THREADS than the core Asterisk binary, which results in differences in the structure of a mutex.  Unfortunately, this did not take into account the size of the mutex structure, especially as it pertains to chan_iax2.  The result is that chan_iax2, starting with 1.8, now takes up 100MB of memory.  This is primarily due to the 3016 bytes used for each mutex, which is in each astobj2, and we allocate 32767 of them at boot, one for each possible IAX2 source number.  This change backs out that changeset and instead adds a flag to the loader, to ensure that the value of DEBUG_THREADS for each module loaded is the same value as was compiled for the core Asterisk binary.
> 
> 
> This addresses bug 18194.
>     https://issues.asterisk.org/view.php?id=18194
> 
> 
> Diffs
> -----
> 
>   /branches/1.8/include/asterisk/lock.h 300043 
>   /branches/1.8/include/asterisk/module.h 300043 
>   /branches/1.8/main/astobj2.c 300043 
>   /branches/1.8/main/heap.c 300043 
>   /branches/1.8/main/loader.c 300043 
>   /branches/1.8/main/lock.c 300043 
> 
> Diff: https://reviewboard.asterisk.org/r/1066/diff
> 
> 
> Testing
> -------
> 
> Compiled Asterisk both with and without DEBUG_THREADS, and for each, added a module to the directory that was from the opposite DEBUG_THREADS status.  As predicted, Asterisk refused to load the module with a different compile-time setting of DEBUG_THREADS.
> 
> 
> Thanks,
> 
> Tilghman
> 
>

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


More information about the asterisk-dev mailing list