🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.next.programmer
Article #842

Sun's XDR routines won't work on Sun machines ...

#842
From: Frank Hartlep
Date: Tue, 08 Sep 1992 14:04
48 lines
2123 bytes
Excuses if this message appears repeatedly, my newsreader isn't
getting my first two tries.

... although they do on a NeXT.
Perhaps somebody can see an error in this code.

                .
                .
                .

        BufferSize += 50000;
        Buffer = malloc (BufferSize);
        Offset = strlen (ARCHIVED) + strlen (Description) + 1 + 4;
        sprintf (Buffer, ARCHIVED "%s", Description);
        xdrmem_create (&Stream, Buffer + Offset, BufferSize - Offset, XDR_ENCODE);
                .
                . 
                .
        (in another function)
        if (Stream->x_op == XDR_ENCODE) {
                if (*Pointer != NULL) {
                        if (! xdr_bool (Stream, &NonNil))   <=== Bus error
                                return -1;
                        Next = 0;
                        if (DescriptionLoop (
                                Stream, Description, Descriptor, Pointer, &Next)
                            == -1)
                                return -1;
                }
                .
                .
                .

Some more info:
1.      The xdr_bool does the first write to the XDR stream, so it's very
        probable that something's wrong with the stream.
2.      The malloc for Buffer was ok, there should be enough memory for
        the stream.
3.      The Stream and NonNil variables seem to be ok, too.

I'm totally clueless. The routines have been heavily used on a NeXT without
any problem, but on a Sun4 (and IPX) they never make it beyond that point.

Any ideas are greatly apreciated.


Frank
Technical Details
Message-ID: <IOT6Y7F@mailgzrz.tu-berlin.de>
Path: arc1-ca.pugleaf.net!sparky!uunet!dtix!darwin.sura.net!Sirius.dfn.de!zrz.tu-berlin.de!opal.cs.tu-berlin.de!mauriti

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!dtix!darwin.sura.net!Sirius.dfn.de!zrz.tu-berlin.de!opal.cs.tu-berlin.de!mauriti
From: mauriti@cs.tu-berlin.de (Frank Hartlep)
Newsgroups: comp.sys.next.programmer
Subject: Sun's XDR routines won't work on Sun machines ...
Message-ID: <IOT6Y7F@mailgzrz.tu-berlin.de>
Date: 8 Sep 92 14:04:52 GMT
Sender: news@mailgzrz.tu-berlin.de (News Manager)
Organization: Technical University of Berlin, Germany
Lines: 48
Nntp-Posting-Host: hivehom.cs.tu-berlin.de