Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site smeagol.smeagol.UUCP Path: utzoo!decvax!tektronix!hplabs!sdcrdcf!trwrb!scgvaxd!wlbr!jplgodo!smeagol!earle From: earle@smeagol.UUCP (Greg Earle) Newsgroups: net.bugs.4bsd,net.news.b Subject: Re: Limits on 4.2BSD lseek(2)? Message-ID: <718@smeagol.UUCP> Date: Fri, 16-May-86 01:06:31 EDT Article-I.D.: smeagol.718 Posted: Fri May 16 01:06:31 1986 Date-Received: Mon, 19-May-86 01:17:43 EDT References: <717@smeagol.UUCP> Distribution: na Organization: JPL, Pasadena CA Lines: 57 Keywords: lseek "Netnews 2.10.3 4.3bsd-beta 6/6/85" Summary: WHOOPS! It wasn't lseek [der ralph!] ; bitten by word alignment In article <717@smeagol.UUCP>, earle@smeagol.UUCP I wrote: > In the Netnews 2.10.3 4.3bsd-beta 6/6/85 distibution, there is a program > called article (written by Peter Honeyman, down!honey) that comes in > the `misc' directory. This program will take an article message ID > (like 1052@ellie, 1424@lll-crg, etc.), look it up in the dbm version > of the news history file, and if it finds it, will print out the > first pathname it finds for the article (if it was cross-posted), by > fetching the line containing the article ID from the history file. [ Example omitted ] > The problem I have found, is that more often than not, the program will > blow up on a Bus Error. This happens on a Sun 2-120 workstation, running > Sun OS 2.0 (4.2BSD based). The cause of this Bus Error is an execution > of lseek(2). No it's not, idiot ... > I am finding that it retrieves some articles with no problem, but most of > them are gagging with the accompaning Bus Error. Like the guy at the school crossing once said: Look both ways before posting. I got bitten by the Famous 680x0 long-pointer-must-be-word-aligned problem ... The program blows up when the pointer value in the datum that is returned by fetch() is odd; i.e. not word aligned. When interpreted as a (long *) and dereferenced, gag city ... Thanks to voder!jeff for pointing this out just as I was realizing it myself. That's what I get for not being a dbm expert, & forgetting Machine Dependencies to boot :-( Hopefully this will get out before I get too much "Geez, what a MAROON" mail. BTW, the fix: Add a long fpos; declaration to main, and before the lseek insert /* The bcopy is NECESSARY to insure alignment on some machines */ bcopy(content.dptr, (char *)&fpos, sizeof (long)); This is from the file funcs2.c, function findhist(); in the 2.10.3 4.3bsd-beta Netnews distribution. Again, my apologies for the original posting. Oh well, maybe some of you got a good laugh out of it, so ... -- Greg Earle UUCP: sdcrdcf!smeagol!earle; (new!!) attmail!earle JPL ARPA: elroy!smeagol!earle@csvax.caltech.edu Hello, GORRY-O!! I'm a GENIUS from HARVARD!!