[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference pamsrc::objectbroker_development

Title:ObjectBroker Development - BEA Systems' CORBA
Notice:See note 2 for kit locations; note 4 for training
Moderator:RECV::GUMBELd
Created:Thu Dec 27 1990
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:2482
Total number of notes:13057

2316.0. "OBB 2.6 on Windows - TCP Socket use" by THEBAY::VASKAS (Mary Vaskas) Tue Sep 03 1996 18:17

T.RTitleUserPersonal
Name
DateLines
2316.1ENQUE::SLAVINWed Sep 04 1996 12:473
2316.2THEBAY::VASKASMary VaskasWed Sep 04 1996 15:362
2316.3THEBAY::VASKASMary VaskasThu Sep 05 1996 16:595
2316.4Are there sockets in TIME_WAIT state?RECV::VLATASWARNING: Do not swallow the battery doorFri Sep 06 1996 14:2552
2316.5THEBAY::VASKASMary VaskasMon Sep 09 1996 13:515
2316.6Trace log.... THEBAY::VASKASMary VaskasTue Sep 10 1996 14:2229135
2316.7Some object references were not getting completely releasedRECV::VLATASWARNING: Do not swallow the battery doorTue Sep 17 1996 07:598
2316.8THEBAY::VASKASMary VaskasTue Sep 17 1996 14:108
2316.9VAXCPU::michaudJeff Michaud - ObjectBrokerWed Apr 02 1997 22:2037
> Just a little more info -- apparently it was object references which were
> duplicated, and now to release any object reference the code needs to
> loop/repeat releasing until an error message is returned.

	Yikes!  This is bad programming practice.  How do you know
	that other pieces of your code are still not holding a pointer
	to the object reference?  Ie. if you need to do multiple releases
	to really release the object then it's likely someone is still
	holding a pointer to the object they believe is valid.  If not,
	then the real bug is that whoever received a duplicate of the
	object is not release()ing their copy when they are done with it
	(follow your code paths from where-ever you call _duplicate or
	_narrow on an object reference, keeping in mind that a successful
	_narrow does an implied _duplicate for you).

	And so far you are also only lucky that you haven't corrupted
	your heap or crashed by calling release() on a pointer to an
	object reference that had already been freed by the ORB because
	the previous call to release was the one that reduced the reference
	count to zero.  Ie. on the call to release() that you are getting
	an error on, you have passed it a pointer to memory that has
	already been returned to the heap (or may have even been returned
	to the system if the allocator supports shrinking the heap).
	And you are only lucky an error is being detected at all (the
	memory has not been re-allocated to someone else and what the
	ORB believes is the location of the reference count upon
	entry to release() is zero.  Also note that the OMG Revision task
	force has modified the definition of release() so that it can
	no longer throw exceptions, and hence the Environment argument
	to release() will likely be deprecated in a future release.

	If you are using C++ bindings, you should consider looking at
	using the class CORBA::Object_var as an aid in having release()
	called automatically on the object reference when the Object_var
	instance goes out of scope (as appropriate of course, you don't
	want to end up in the opposite of your current situation and
	instead release()ing the references too soon).