[comp.os.minix] nroff and MINIX-ST V1.1

tomiak@vax.hmi.dbp.de (Andreas Tomiak) (09/14/89)

Hi MINIX-freaks,

I'm using the plain MINIX-ST 1.1 and have severe problems in running
the recently posted nroff. It does compile, assemble and link fine,
but if one try to run it there will be an memory fault. If I use
the -v option it prompts the version, if it does not found his
macro files it prompts an error, but if all is setup correctly it
crashes. I've tried to change the memory allocation for nroff to
very high values (over 200k), but that didn't help at all. Because
nroff had to run on MINIX-PC and with his memory limits, I think
the error is not caused by a lack of memory.
Has anybody fixed the problem ?

Andreas Tomiak

-----------------------------------------------------------
            | Andreas Tomiak
O         O | Hahn-Meitner-Institut Berlin GmbH
|           | C-4, Trace Elements in Health and Nutrition
O-O O-O-O O | Glienicker Strasse 100
| | | | | | | D-1000 Berlin 39, Federal Republic of Germany
O O O O O O | Phone: +49 30  80 09 27 88
            | Email: tomiak@vax.hmi.dbp.de
-----------------------------------------------------------
 

rbthomas@athos.rutgers.edu (Rick Thomas) (09/15/89)

> the recently posted nroff. It does compile, assemble and link fine,
> but if one try to run it there will be an memory fault. If I use

Sounds like an uninitialized pointer.  Do you have any idea where it is
when it dies?  Look for possible NULL pointers being dereferenced in
that area.  Then try to figure out how it got that way.  When you
figure it out, post the fix.

Isn't full source wonderful??!!

Enjoy!

Rick
-- 

Rick Thomas
uucp: {ames, att, harvard}!rutgers!jove.rutgers.edu!rbthomas
internet: rbthomas@JOVE.RUTGERS.EDU
bitnet: rbthomas@zodiac.bitnet
Phone: (201) 932-4301

hcj@lzaz.ATT.COM (HC Johnson) (09/15/89)

In article <Sep.14.17.56.18.1989.21659@athos.rutgers.edu>, rbthomas@athos.rutgers.edu (Rick Thomas) writes:
> > the recently posted nroff. It does compile, assemble and link fine,
> > but if one try to run it there will be an memory fault. If I use
> 
> Sounds like an uninitialized pointer.  Do you have any idea where it is
> when it dies?  Look for possible NULL pointers being dereferenced in
> that area.  Then try to figure out how it got that way.  When you
> figure it out, post the fix.

use mdb to catch the bus fault, and locate the instruction in the file.

Howard C. Johnson
ATT Bell Labs
att!lzaz!hcj
hcj@lzaz.att.com

evans@ditsyda.oz (Bruce Evans) (09/18/89)

In article <23926@louie.udel.EDU> tomiak@vax.hmi.dbp.de (Andreas Tomiak) writes:
>I'm using the plain MINIX-ST 1.1 and have severe problems in running
>the recently posted nroff. It does compile, assemble and link fine,
>but if one try to run it there will be an memory fault. If I use

I had the same problem. It turned out that spread() was generating
negative indices (why, I don't know; the enclosed fix is temporary)
and writing over the stdio FILE data. Bad pointers soon caused the
memory fault. (It only faulted in 386 32-bit mode, where there were
64K good pointers and 4G - 64K bad pointers, great for trapping.)

>[It sort of works with -v option]

"Unlucky". Different data must have been trashed.

The diff fixes 2 other things: falling off the end of main() with no exit
code and printing carriage returns.

Underlining seems broken. "nroff -man", as suggested by the man page, gave
lousy formatting on the man page itself, but "nroff -b -man" worked well.

#! /bin/sh
# Contents:  nrof.cdif
# Wrapped by sys@besplex on Mon Sep 18 17:25:39 1989
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'nrof.cdif' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'nrof.cdif'\"
else
echo shar: Extracting \"'nrof.cdif'\" \(548 characters\)
sed "s/^X//" >'nrof.cdif' <<'END_OF_FILE'
X*** nroff1.c~	Sun Sep 17 08:04:30 1989
X--- nroff1.c	Sun Sep 17 08:27:09 1989
X***************
X*** 57,58 ****
X--- 57,59 ----
X  	}
X+ 	return(0);
X  }
X*** nroff3.c~	Sun Sep 17 08:04:41 1989
X--- nroff3.c	Sun Sep 17 09:46:03 1989
X***************
X*** 361,363 ****
X  {
X! 	putc(c,fp);
X  }
X--- 361,363 ----
X  {
X! 	if (c != '\r') putc(c,fp);
X  }
X***************
X*** 535,536 ****
X--- 535,537 ----
X  	while(i < j) {
X+ if (i < 0 | j < 0) return;
X  		p[j] = p[i];
X***************
X*** 543,544 ****
X--- 544,546 ----
X  				--j;
X+ if (j < 0) return;
X  				p[j] = ' ';
END_OF_FILE
if test 548 -ne `wc -c <'nrof.cdif'`; then
    echo shar: \"'nrof.cdif'\" unpacked with wrong size!
fi
# end of 'nrof.cdif'
fi
echo shar: End of shell archive.
exit 0
-- 
Bruce Evans		evans@ditsyda.oz.au