[asterisk-dev] [Code Review] fix for problem when using t38 gateway, one of two fax sessions of a call gets stuck and dont go away

Mark Michelson reviewboard at asterisk.org
Mon Nov 26 17:14:52 CST 2012


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


This is not the correct fix.

Since "fax show sessions" is showing two duplicate sessions, it means that somehow fax_session_new() is being called twice for the same session. This results in the session being added to the container twice. Your fix ensures that duplicate fax sessions cannot be added to the container, but it does not fix other memory leaks that are present. For instance, a fax_session's channame, debug_info, and chan_uniqueid fields will be overwritten without first being freed if fax_session_new() is called with the same fax session more than once. 

In order to fix this properly, you first need to determine why fax_session_new() is being called more than once for the same fax session. From there, there are two possible fixes:
1) Being able to call fax_session_new() on the same fax session more than once is an error. If it is, then prevent the scenario from happening in the first place.
2) If calling fax_session_new() on the same fax session more than once is actually the correct thing to do, then fax_session_new() needs to be modified to get rid of any possible memory leaks, not just the duplicate container entries.

- Mark


On Nov. 21, 2012, 7:57 p.m., schmidts wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/2205/
> -----------------------------------------------------------
> 
> (Updated Nov. 21, 2012, 7:57 p.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> I have noticed when using t38 gateway function i allways have one stuck fax session of two sessions for each call in "fax show sessions" when the gateway is used.
> 
> by digging into code i have found that the original session object is linked into the faxregistry.container but then will be reused. this stuck session wasnt a real object cause it was used on the second session but it was still hanging around in the container.
> 
> 
> Diffs
> -----
> 
>   branches/10/res/res_fax.c 376583 
> 
> Diff: https://reviewboard.asterisk.org/r/2205/diff
> 
> 
> Testing
> -------
> 
> t38 gateway tested by sending several fax from an asterisk 1.2 with hylafax and got t38 on the other side. Fax sessions are empty when the call is finished and also only one session is shown during a call.
> 
> 
> Thanks,
> 
> schmidts
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20121126/9a28bc69/attachment-0001.htm>


More information about the asterisk-dev mailing list