[asterisk-dev] [Code Review]: Segfault on shutdown when confbridge is active

opticron reviewboard at asterisk.org
Thu Jul 7 15:34:22 CDT 2011



> On June 27, 2011, 11:10 a.m., David Vossel wrote:
> > trunk/apps/app_confbridge.c, lines 1041-1071
> > <https://reviewboard.asterisk.org/r/1283/diff/2/?file=17261#file17261line1041>
> >
> >     Out of curiosity, is this crash occurring just because the "underlying channel" is NULL in this function?  If so we should be able to detect that and exit from this function without trying to play a file to a non existent channel.
> 
> opticron wrote:
>     Actually, I think underlying_channel is a dangling pointer to a nulled out channel.  The actual segfault occurs when dereferencing a null tech in ast_channel_setoption.
> 
> David Vossel wrote:
>     This sounds like a ref counting issue of some sort then.  We just need to make sure that channel and the channel driver can not go out from underneath us on shutdown until we are done with them.  Modules can be ref counted if that is the source of the issue.

Ref counting the modules wouldn't help since the module unload isn't causing the channels to go away.  The call to ast_begin_shutdown from the "core stop now" handler is what knocks the channels out, because the user wants it all to come down now rather than later.


- opticron


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


On June 27, 2011, 9:34 a.m., opticron wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/1283/
> -----------------------------------------------------------
> 
> (Updated June 27, 2011, 9:34 a.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> When undergoing a shutdown and channels are kicked out of a bridge, a segfault occurs because ConfBridge tries to play sounds on the bridge after the underlying channels have been blown away due to the shutdown.  This patch prevents ConfBridge from playing any additional sounds if Asterisk is shutting down.
> 
> 
> This addresses bug ASTERISK-18040.
>     https://issues.asterisk.org/jira/browse/ASTERISK-18040
> 
> 
> Diffs
> -----
> 
>   trunk/apps/app_confbridge.c 324709 
> 
> Diff: https://reviewboard.asterisk.org/r/1283/diff
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> opticron
> 
>

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


More information about the asterisk-dev mailing list