[asterisk-dev] [Code Review]: Fix a crash in res_ais

Russell Bryant reviewboard at asterisk.org
Mon Sep 12 09:58:07 CDT 2011



> On Sept. 12, 2011, 9:55 a.m., Matthew Nicholson wrote:
> > Looks good, but is there some underlying bug that causes events with the wrong size?

I don't think so.  I think it's something weird (bug, I guess) happening down in OpenAIS.  poll() says there's data that needs to be handled but then when the callback gets called to deliver an event into Asterisk, there's no data there.  It happens pretty rarely compared to the amount of event traffic and there doesn't seem to be any problems if we just ignore this case.


- Russell


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


On Sept. 8, 2011, 7:31 p.m., Russell Bryant wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/1423/
> -----------------------------------------------------------
> 
> (Updated Sept. 8, 2011, 7:31 p.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> This patch resolves a crash observed in a load testing environment that
> involved the use of the res_ais module.  I observed some crashes where
> the event delivery callback would get called, but the length parameter
> incidcating how much data there was to read was 0.  The code assumed
> (with good reason I would think) that if this callback got called, there
> was an event available to read.  However, if the rare case that there's
> nothing there, catch it and return instead of blowing up.
> 
> More specifically, the change always ensure that the size of the received
> event in the cluster is always big enough to be a real ast_event.
> 
> 
> Diffs
> -----
> 
>   /branches/1.8/include/asterisk/event.h 335012 
>   /branches/1.8/main/event.c 335012 
>   /branches/1.8/res/ais/evt.c 335012 
> 
> Diff: https://reviewboard.asterisk.org/r/1423/diff
> 
> 
> Testing
> -------
> 
> I ran about 120,000 calls through a couple of systems that had this patch.
> 
> 
> Thanks,
> 
> Russell
> 
>

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


More information about the asterisk-dev mailing list