From: ken@cs.cornell.edu (Ken Birman)
Subject: Re: well, so much for pmaxen...
Organization: Cornell Univ. CS Dept, Ithaca NY 14853
Date: Fri, 13 Nov 1992 14:05:29 GMT

In article <8f0kRje00h5KEND0Ro@cs.cmu.edu> Sean.Levy@cs.cmu.edu writes:
>After moving my RDBMS to a pmax and firing up ISIS, I attempted to fire
>up my RDBMS backend process:
>---
>loos/p1:/usr/isis/spool [Thursday 12 Nov 8:21pm]
>116 % backend+ix+EXP+DEBUG
>NOTICE: dbbe_monitor called -- group view...
>*** Group /ndim/db/backend has 1 members on these machines:
>pid 4618 (backend+ix+EXP+DEBUG) was killed on an unaligned access, at pc
>0x41365
>0
>Bus error (core dumped)
>loos/p1:/usr/isis/spool [Thursday 12 Nov 8:21pm]
>117 % dbx `which backend+ix+EXP+DEBUG` core
>dbx version 2.10.1
>Type 'help' for help.
>Corefile produced from file "backend+ix+EXP+DEBUG"
>Child died at pc 0x413650 of signal : Bus error
>reading symbolic information ...
>[using memory image in core]
>(dbx) where
>>  0 isis_getstats(0xbe2, 0x100784ec, 0x100784cc, 0x0, 0x4005e0)
>["../../clib/cl
>_isis.c":3477, 0x41364c]
>   1 isis_gethostname(0xbe2, 0x100808b0, 0x1, 0x0, 0x4003c4)
>["../../clib/cl_isi
>s.c":3516, 0x4138a4]
>   2 .block1 ["../../../../../src/ndim/db/backend.c":388, 0x4005dc]
>   3 dump_gv(gv = 0x10080898)
>["../../../../../src/ndim/db/backend.c":388, 0x400
>5dc]
>   4 dbbe_monitor(gview_p = 0x10080898, arg = 0)
>["../../../../../src/ndim/db/ba
>ckend.c":257, 0x4003c0]
>   5 pg_pwatch_invoke(0x0, 0x0, 0x0, 0x0, 0x0)
>["../../clib/cl_pgroup.c":423, 0x
>41967c]
>   6 invoke(0x0, 0x0, 0x0, 0x0, 0x0) ["../../clib/cl_task.c":686, 0x417914]
>   7 task_swtch(0x0, 0x0, 0x0, 0x0, 0x0) ["../../clib/cl_task.c":562, 0x4173d0]
>-----
>Wonderful. This is Ultrix 4.2, decstation 5000/200, ISIS 3.0.5. Any idears?

I don't have ISIS V3.0.5 online from where I am looking at this, but
in V3.0.7 this makes no sense.  The arguments to isis_getstats are:
static
isis_getstats(ap, where, len, hispid)
  address *ap;
  char *where;
  int *hispid;

... so we can see that hispid (which the code dereferences) is being
passed as a null pointer.  But, the caller looks like:

void
isis_gethostname(ap, where, len)
  address *ap;
  char *where;
  {
        int hispid;
        isis_getstats(ap, where, len, &hispid);
  }

... which obviously shouldn't pass a null 4th argument.  Looks like
either V3.0.5 has a problem in isis_gethostname (if so, I don't recall
it) or that the compiler is totally wacko.

My guess is that there was some problem in V3.0.5 -- that release is from
a while ago and lots of little things have been fixed.  

As a work-around on this particular thing, here's how the code for these
routines looks in V3.0.7:


static
isis_getstats(ap, where, len, hispid)
  address *ap;
  char *where;
  int *hispid;
  {
        static char name[128];
        static pid;
        static address who;
        static inside;
        static condition want_in;
        if(inside)
            t_wait_l(&want_in, "isis_getstats:wantin");
        inside = 1;
        if(addr_isequal(&who, ap))
            *hispid = pid;
        else
        {
            if(!addr_isrclient(ap) && !addr_isdclient(ap))
            {
                /* In this case, it's easy */
                if(site_names_len == 0)
                    t_wait_l(&isis_want_snames, "waiting for site-names info");
                strcpy(name, site_names[ap->addr_site]);
                *hispid = ap->addr_process;
            }
            else
            {
                *hispid = -1;
                strcpy(name, "**timeout**");
                if(cbcast_l("T5", ap, GENERIC_GETHOSTNAME, "", 1, "%s,%d", name,
 hispid) != 1)
                    goto done;
            }
            who = *ap;
        }
        if(strlen(name)+1 < len)
            len = strlen(name)+1;
        if(where)
            bcopy(name, where, len);
  done:
        if(t_waiting(&want_in))
            t_sig(&want_in, 0);
        else
            inside = 0;
  }

void
isis_gethostname(ap, where, len)
  address *ap;
  char *where;
  {
        int hispid;
        isis_getstats(ap, where, len, &hispid);
  }

... so, you can include this right into your program, in the limit, 
by changing names.

-- 
Kenneth P. Birman                              E-mail:  ken@cs.cornell.edu
4105 Upson Hall, Dept. of Computer Science     TEL:     607 255-9199 (office)
Cornell University Ithaca, NY 14853 (USA)      FAX:     607 255-4428
Newsgroups: comp.sys.isis