Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!ucsd!helios.ee.lbl.gov!ncis.tis.llnl.gov!lll-winken!sun-barr!newstop!sun!nibroc.Eng.Sun.COM!corbin From: corbin@nibroc.Eng.Sun.COM (John Corbin) Newsgroups: comp.protocols.nfs Subject: Re: bug in sun-3/os4.1 rpc/xdr? Message-ID: <140608@sun.Eng.Sun.COM> Date: 14 Aug 90 06:45:18 GMT References: <90225.174053BACON@MTUS5.BITNET> Sender: news@sun.Eng.Sun.COM Reply-To: corbin@sun.UUCP (John Corbin) Organization: Sun Microsystems, Mountain View Lines: 15 X-Local-Date: 13 Aug 90 23:45:18 PDT In article <90225.174053BACON@MTUS5.BITNET> BACON@MTUS5.BITNET (Jeffery Bacon) writes: >... >For this, I've written the following server procedure: > >-------------- >int *bla_1(oog) int *oog; { int erg = 5; printf("%d\n",*oog);return(&erg); } >-------------- You need to declare erg to be a static variable. Your bla_1() routine is returning the address of an automatic variable. As to why it works on some machines and not others, I would guess that for some the area on the stack gets modified and for others it doesn't. John Corbin (jcorbin@Sun.COM) Sun Microsystems