[Ace-users] [ace-users] Testing application with purify the ACE::mutex(in OS_NS_Thread.cpp, function:cond_signal ) is going to infinite loop...
Douglas C. Schmidt
schmidt at dre.vanderbilt.edu
Thu Nov 15 22:11:32 CST 2007
Hi Syed,
Thanks for using the PRF.
> ACE VERSION: 5.5
ACE 5.5 is old. Please upgrade to ACE+TAO+CIAO x.6.1 (i.e., ACE 5.6.1, TAO 1.6.1, and
CIAO 0.6.1), which you can download from
http://download.dre.vanderbilt.edu
under the heading: "Latest Beta Kit."
The DOC groups at Washington University, UC Irvine, and Vanderbilt
University only provide "best effort" support for non-sponsors for the
latest release, as described in
http://www.dre.vanderbilt.edu/~schmidt/DOC_ROOT/ACE/docs/ACE-bug-process.html
Thus, if you need more "predictable" help for earlier versions of
ACE+TAO, I recommend that you check out
http://www.dre.vanderbilt.edu/support.html
for a list of companies that will provide you with ACE+TAO commercial
support.
>*********************************
> HOST MACHINE and OPERATING SYSTEM:
> Microsoft Windows XP Professional(Version 5.1.2600 Service Pack 2
>Build 2600 )
> winsock.dll Version 3.10
> wsock32.dll Version 5.1.2600.2180 (xpsp_sp2_rtm.040803-2158)
>*********************************
> TARGET MACHINE and OPERATING SYSTEM, if different from HOST:
> Linux
>*********************************
>
> COMPILER NAME AND VERSION :
> Microsoft Visual C++ 7.1.3088 (.NET 2003 , .NET Frame work
>1.1.4322)
>
> Purify Version : IBM Rational Purify Version 7.0.0.0 build :
>7264
>
>*********************************
>
>
> THE $ACE_ROOT/ace/config.h FILE
> #define ACE_HAS_STANDARD_CPP_LIBRARY 1
> #include "ace/config-win32.h"
>*********************************
>
> THE $ACE_ROOT/include/makeinclude/platform_macros.GNU FILE - NA
>
>********************************
>
> CONTENTS OF $ACE_ROOT/bin/MakeProjectCreator/config/
>default.features - NA
>
>********************************
>
> AREA/CLASS/EXAMPLE AFFECTED:
>
> In "ACE_wrappers\ace\OS_NS_Thread.cpp"
>
>Line No : 1403
>
>Code :
>
> ACE_OS::thread_mutex_lock (&cv->waiters_lock_);
>
> int have_waiters = cv->waiters_ > 0;
> ACE_OS::thread_mutex_unlock (&cv->waiters_lock_);
>
> printf("exit from unlock\n");
>
> if (have_waiters != 0)
> {
> return ACE_OS::sema_post (&cv->sema_);
>
> }
> else
> return 0; // No-op
>
>********************************
>
> DOES THE PROBLEM AFFECT:
> COMPILATION?
> LINKING?
> EXECUTION?
> OTHER
>
> PROBLEM AFFECTS IN execution, when run with purify in release mode
>*******************************
>
> SYNOPSIS: mutex is under Infinite number of loops . control is
>not coming outof the function ==> "ACE_OS::cond_signal (ACE_cond_t
>*cv) " when testing with purify in release mode.
>
>Purify Version : IBM Rational Purify Version 7.0.0.0 build :7264
>***********************************************************************************************
>
> DESCRIPTION:
>If i run our application in Debug mode(VC7.1) WithOut purify Its
>working fine
>
>If i run our application in Release mode(VC7.1) WithOut purify Its
>working fine
>
>If i run our application in Debug mode(VC7.1) with Purify Its
>working fine
>
>If i run our application in Release mode(VC7.1) with Purify then while
>its connecting to
>the sever , it goes to infinite loop & its not comming out of the
>Connect API
>
>When I Trace The Code(our library & ACE code ) , I come to Now problem
>is in ACE
>
>In "(Version 5.5) ACE_wrappers\ace\OS_NS_Thread.cpp" file , Control
>is not coming out of the function "ACE_OS::cond_signal (ACE_cond_t
>*cv) " (Line No : 1403)
>
>Code snippet of ACE:
>
> ACE_OS::thread_mutex_lock (&cv->waiters_lock_);
>
> cout<<"Enter Lock"<<endl; // I add this Line
>
> int have_waiters = cv->waiters_ > 0;
> ACE_OS::thread_mutex_unlock (&cv->waiters_lock_);
>
> cout<<"Exit UnLock"<<endl // I add this Line;
>
> if (have_waiters != 0)
> {
> cout<<"Inside have_waiters "<<endl; // I add this Line
> return ACE_OS::sema_post (&cv->sema_);
>
> }
> else
> return 0;
>
>
>After adding 3 cout statement i build the ACE dll in release mode and
>when i run our application With Purify in Release mode, then that 3
>statements are continuously printing ( Control is not comming out of
>"cond_signal" function. even after 10 Hours!).
>
>
>Purify Version : IBM Rational Purify Version 7.0.0.0 Build :7264
>
>
> SAMPLE FIX/WORKAROUND: In File OS_NS_Thread.cpp ( from line No
>1403)
>
>
>
> ACE_OS::thread_mutex_lock (&cv->waiters_lock_);
>
> cout<<"Enter Lock"<<endl; // I add this Line
>
> int have_waiters = cv->waiters_ > 0;
> ACE_OS::thread_mutex_unlock (&cv->waiters_lock_);
>
> cout<<"Exit UnLock"<<endl // I add this Line;
>
> if (have_waiters != 0)
> {
> cout<<"Inside have_waiters "<<endl; // I add this
>Line
> return ACE_OS::sema_post (&cv->sema_);
>
> }
> else
> return 0;
>
>
>Output got when i run our application in VC7.1 in Release mode with
>Purify7.0 is
>
>Infinite number of the lines which i added to ACE file
>OS_NS_Thread.cpp (as in above)
>
>
>Output:
>
>----------
>connecting to the server //Its in our application
>
>Enter Lock
>Exit UnLock
>Enter Lock
>Exit UnLock
>Inside have_waiters
>
>Enter Lock
>Exit UnLock
>Enter Lock
>Exit UnLock
>Inside have_waiters
>
>.....
>.... Infinite Nuber of times get same lines , Not coming back to our
>application
>********************************
>Plz help me to Resolve this problem
It sounds to me like the problem is with Purify, not ACE. If
upgrading to ACE 5.6.1 doesn't fix the problem I recommend you contact
IBM for support with Purify.
Thanks,
Doug
--
Dr. Douglas C. Schmidt Professor and Associate Chair
Electrical Engineering and Computer Science TEL: (615) 343-8197
Vanderbilt University WEB: www.dre.vanderbilt.edu/~schmidt
Nashville, TN 37203 NET: d.schmidt at vanderbilt.edu
More information about the Ace-users
mailing list