Re: panel error *** ORBit patch ***




I and, apparently others are getting this error consistently on certain
machines.

On Mon, 10 Aug 1998, Mikal Mikal wrote:
> this is strange, i compiled orbit and gnome-libs and gnome-core without 
> problems, but when i run the panel i get:
> 
> # ./panel
> message: Initializing CORBA for panel
> 
> 
> ** ERROR **: sigsegv caught
> 
> 
> 
> it worked fine at home, but i get this error in two machines at work.
> any idea about what's the problem?

If you run gdb panel, it says that the segmentation fault comes in the
file connection.c.  The problem is that a program using ORBit, on startup,
does the following things:

  1) Gets the local machine's hostname
  2) Resolves it to an IP address
  3) Resolves the IP address back to a name
  4) Uses the resulting name

If your machine name does not DNS properly, and has no entry in
/etc/hosts, step 2 will set a pointer to null, and step 3 will fail with
a segmentation fault, similar to how Mico did.  In addition, if your
machine does not reverse DNS properly (as many peoples machines don't),
step 3 will set a null pointer, and step 4 will fail with a segmentation
fault.

Attached is a patch to ORBit-0.2.  Note that the patch will NOT work with
the current CVS version.  The CVS version has changed the section to take
an errror message out, and the patch will not go in.  I patched against
version 0.2 because I could verify that the patch works.  I get another
segmentation fault later on in the CVS version.

The patch changes the above behavior to the following:
  1) Removed
  2) Removed
  3) Removed
  4) Use the name "localhost"

This should work even if networking on your machine is really screwed up,
as long as you can "ping localhost".  I doubt that this is the right way
to do it, since the patch probably turns ORBit into a non-networked
version, but at the moment, but it's a temporary fix while we don't have
any critical networked applets. 

In my opinion, ORBit is pickier about having a proper network setup than
mico is.  Many people don't have proper network setups.  Where I work, via
pointy-haired boss decision, I am not ALLOWED to have DNS or reverse DNS
on the network.  I did not complain during the mico days, since there was
little we could do about it, but I consider ORBit segfaulting under iffy
network setups a bug.  I don't mind if it refrains from talking to other
machines when it can't check the networking, but it has to at least work
locally.

-Gleef
diff -uNr ORBit-0.2.orig/src/IIOP/connection.c ORBit-0.2/src/IIOP/connection.c
--- ORBit-0.2.orig/src/IIOP/connection.c	Wed Aug  5 15:05:06 1998
+++ ORBit-0.2/src/IIOP/connection.c	Wed Aug 12 16:20:49 1998
@@ -389,16 +389,7 @@
     n = sizeof(struct sockaddr_in);
     getsockname(server_cnx->fd, &server_cnx->location, &n);
 
-    hn_tmp[64] = '\0';
-    gethostname(hn_tmp, 64);
-    hent = gethostbyname(hn_tmp);
-    if(!hent) {
-      g_warning("Couldn't find FQDN of this host [%s]. Your /etc/hosts file needs work.", hn_tmp);
-      goto failed;
-    }
-    hent = gethostbyaddr(hent->h_addr, 4 /* hent->h_length - security hole */, AF_INET);
-
-    server_cnx->hostname = g_strdup(hent->h_name);
+    server_cnx->hostname = g_strdup("localhost");
 
     listen(server_cnx->fd, 5);
 


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