[Ace-users] [ace-bugs] trying to fix an ACE hang

Greg Popovitch gpy at altair.com
Thu Nov 29 15:28:28 CST 2007


YES! I think found exactly this issue:

 

Sun May  5 19:14:34 2002  Douglas C. Schmidt
<schmidt at macarena.cs.wustl.edu>

 

                * ace/Message_Queue_T.cpp: Modified all the enqueue*()
methods so that

                  their calls to notify() occur *outside* of the monitor
lock.

                  This change prevents deadlock from occurring when a
reactor's

                  notification pipe is full.  Thanks to Sasha Agranov

                  <sagranov at COMGATES.co.il> for reporting this.

 

Did it creep back in somehow?

 

greg

 

From: Steve Huston [mailto:shuston at riverace.com] 
Sent: Thursday, November 29, 2007 4:15 PM
To: Greg Popovitch; ace-bugs at cse.wustl.edu
Subject: RE: [ace-bugs] trying to fix an ACE hang

 

Hi Greg,

 

Thanks for the PROBLEM-REPORT-FORM.

 

Doug poked me to see if I remembered this type of problem. Your
description looks familiar - I've a feeling we've been down this road
before, but can't recall the details. Could you please scan through the
ACE_wrappers/ChangeLogs files for changes in this area to see if we've
tried this fix before?

 

Thanks!
-Steve

--
Steve Huston, Riverace Corporation
Want to take ACE training on YOUR schedule?
See http://www.riverace.com/training.htm

	-----Original Message-----
	From: ace-bugs-bounces at cse.wustl.edu
[mailto:ace-bugs-bounces at cse.wustl.edu] On Behalf Of Greg Popovitch
	Sent: Thursday, November 29, 2007 2:23 PM
	To: ace-bugs at cse.wustl.edu
	Subject: [ace-bugs] trying to fix an ACE hang

	Hi,

	 

	I have a hang on Windows Vista 64 and also on linux 64 (RHEL 4).


	 

	One thread is enqueuing a message on an ACE_Message_Queue for
another thread and hangs on the notification to the WFMO reactor. The
ACE_WFMO_Reactor_Notify::notify() hangs because its internal message
queue is full.

	 

	The other thread hangs while checking of the message_queue is
empty because it can't grab its ACE_GUARD. Therefore it can't dequeue
messages from the WFMO_Reactor.

	 

	My question: 

	 

	In file Message_Queue_T.cpp,

	 

	Would it be OK to move the "this->notify ()" outside of the
scope of the ACE_GUARD in:

	 

	template <ACE_SYNCH_DECL> int

	ACE_Message_Queue<ACE_SYNCH_USE>::enqueue_head
(ACE_Message_Block *new_item,

	                                                ACE_Time_Value
*timeout)

	{

	  ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::enqueue_head");

	  int queue_count = 0;

	  {

	    ACE_GUARD_RETURN (ACE_SYNCH_MUTEX_T, ace_mon, this->lock_,
-1);

	 

	    if (this->state_ == ACE_Message_Queue_Base::DEACTIVATED)

	      {

	        errno = ESHUTDOWN;

	        return -1;

	      }

	 

	    if (this->wait_not_full_cond (ace_mon, timeout) == -1)

	      return -1;

	 

	    queue_count = this->enqueue_head_i (new_item);

	 

	    if (queue_count == -1)

	      return -1;

	 

	     this->notify ();  //******** move after closing brace below
??? ******

	  }

	  return queue_count;

	}

	 

	 

	   ACE VERSION: 5.6

	 

	    HOST MACHINE and OPERATING SYSTEM:

	        Vindows Vista

	 

	    TARGET MACHINE and OPERATING SYSTEM, if different from HOST:

	 

	    COMPILER NAME AND VERSION (AND PATCHLEVEL):

	        Visual Studio 2005

	 

	Thanks,

	 

	greg

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://list.isis.vanderbilt.edu/pipermail/ace-users/attachments/20071129/85b846f1/attachment.html 


More information about the Ace-users mailing list