< Previous by Date Date Index Next by Date >
< Previous in Thread Thread Index  

Re: [reSIProcate] Please give opinion on my solution on "make callcrash"


Dum is not thread safe:
http://wiki.resiprocate.org/wiki/index.php?title=DUM_Threading

If you use DumThread, then you cannot make any other dum calls outside of this 
thread.  You must queue DumCommands (ie. to initiate a new invite), in order 
for this to work properly.

> -----Original Message-----
> From: resiprocate-devel-bounces@xxxxxxxxxxxxxxxxxxx
> [mailto:resiprocate-devel-bounces@xxxxxxxxxxxxxxxxxxx] On Behalf Of
> maodonghu
> Sent: Wednesday, August 23, 2006 9:45 PM
> To: resip
> Subject: [reSIProcate] Please give opinion on my solution on "make
> callcrash"
> 
> resip all
> 
> I had modified the dum source to add serval protection(Guard) on
> following, and my test will never crashed for 1,200,000 calls(just got
> 603).
> 
> 0, add private member variable "Mutex lock" for class
> DialogUasageManager and class HandleManager respectively
> 
> 1, DialogUasageManager.cxx, near line 425
> 
> DialogSet*
> DialogUsageManager::makeUacDialogSet(BaseCreator* creator,
> AppDialogSet* appDs) {
>       Guard guard(lock);
> 
>    if (mDumShutdownHandler)
> 
> 
> 2, DialogUasageManager.cxx, near line 1540
> 
> void
> DialogUsageManager::processRequest(const SipMessage& request) { ....
> case REGISTER:
>          {
>             {
>                DialogSetId id(request);
>                //cryptographically dangerous
>                          Guard guard(lock);
>                assert(mDialogSetMap.find(id) == mDialogSetMap.end());
>             }
> 
> 3,  DialogUasageManager.cxx, near line 1553
> 
>      try
>             {
>                               Guard guard(lock);
> 
>                DialogSet* dset =  new DialogSet(request, *this);
> 
> 
> 4,  DialogUasageManager.cxx, near line 1707
> 
> DialogSet*
> DialogUsageManager::findDialogSet(const DialogSetId& id) {
>       Guard guard(lock);
> 
> 5,  DialogUasageManager.cxx, near line 1747
> 
> void
> DialogUsageManager::removeDialogSet(const DialogSetId& dsId) {
>       Guard guard(lock);
> 
> 
> 6,  DialogUasageManager.cxx, near line 1851
> 
> void
> DialogUsageManager::applyToAllServerSubscriptions(ServerSubscriptionFun
> ctor* functor) {
>       Guard guard(lock);
> 
> 
> 7,  DialogUasageManager.cxx, near line 1870
> 
> void
> DialogUsageManager::applyToAllClientSubscriptions(ClientSubscriptionFun
> ctor* functor) {
>       Guard guard(lock);
>    assert(functor);
> 
> 8, HandleManager.cxx, near line 34
> 
> Handled::Id
> HandleManager::create(Handled* handled)
> {
>       Guard guard(lock);
> 
>    mHandleMap[++mLastId] = handled;
>    return mLastId;
> }
> 
> 9, HandleManager.cxx, near line 76
> 
> void
> HandleManager::remove(Handled::Id id)
> {
>       Guard guard(lock);
> 
>    HandleMap::iterator i = mHandleMap.find(id);
> 
> 
> 10, HandleManager.cxx, near line 108
> 
> bool
> HandleManager::isValidHandle(Handled::Id id) {
>    //!dcm! -- fix; use find
>       Guard guard(lock);
>    return mHandleMap.count(id) != 0;
> }
> 
> 11,  HandleManager.cxx, near line 115
> 
> Handled*
> HandleManager::getHandled(Handled::Id id) {
>       Guard guard(lock);
> 
>    HandleMap::const_iterator i = mHandleMap.find(id);
> 
> 
> >resip all,
> >
> >I made a small program to test outbound call for resiprocate
> >1.0(revision 6527), following is the scenario
> >
> >1, make call to a non-exists DNIS
> >2, dum got onFailure event with 603
> >3, dum got onTerminated event
> >4, repeat 1-3
> >
> >I wanna make 10000 calls to test, but often got error after several
> >call
> >
> >Register SIP Account: "testua"<sip:52412300@xxxxxxxxxxxxxx>
> >Logged in: 2201@xxxxxxxxxxxxxx
> >
> >[Line 0] Got failure response from UAS - 603 [Line 0] call terminated.
> >[Line 1] Got failure response from UAS - 603 [Line 1] call terminated.
> >[Line 2] Got failure response from UAS - 603 [Line 2] call terminated.
> >[Line 3] Got failure response from UAS - 603 [Line 3] call terminated.
> >[Line 4] Got failure response from UAS - 603 [Line 4] call terminated.
> >[Line 5] Got failure response from UAS - 603 [Line 5] call terminated.
> >[Line 6] Got failure response from UAS - 603 [Line 6] call terminated.
> >[Line 7] Got failure response from UAS - 603 [Line 7] call terminated.
> >[Line 8] Got failure response from UAS - 603 [Line 8] call terminated.
> >[Line 9] Got failure response from UAS - 603 [Line 9] call terminated.
> >[Line 10] Got failure response from UAS - 603 [Line 10] call
> >terminated.
> >Assertion failed: 0, file .\HandleManager.cxx, line 114
> >
> >I saw the HandleManager.cxx, line 114, means "Stale handle", can
> anyone
> >help me to avoid this error, because I must get failure reason for
> >every SipCall(it is my own AppDialogSet), so I have to do
> >h->getAppDialogSet().get() in the onFailure callback
> >
> >Attachment is my simple test program, you can compile it in VS.2005,
> MAY BE YOU CAN FIND MY USAGE ERROR ON RESIP!!!
> >
> >Thanks
> >
> >
> >
> >        maodonghu
> >        hhmmdd@xxxxxxx
> >          2006-08-22
> >_______________________________________________
> >resiprocate-devel mailing list
> >resiprocate-devel@xxxxxxxxxxxxxxxxxxx
> >https://list.sipfoundry.org/mailman/listinfo/resiprocate-devel
> 
> 
> 
>         maodonghu
>         hhmmdd@xxxxxxx
>           2006-08-24
> 
> 
> _______________________________________________
> resiprocate-devel mailing list
> resiprocate-devel@xxxxxxxxxxxxxxxxxxx
> https://list.sipfoundry.org/mailman/listinfo/resiprocate-devel