Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/5/84; site tove.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!think!harvard!seismo!umcp-cs!tove!steve From: steve@tove.UUCP (Steve D. Miller) Newsgroups: net.unix Subject: Re: rcs blows up on suns Message-ID: <328@tove.UUCP> Date: Tue, 10-Sep-85 23:36:52 EDT Article-I.D.: tove.328 Posted: Tue Sep 10 23:36:52 1985 Date-Received: Thu, 12-Sep-85 12:13:23 EDT References: <830@panda.UUCP> <1075@sdcsvax.UUCP> <961@sdcsla.UUCP> <967@sdcsla.UUCP> <2772@sun.uucp> Reply-To: steve@tove.UUCP (Steve D. Miller) Distribution: net Organization: U of Maryland, Laboratory for Parallel Computation, C.P., MD Lines: 54 In article <2772@sun.uucp> guy@sun.uucp (Guy Harris) writes: >> As I stated in my original reply, dereferencing zero is always >> a bad idea, even though it `works' (returns 0) on Vaxen. So, >> it isn't Sun's fault per se, and I don't think RCS is really >> a supported product of Sun Microsystems... (anyone from Sun >> care to comment on this?). > >RCS is not a supported product of Sun Microsystems. SMI doesn't distribute >RCS on any of its standard distribution tapes. > >Here's a fix to "rcs.c" to keep it from dropping core (this fix was >originally discovered on another 68000-family machine which prohibits >dereferencing null pointers): > >*** rcs.c.broken Sun Sep 8 15:25:18 1985 >--- rcs.c Sun Sep 8 15:26:51 1985 >*************** >*** 982,988 > dummy.nextlock=next=Locks; > trail = &dummy; > while (next!=nil) { >! numr = strcmp(num, next->delta->num); > if ((whor=strcmp(who,next->login))==0 && > (num==nil || numr==0)) > break; /* found a lock */ > >--- 982,989 ----- > dummy.nextlock=next=Locks; > trail = &dummy; > while (next!=nil) { >! if(num!=nil) >! numr = strcmp(num, next->delta->num); > if ((whor=strcmp(who,next->login))==0 && > (num==nil || numr==0)) > break; /* found a lock */ > > Guy Harris I think that there are a goodly number of null pointer/strcmp bugs in rcs; we had a minimally version that no one pushed too hard until recently, when some of these bugs began to pop up. Delving into the source, I found a *lot* of places that looked like they potentially had this bug; I'm pretty sure that I had to fix one (not the one above) just to get it to run at all back when I first brought it up here. Since I was feeling lazy and in a hurry, I just wrote another strcmp that does relatively intelligent things with null pointers and changed the makefile so that everything that looked suspicious had my version linked in. I readily admit that I should have tracked down all the potential strangenesses and fixed them individually, but it looks like it'd take a lot of time to do and I'm swamped as it is... -Steve