Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!uwm.edu!psuvax1!psuvm!cunyvm!ndsuvm1!mtus5!bacon From: BACON@MTUS5.BITNET (Jeffery Bacon) Newsgroups: comp.protocols.nfs Subject: bug in sun-3/os4.1 rpc/xdr? Message-ID: <90225.174053BACON@MTUS5.BITNET> Date: 13 Aug 90 22:40:53 GMT Organization: Computing Technology Services, Michigan Technological Univ. Lines: 70 I submit the following problem: Given the following declaration (taken just about right out of the Sun 4.1 netowrk prog guide) bla.x: ------------- program BLAPROG { version BLAVERS {int BLA(int) = 1; } = 1; } = 0x20000099; -------------- This should send an integer and receive an integer. For this, I've written the following server procedure: -------------- int *bla_1(oog) int *oog; { int erg = 5; printf("%d\n",*oog);return(&erg); } -------------- (please forgive my lack of formatting, but this is pretty simple; I wrote it on the fly) And for the client side, a simple little program: ----------------- #include #include #include "bla.h" main() { CLIENT *bla; int *result, oog; bla=clnt_create("ctsee8",BLAPROG,BLAVERS,"tcp"); oog=44; result=bla_1(&oog,bla); printf("%d\n",*result); } ----------------- Now I take and compile all of this. I should expect the server to print the number 44, and the client should return the number 5. Simple enough. (I copied the code out of the book as much as possible.) Now, when I run the server on my os4.1 sparc, it works fine, whether I run run the client on a sun3 or sun4. But when I run the server on a sun-3... the server prints out 44 like it should, but the client prints out some ridiculous number, again whether or not the client is run on a sun-3 or sun-4. I've tried this on a 4.0.3 and 4.1 sun-3, and it still breaks. The reason I got into this is because I am writing an app that returns a lot of integers, returns a string in one place, and also some structures. Again, when I run the server on a sun-4, everything is happy, and I get all the right results (tested on sun-3, sun-4, and a sequent balance running dynix 3.0.17). But when I run the server on a sun-3, the integer- and string-returning functions don't return the right value. The odd thing (to me) is that the struct-returning ones (well, pointer-to-struct) STILL WORK JUST FINE. I have no real idea why. Am I doing something wrong? I thought I might have been for a while (I ran across this while working on my program, which isn't rpcgenned code, so I thought it was my code), but if even this simple program breaks...or is this an "official bug" that I don't know about? Your time is greatly appreciated. Jeffery Bacon -- Computing Technology Svcs., Michigan Technological University email- bacon@mtus5.bitnet voice: (906)487-2110 fax: (906)487-2787 alternate- uucp: !itivax!anet!bacos domain: bacos%anet@itivax.iti.org