[OpenAFS-devel] OpenAFS-1.2.10 on hp_ux11i

Douglas E. Engert deengert@anl.gov
Thu, 06 Nov 2003 13:16:01 -0600


Thanks, your suggesting appears to fix the problem. 

I added similiar code to the rx_kcommon.c. I am now trying the same code
on hp_ux110, hp_ux11i and ia64_hpux1122. If it works, I will be submitting
the changes.

The hp_ux11i system I was using has all the latest maintance which may have 
introduced the problem.    


Srikanth Vishwanathan wrote:
> 
> > 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.
> 
> We had a similar problem and we got help from HP - they informed us that
> the crash was because our socket was not associated with a file structure.
> Apparently, HPUX assumes that a socket is always associated with a file
> which it tries to dereference somewhere in their code.
> 
> We added this to rxk_NewSocket for HP:
> 
> ---- code snippet start ----
> 
> fp = falloc();
> if (!fp) {
>         goto error;
> }
> 
> /* Get the file descriptor so we can free the file if there is an
>  * error
>  */
> fd = (int) u.u_r.r_val1;
> 
> /* Initialize the file */
> fp->f_flag = FREAD | FWRITE;
> fp->f_type = DTYPE_SOCKET;
> fp->f_ops  = &socketops;
> 
> /* And associate it with the socket */
> fp->f_data = (void *) newSocket;
> newSocket->so_fp = (void *) fp;
> 
> error:
>     if (fd >= 0) {
>         uffree(fd);
>     }
> 
>     /* Free other resources */
> 
> ---- code snippet end ----
> 
> We don't store the allocated file descriptor (which is required
> to free the file), so we'll leak a file if we ever free the socket.
> Fortunately, we don't ever free the socket in the client.
> 
> Srikanth.

-- 

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