From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,f8db1f48b9952904,start X-Google-Attributes: gidfee84,public X-Google-ArrivalTime: 1993-06-29 08:34:33 PST Newsgroups: comp.unix.osf.osf1 Path: gmd.de!xlink.net!howland.reston.ans.net!usc!cs.utexas.edu!uunet!anagld!aplcen.apl.jhu.edu!ddsdx2.jhuapl.edu!jbp From: jbp@ddsdx2.jhuapl.edu (John Phelps) Subject: Problems using recv with dynamically mallocd mem (Alpha OSF) Message-ID: <1993Jun29.133329.13675@aplcen.apl.jhu.edu> Summary: Can't use dynamically allocated memory with the recv call. Keywords: alpha,osf/1,malloc,recv,socket Sender: news@aplcen.apl.jhu.edu (USENET News System) Organization: Johns Hopkins University Date: Tue, 29 Jun 93 13:33:29 GMT I know that *SOMEBODY* has tried this out there ... I've got a socket server program that allows us to write clients that can communicate with each other via messages based on content tags at the beginning of each message. Since each message is variable length, the socket server program must peek at the header of each message and then malloc a buffer of the specified size to recv directly into. Well guess what ! I can't get the @$%*#$*& thing to work on the Alpha. It currently executes (properly) on SunOS and Ultrix and *ALMOST* works on the Alpha. By almost I mean connections are made, clients think they're transmitting packets, the server attempts to route null packet, but I cannot get the recv call to actually read data into the malloced buffer. The error I'm being returned is: [EFAULT] The data was directed to be received into a nonexistent or pro- tected part of the process address space. The buffer parameter is invalid. Is there some parameter I'm missing when calling the malloc routines or should I be building with the BSD compatibility libs instead of the standard C lib functions ? BTW, I *KNOW* that I own the data buffer returned by the malloc function because of information I store in the header and trailer of each message buffer. Any help or a simple, "Look moron *smack* ....", will suffice. Not having gdb and not realizing dbx needs money thrown at it before it'll work has been a hinderance, but we're getting there. Thanks. -- John Phelps, jbp@ddsdx2.jhuapl.edu OR jbp@raven.jhuapl.edu