[reSIProcate] Threading issues in DUM

Scott Godin slgodin at icescape.com
Sat Jun 2 08:26:04 CDT 2007


You are right, DUM is not thread safe.  See the following wiki page for more info:
http://www.resiprocate.org/DUM_Threading
 
Cheers,
Scott

________________________________

From: resiprocate-devel-bounces at list.resiprocate.org on behalf of Richard Stellingwerff
Sent: Sat 6/2/2007 8:01 AM
To: resiprocate-devel at list.resiprocate.org
Subject: [reSIProcate] Threading issues in DUM


Hi,

I may have found some threading issues in the Dialog Usage Manager. I've written a little application that stress tests my VOIP server. It dials a SIP user, then when it rings it hangs up. Once it's hung up, it calls again, and so forth, endlessly. 

Inside a worker thread, I call _uacDum->process() etc. to handle the incoming data.

>From the main thread, I create and send requests (invite, etc.) using _uacDum->send(_uacDum->makeInviteSession(...)). 


With this stress-test application, I get random crashes. Sometimes after a minute, sometimes after 10 minutes. The crashes seem to happen most often in DialogUsageManager::makeUacDialogSet. More specifically, it crashes at this code: 

    mDialogSetMap[ds->getId()] = ds;

My guess is that this crash happens because inside the worker thread, DUM is removing DialogSets from that hashmap, while the main thread is simultaneously adding them. Looking at the DUM code, I see no sort synchronization whatsoever, which could confirm my suspicion. 

I know this email is short on details, but I was wondering if I could be on the right track here. Maybe I should be calling _uacDum->makeInviteSession() etc. from the same thread that's calling _uacDum->process() ? 

I really hope someone could give me a clue here. Thanks in advance.

Kind regards,
Richard.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.resiprocate.org/pipermail/resiprocate-devel/attachments/20070602/feaa558a/attachment.htm>


More information about the resiprocate-devel mailing list