[asterisk-dev] [Code Review] Pickup segfault when multiple pickups of multiple localchan calls

mjordan reviewboard at asterisk.org
Fri Aug 5 09:15:48 CDT 2011


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



trunk/include/asterisk/channelstate.h
<https://reviewboard.asterisk.org/r/1353/#comment7839>

    Adding a new channel state seems like it would have a rather large impact.  What tests have you done to ensure that adding a new state a channel can be in doesn't impact any other Asterisk dialplan functions or applications?
    
    Fix comment as well to be "Line is being picked up"



trunk/include/asterisk/features.h
<https://reviewboard.asterisk.org/r/1353/#comment7842>

    Provide a doxygen comment with \brief, \param, and \returns fields



trunk/main/channel.c
<https://reviewboard.asterisk.org/r/1353/#comment7837>

    Remove your name from the error statement, as well as all the "===" signs.  Your error statement should be formatted in the same manner as other Asterisk error statements.



trunk/main/channel.c
<https://reviewboard.asterisk.org/r/1353/#comment7838>

    Remove the commented lines of code.  Comments should also always use C-style comments; not C++ style.



trunk/main/features.c
<https://reviewboard.asterisk.org/r/1353/#comment7840>

    This could be reduced to:
    
    return (ast_channel_datastore_find(chan, &packup_active, NULL) != NULL);



trunk/main/features.c
<https://reviewboard.asterisk.org/r/1353/#comment7841>

    This method now has a fairly large side effect, in that a channel can be in a down state and can be transitioned to AST_STATE_PICKUP.  Previously this method just checked whether or not a channel could be picked up; now it changes the state.
    
    What impacts does this have?


- mjordan


On Aug. 5, 2011, 4:27 a.m., Alec Davis wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/1353/
> -----------------------------------------------------------
> 
> (Updated Aug. 5, 2011, 4:27 a.m.)
> 
> 
> Review request for Asterisk Developers and rmudgett.
> 
> 
> Summary
> -------
> 
> If ast_can_pickup() can pickup the channel, it needs to change the chan->_state to AST_STATE_PICKUP.
> 
> Example dialplan below causes a segfault as ast-hangup removes the same channel as is being picked up.
> 
> How to crash it!
>   dial 801 from 1 phone.
>   from 2 phones simultaneously dial 800.
>   segfault!
> 
> exten => 801,1,NoOp(Local pickup debug: Ring Phones) 
> exten => 801,n,Dial(Local/823 at en-phone&Local/824 at en-phone)
> 
> exten => 800,1,NoOp(Local pickup: Pickup through Localchan call)
> exten => 800,n,Dial(Local/824 at en-pickup&Local/823 at en-pickup)
> 
> [en-pickup]
> exten => _[0-9*#]!, 1, PickupChan(Local/${EXTEN}@en-phone)
> 
> [en-phone]
> exten => _[0-9*#]!, 1, Dial(SIP/gxp-${EXTEN},20,rwt)
> 
> will remove red blobs, and perhaps ast_pickup_active() test.
> 
> 
> This addresses bug ASTERISK-18222.
>     https://issues.asterisk.org/jira/browse/ASTERISK-18222
> 
> 
> Diffs
> -----
> 
>   trunk/include/asterisk/channelstate.h 330704 
>   trunk/include/asterisk/features.h 330704 
>   trunk/main/channel.c 330704 
>   trunk/main/features.c 330704 
> 
> Diff: https://reviewboard.asterisk.org/r/1353/diff
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Alec
> 
>

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


More information about the asterisk-dev mailing list