Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site mips.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!decvax!decwrl!Glacier!mips!mash From: mash@mips.UUCP (John Mashey) Newsgroups: net.dcom,net.bugs.uucp Subject: Re: Micom 224+ problems Message-ID: <126@mips.UUCP> Date: Tue, 23-Apr-85 17:23:22 EST Article-I.D.: mips.126 Posted: Tue Apr 23 17:23:22 1985 Date-Received: Thu, 25-Apr-85 03:17:50 EST References: <306@linus.UUCP> <403@mnetor.UUCP> <421@qantel.UUCP> Distribution: net Organization: MIPS Computer Systems, Mountain View, CA Lines: 46 Xref: watmath net.dcom:947 net.bugs.uucp:518 > In article <403@mnetor.UUCP> clewis@mnetor.UUCP (Chris Lewis) writes: > >We are encountering a very similar problem when our Pyramid (BSD4.2 > >uucp) trys to converse with System V's (VME10 and EXORmacs using > >dialup or direct lines). They *always* TIMEOUT. We don't have this > >problem when conversing with other BSD4.2s... > > I believe that this is a different problem. When System V came out, > early Unisoft ports of every flavor had a bug in uucp, whereby they > could only talk to other Unisoft-System-V machines. You have described I also believe this is the (same) different problem, but I believe it is the "notorious" bug in uucp's chksum routine (in pk0.c). Almost all 68K ports have run into this, at least if they started with the MIT C compiler or other compilers that work correctly. Here is the relevant fragment of code: register short sum; register unsigned short t; register short x; if ((unsigned)sum <= t) { sum ^= x; } Of course, (unsigned)sum should have been written (unsigned short)sum. Correct C requires that sum is converted from short->int->unsigned, NOT short -> unsigned short. Here is the corresponding piece of output from the 4.2BSD C compiler: L15: cmpw -2(fp),-4(fp) jgtru L16 xorw2 -6(fp),-2(fp) L16: ret This compiler short-circuited the conversion, yielding the intended, but not correct comparison. The problem does not exist on 16-bit machines, and the bug has masked it on VAXen. Almost everybody doing 68K ports has run into it: their machines would talk among themselves, but wouldn't talk to most others. The fix is of course just the trivial change above. I'm sure numerous hours have been dedicated to this bug; when I was at CT, it took us 2 solid days to find this. An excellent example where being "right" is worse than being wrong, when everybody else is wrong! -- -john mashey UUCP: {decvax,ucbvax,ihnp4}!decwrl!glacier!mips!mash ARPA: mips!mash@SU-Glacier.ARPA DDD: 415-960-1200 USPS: MIPS, 1330 Charleston Rd, Mtn View, CA 94043