[OpenAFS-devel] OpenAFS-1.2.10 on hp_ux11i

Douglas E. Engert deengert@anl.gov
Wed, 05 Nov 2003 11:37:07 -0600


We have OpenAFS running on hp_ux110 with 32 and 64 bit kernels,
and ia64_hpux1122 with the 64 bit kernel.

I have built it for hp_ux11i previously and have had it running on
a 32 bit kernel. (The machine is no longer available.)

I have now rebuild it on hp_ux11i with 64 bit kernel and it panics when afsd 
is started. 

Looking at a crash dump, it appears that the osi_NetSend routine
in rx/HPUX/rx_knet.c calls the HP kernel routine, sosend, with some
bad data, and this causes the panic. 

The code in the rx/HPUX.rx_knet.c is identical across all the releases. 

I am looking for ideas and mainly for the definition and documentation on 
the kernel allocb, sosend and soreceive routines which are not defined 
in any of the headers. 

The rx_knet.c code looks strange but works on other releases, see below 
for more commants on this.

The trace event shows, with my coments in []:

crash event was a panic
panic+0x6c
report_trap_or_int_and_panic+0x94
trap+0xefc                           [A trap stats the panic]
nokgdb+0x8                           [The check is looking to see if there is a debuger running]
so_check_inb_conn_conf+0x30          [looks like sosend is checking some of its paramerters]
sosend+0x3d0                         [The AFS routine calls the HP kernel routine]
osi_NetSend+0x15c                    
rxi_SendPacket+0x204
rxi_SendList+0xb24
rxi_SendXmitList+0x3d4
rxi_Start+0xb98
rxi_FlushWrite+0x414
rxi_ReadProc+0x12c
rx_ReadProc32+0x230
xdrrx_getint32+0x38
afs_xdr_char+0x9c
afs_xdr_vector+0x60
xdr_uvldbentry+0x48
VL_GetEntryByNameU+0xc4
afs_NewVolumeByName+0x2e0
afs_GetVolumeByName+0x2d4
afs_CheckRootVolume+0x15c
afs_Daemon+0x5f8
afs_syscall_call+0x288
Afs_syscall+0xa0
coerce_scall_args+0xe0
syscall+0x750                    [afsd is calling the kernel just after starting.] 
$syscallrtn+0x0    
    

The rx/HPUX/rx_knet.c has, my comments in []:


/* steal decl from sgi_65 */                   [Was this oriinally from SGI?]
int
osi_NetSend(asocket, addr, dvec, nvec, asize, istack)
     register struct socket *asocket;
     struct iovec *dvec;
     int nvec;
     register afs_int32 asize;
     struct sockaddr_in *addr;
     int istack;
{
    struct uio uio;
    MBLKP bp;
    struct iovec temp[RX_MAXWVECS];
    int code;
    int size = sizeof(struct sockaddr_in);

    /* Guess based on rxk_NewSocket */                  [Was this really a guess??]
    bp = allocb((size+SO_MSGOFFSET+1), BPRI_MED);      

        [Why is the SO_MSGOFFSET being used? Iit does not relate to the MBLKP 
	being returned. Could this be the problem, or maintance to some header 
        caused this to change? A side note some other AFS HPUX routines use 
        allocb_wait.]

										 
    if (!bp) return ENOBUFS;        
    memcpy((caddr_t)bp->b_rptr+SO_MSGOFFSET, (caddr_t)addr, size); 
    bp->b_wptr = bp->b_rptr + (size+SO_MSGOFFSET+1);

    memcpy((caddr_t)temp, (caddr_t)dvec, nvec * sizeof(struct iovec));

    /* devresource.hp.com/Drivers/Docs/Refs/11i/ddRef/Chap02R.pdf has details
       on use of uio */                                 [This URL is not found.]
    memset((caddr_t)&uio, 0, sizeof(uio));
    uio.uio_resid   = asize;
    uio.uio_iov     = temp;
    uio.uio_iovcnt  = nvec;
    uio.uio_seg     = UIOSEG_KERNEL;

    code = sosend(asocket, bp, &uio, 0, 0, 0, size);
    return code;                                        [bp is never freed? should it be?]					
}

-- 

 Douglas E. Engert  <DEEngert@anl.gov>
 Argonne National Laboratory
 9700 South Cass Avenue
 Argonne, Illinois  60439 
 (630) 252-5444