Article View: comp.text
Article #3670Re: Documenter's WorkBench 2.0.0.0.0
From: mao
Date: Sun, 12 Apr 1987 23:05
Date: Sun, 12 Apr 1987 23:05
34 lines
2239 bytes
2239 bytes
In article <16534@sun.uucp>, tut%cairo@Sun.COM (Bill Tuthill) writes:
> Brian Kernighan's first
> ditroff worked without changes; DWB 1.0 ditroff (which was really
> Brian's ditroff with Makefiles changed to fubar.mk files) worked
> without changes. This one core dumps.
>
> This is the line that causes a segmentation violation (or memory
> fault) because i is way off the end of the array:
>
> if ((j = fitab[xfont][i] & BYTEMASK) == 0) { /* it's not on current font */
i had to install the original ditroff on a sun-3 here, and found that a
nearly identical line dumped core on the sun. it worked okay on a vax under
bsd. the rationale, as i got it from some of our kernel people, is that
memory location zero under bsd always contains a zero (for people who don't
check for null char *'s, i guess). this isn't the case uner sun unix.
since fitab is init'ed to all zeroes, looking at a fitab entry that's
not loaded yet indirects through mem loc zero. under sun unix, this
sort of indirect addressing is intergalactic.
xfont, in your example, is the number of the loaded font you're checking.
i is the character code.
i hacked in some bounds checking, so that i never looked at any fitab
entries i hadn't installed myself. note that my problem, and its solution,
depended on the value of xfont -- not the value of i.
i could dig up the original code, and my fix, if you want it. it's
probably simple enough to chase down on your own, though. (given your
original diagnosis, it's not even clear that my changes would fix your
problem. worth a look, though).
mike olson
britton lee, inc.
Technical Details
Message-ID:
<20@blipyramid.BLI.COM>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!water!watnot!watmath!clyde!rutgers!sri-unix!ctnews!pyramid!voder!blia!blipyramid!maoReferences:
<16534@sun.uucp>Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watnot!watmath!clyde!rutgers!sri-unix!ctnews!pyramid!voder!blia!blipyramid!mao From: mao@blipyramid.UUCP Newsgroups: comp.text Subject: Re: Documenter's WorkBench 2.0.0.0.0 Message-ID: <20@blipyramid.BLI.COM> Date: Sun, 12-Apr-87 18:05:10 EST Article-I.D.: blipyram.20 Posted: Sun Apr 12 18:05:10 1987 Date-Received: Tue, 14-Apr-87 00:45:09 EST References: <16534@sun.uucp> Organization: Britton Lee, Inc. Lines: 34 Keywords: ditroff core segv Summary: original ditroff dumped core here, too.