Go Back   ZeroC Forums > Help Center

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 04-21-2004
kssreeram kssreeram is offline
Registered User
 
 
Join Date: Oct 2003
Posts: 11
Race condition in Outgoing.cpp

Hi

There is a race condition caused assert failure in Outgoing.cpp at line 167. The following is the relevant code fragment:

Code:
	    if(timedOut)
	    {
		//
		// Must be called outside the synchronization of this
		// object.
		//
		_connection->exception(TimeoutException(__FILE__, __LINE__));

		//
		// We must wait until the exception set above has
		// propagated to this Outgoing object.
		//
		{
		    IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
		    
		    while(_state == StateInProgress)
		    {
			wait();
		    }

--> assert fails :    assert(_exception.get());
		}
	    }
The code detects a TimeoutException and sets it in the 'Connection' object, and then waits for it to get propagated to the 'Outgoing' object. But there is race condition where the assert on line 167 may fail. This will be caused if just after the the timeout detection in Outgoing, the remote method call completes successfully. In this case the TimeoutException will not be propagated to the Outgoing object, and thus the assert on line 167 will fail.
As a quickfix to the problem in our application, we have disabled the 'assert' on line 167.
Reply With Quote
  #2 (permalink)  
Old 04-22-2004
marc's Avatar
marc marc is offline
ZeroC Staff
 
Name: Marc Laukien
Organization: ZeroC, Inc.
Project: The Internet Communications Engine
 
Join Date: Feb 2003
Location: Florida
Posts: 1,781
Thanks a lot for spotting this! We will fix this in the next release.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
TimeoutException throws at Outgoing.cpp:183 Yunqiao Yin Help Center 1 11-23-2006 10:32 PM
condition impl on win32 garry Bug Reports 1 04-27-2005 11:25 PM


All times are GMT -4. The time now is 09:57 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0
(c) 2008 ZeroC, Inc.