Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: Notesfiles $Revision: 1.7.0.8 $; site convexs Path: utzoo!watmath!clyde!bonnie!akgua!whuxlm!whuxl!houxm!ihnp4!inuxc!pur-ee!uiucdcs!convex!convexs!hosking From: hosking@convexs.UUCP Newsgroups: net.lang.c Subject: Re: What is wrong with this program? Message-ID: <7000003@convexs> Date: Wed, 14-Aug-85 20:41:00 EDT Article-I.D.: convexs.7000003 Posted: Wed Aug 14 20:41:00 1985 Date-Received: Sun, 18-Aug-85 04:16:55 EDT References: <117@graffiti.UUCP> Lines: 15 Nf-ID: #R:graffiti.UUCP:-11700:convexs:7000003:000:726 Nf-From: convexs.UUCP!hosking Aug 14 19:41:00 1985 Among other things, it looks like you never allocate space for "data" in your program. You have a pointer, but it doesn't point to anything. On a Convex C-1, this leads to a core dump when "fread" tries to do a "bcopy" with a null pointer.... which is invalid as a user address. On VAXen and other machines, null pointers are valid user addresses, which can make finding such problems a lot more difficult. One of the biggest problems in porting 4.2 to a Convex C-1 was exactly this problem... programs tried to use pointers which had never been initialized. Hint: Learn about the program "lint" and use it regularly. It might have saved you a lot of work. Doug Hosking Convex Computer Corp. Richardson, TX