[asterisk-dev] [Code Review] Prevent 'Bad Magic Number' caused when a channel is optimized out by masquerade

Stefan Schmidt sst at sil.at
Sat Sep 18 03:58:58 CDT 2010


Am 18.09.2010 04:39, schrieb Alec Davis:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/928/
> -----------------------------------------------------------
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> there are 2 main fixes here.
> 
> 1). Prevent a further masquerade being planned if either original/clonechan(masq/masqr) are set.
> 2). While the actual masquerade happens keep the channels container locked for the full duration. 
> 
> There is a comment 'that the channels container can be freed' after both channels are locked and unlink, but that not the case.
> 
> 
> This addresses bug 16057.
>     https://issues.asterisk.org/view.php?id=16057
> 
> 

hello,

i am not sure if this locking for a longer time just block the problem
instead of solving it.
for me it looks like the bad magic number happens directly after the
link of the channel/s into the container again. if this channel is still
in there a link into the container will just replace it in there, but
only if the hash value (channel name) is not changed.
but the channel name is changed atleast so it couldnt be found in there.
normaly it should just be added to the container, but it looks like
something else (which would be blocked from the container lock) do
something with these channels so it could not be identified to be
replaced but also not being treaded as a new channel.

i am not sure about this, but thats how i have understand the ao2
containers and how its descripted in the astobj2.h file
(http://www.asterisk.org/doxygen/asterisk1.6.2/astobj2_8h-source.html#l00124)

best regards

steve



More information about the asterisk-dev mailing list