[reSIProcate] Weird problem with Mutex

Alexander Altshuler alt at kaluga.ru
Wed Jun 21 01:20:28 CDT 2006


It works. VS 7.1

 

-----Original Message-----
From: resiprocate-devel-bounces at list.sipfoundry.org
[mailto:resiprocate-devel-bounces at list.sipfoundry.org] On Behalf Of Matthias
Moetje - TERASENS GmbH
Sent: Wednesday, June 21, 2006 4:51 AM
To: resiprocate-devel at list.sipfoundry.org
Subject: RE: [reSIProcate] Weird problem with Mutex

 

Could perhaps anyone using Visual Studio 8.0 (or maybe 7.1) be so kind

to paste these few lines of code into basicRegister to see if this problem

can be reproduced if compiled in release config?

Thanks,

Matthias 

 


  _____  


From: resiprocate-devel-bounces at list.sipfoundry.org
[mailto:resiprocate-devel-bounces at list.sipfoundry.org] On Behalf Of Matthias
Moetje - TERASENS GmbH
Sent: Friday, June 16, 2006 11:22 PM
To: resiprocate-devel at list.sipfoundry.org
Subject: [reSIProcate] Weird problem with Mutex

Hi,

 

I was finally able to find a minimal piece of code to reproduce 

an issue I am fighting against during the last days. To reproduce

you just need to paste the following code to the start of the 

main() function in basicRegister for example:

 


  _____  


#include "resip/dum/UserAuthInfo.hxx"


  _____  


resip::SipStack* mStack;
resip::DialogUsageManager* mDum;

mStack = new resip::SipStack();
mDum = new resip::DialogUsageManager(*mStack);

mDum->addTransport(UDP,5060);
mDum->addTransport(TCP,5060);

UserAuthInfo* msg = new UserAuthInfo("asd","asd","asd","asd");
mDum->post(msg); 


  _____  


Now, the following happens during mDum->post:

in TransactionUser::post(Message* msg), mFifo.add is called.

then in TimeLimitFifo<Msg>::add it constructs the lock object:

Lock::Lock(Lockable & lockable, LockType lockType)

in this constructor, I get an access violation when it tries to 
call myLockable.lock();

When I examine the myLockable I can see that the virtual function
pointers seem corrupted:



Usually (that means, when post is called from the dum or stack 
thread in my application) in the vfptr[] array I can see valid pointers,
but in this case they are wrong.

The mID (Windows Critical Section structure) member of the
Mutex (which inherits from Lockable) seems to remain OK, 
just the vfptr to the base methods  is wrong.

I don't really have an idea why this is happening and I feel like 
banging my head gainst the wall. In my application everything works
fine. If I put a breakpoint in one of these functions during normal
operation (inbound, outbound calls, client registration etc.), the
lockable is always OK, but as soon as I call mDum->post 
manually, the lockable seems to be damaged and I get an access
violation exception.

If I compile the application in debug mode, the problem does not exist!

I am using VS 2005. Here are the relevant configuration settings I 
am using for basicRegister:

Optimization: Disabled
Inline Function Expansion: Default
Favor Size or Speed: Neither
Omit Frame Pointers: No
Enable String Pooling: No
Runtime Library: Multi-threaded DLL
Buffer security check: Yes

Linker:

Generate Debug Info: Yes
References: Default
Enable COMDAT Folding: Default
Link time Code Generation: Use Link Time CG

I would be very thankful for any comments as I am running out of
ideas on this subject (apart from implementing a simple critical 
section directly without the lockable and mutex objects).

Thanks and best regards,

Matthias Moetje





TERASENS GmbH
Augustenstraße 24
80333 Munich
GERMANY

 


Phone:
Fax:
e-mail:
Web:

 

+49.89.143370-0
+49.89.143370-22
 <mailto:info at terasens.com> info at terasens.com
 <http://www.terasens.com/> www.terasens.com

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.resiprocate.org/pipermail/resiprocate-devel/attachments/20060621/e10b8b18/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.jpg
Type: image/jpeg
Size: 24834 bytes
Desc: not available
URL: <http://list.resiprocate.org/pipermail/resiprocate-devel/attachments/20060621/e10b8b18/attachment.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.jpg
Type: image/jpeg
Size: 2937 bytes
Desc: not available
URL: <http://list.resiprocate.org/pipermail/resiprocate-devel/attachments/20060621/e10b8b18/attachment-0001.jpg>


More information about the resiprocate-devel mailing list