[comp.sys.sun] Need Help with RPC

tjelks@stl-08sima.army.mil (Tammie D. Jelks) (03/27/91)

I am having problems with a SUN-4 (SPARC 4.1 OS) machine.  I've composed a
client/server program using rpcgen to generate the server and the client.
It ran great on a SUN-3 machine, but not on the SUN-4.  

When I run it on the SUN-4, a memory fault core dump appeared.  A trace
was ran against the core, and it gave me a SIGSEGV error message.  I was
told that the data alignment on the SUN-4 was very strict, but not on the
SUN-3 and that the 16 bit buffer was full.  

How do I go about fixing the data alignment? or How do I take care of this
problem.

Tammie Jelks                     tjelks@stl-08sima.army.mil
US AMC SIMA

jhc@iris.brown.edu (James H. Coombs) (04/02/91)

In article <2190@brchh104.bnr.ca> tjelks@stl-08sima.army.mil (Tammie D. Jelks) writes:

>client/server program using rpcgen to generate the server and the client.
>
>When I run it on the SUN-4, a memory fault core dump appeared.  A trace
>was ran against the core, and it gave me a SIGSEGV error message.  I was
>told that the data alignment on the SUN-4 was very strict, but not on the
>SUN-3 and that the 16 bit buffer was full.  
>
>How do I go about fixing the data alignment? or How do I take care of this
>problem.

I have had no problems with Sun's RPC on a variety of Sun 4s, SPARCs, Mac
IIs, etc.  RPC uses XDR, which handles data alignment.  You might look for
NIL pointers in your data.  xdr_pointer() can handle them, but
xdr_reference() cannot.  Also, watch out for strings.  If you use
xdr_string() on a NIL (as opposed to ""), then you can expect SEGV.

If this does not help, you might post more information--at least your RPC
program.