RE: graceful mulit-threaded shutdown



Hi Tyler,

On Fri, 2003-11-14 at 19:45, Tyler Kohn wrote:
> So, I'm making progress.  after getting things set up to debug correctly, I
> found that I was getting the "must shut down from main thread" error because
> when I was calling CORBA_ORB_destroy.  my init_level was always greater than
> 0 so this was just returning and not shutting down.

	Interesting. Can you confirm that you are using a recent ORBit2 eg. the
just released ORBit2-2.9.1 which has a _load_ of shutdown related
problems fixed (mostly by Justin Schoeman) - that's the best place to
start for debugging these problems.

> in do_unref since the refs value became junk when the RootObject was no
> longer a valid object.

	Ah; ok.

>   Thanks Michael and Lace for the help and pointers to
> figure this out. It didn't initially occur to me to destroy the object since
> I knew it was still being referenced, although it does make sense to remove
> the client's reference to it.

	:-)


> ** (process:3361): WARNING **: CORBA_ORB_destroy: ORB still has 2 refs.
> 
> ** (process:3361): WARNING **: ORB: a total of 1 refs to ORB objects were
> leaked

	Ok - if you compile ORBit2 with --enable-debug (perhaps you did this
already), then export ORBIT2_DEBUG=refs, then re-run - it should show
you the type of object that is leaked - which may help.

> I'm pretty sure this has to do with me not completely cleaning up my client.
> If I don't create the client, the warnings don't appear and it shuts down
> without a peep.

	Right; so you need to binary chop the reference leak out. Ultimately
you're missing a CORBA_Object_release (foo, NULL); somewhere.

> I've started to walk though the duplicate and do_unref methods in the
> debugger, but they are called quite a bit more than is simple to follow.  my
> client stuff is fairly vanilla, I get a refence to the orb:

	Heh :-)

	Are you just missing a:

		CORBA_Object_unref (orb, ev);

	If you dig at ORBit2/test/everything/client.c you can see what that
does for shutdown.

	HTH,

		Michael.

-- 
 michael@ximian.com  <><, Pseudo Engineer, itinerant idiot




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]