[omniORB] problem shutting down

David Byron dbyron@coactive.com
Mon, 12 Nov 2001 17:22:45 -0800


> I can run eg1 successfully on the same machine on which I
> built it (w/ a 2.2.18pre21 kernel), and it almost runs
> successfuly on my target.  It runs, but then it never exits.
> There have been similar discussions on the mailing list
> already, but I don't think any are the same as this.

I dove into this and found the problem.  I didn't have a loopback =
interface
on my target.  Once I created one, the example ran fine, and exited =
fine.

There's some code in tcpSocketIncomingRope::cancelThreads() that goes =
like
this:

if (connect(tmp_sock,(struct sockaddr *)&myaddr,
          =A0=A0sizeof(struct sockaddr_in)) =3D=3D RC_SOCKET_ERROR)=20
{=A0// OK, so we cannot connect to the rendezvouser, it would have
 =A0// unblock from accept() anyway. That is fine as well.
}

and then the code proceeds to wait for the rendezvouser wakes up from
accept, and exits.

But, the accept never wakes up.  So, this comment isn't really correct.

There are probably lots of difficult solutions to this.  A note in the
readme for eg1 saying that you need a loopback interface would have =
helped
me.  Yes, you could easily argue this is obvious.  Maybe adding a note =
in
the "Setting Up Your Environment" section (1.2 in v3.0.4) would help.  =
Maybe
README.unix or README.linux?

Maybe a PTRACE in the failure case above would help, but I'm not sure =
what
it would say.  In my case, "Do you have a loopback interface?  Run =
ifconfig
and check." would do it, but I don't know when else connect() fails.

Testing for a local loopback either in the example program or somewhere =
in
the orb would probably be tough, but would work as well.  If I get =
motivated
to do that, I'll send in a patch.

There are a few library functions (e. g. gethostname(), =
gethostbyname())
that need to work for eg1 to work.  And, you must have given your box a
hostname.  Maybe the docs could say something about that?

I definitely should have worked this out on my own, and feel like an =
idiot
for not doing it.  I don't mean to gripe about the docs for omniORB.
They're great.  Maybe this will save someone else some grief.

Thanks much.

-DB
---
David Byron                     dbyron@coactive.com
Coactive Networks, Inc.         http://www.coactive.com
28 Liberty Ship Way             voice:(415)289-7800
Sausalito, CA  94965            fax:(415)289-1320