[comp.lang.forth] TILEforth problems

mwnewman@watmsg.waterloo.edu (mike newman) (03/09/90)

I just started playing around with TILEforth a little while ago, and I can't
seem to get it quite running.  The problem seems to be occur when defining
new words.  After the third definition of any word whose name is longer than
three characters, I get:

	foreground#250880: signal#11: segmentation violation

I know it sounds rather strange, but
	: word-a 1 2 3 .s ;
	: word-b 4 5 6 .s ;
	: word-c 7 8 9 .s ;
causes the error while
	: a 1 2 3 .s ;
	: b 1 2 3 .s ;
	: c 1 2 3 .s ;
does not.  There can be an arbitrary number of words with three or less
character names interspersed: as soon as the third one with more than three
is defined, I get the error.  The words can be constants or variables as well.

After some dbx-ing, I discovered that it is malloc that is crashing.
Specifically, it is when malloc is called for the second time by makeentry
(to allocate space for the name string).  It is being called with a
reasonable value.  And I didn't notice anything unusual about previous
calls to malloc, except that they were returning successively lower values
of memory, where before (during TILE's start up) they had been returning
successively higher values.

More tracing reveals that the 250880 above is the value returned by malloc
the last time it is called in TILE's start up sequence, ie. just before
the interactive loop is entered.

I haven't tried much, but "regular" kinds of words seem to work ok if I stick
to defining them with names of three or less characters.

All the tst/*.tst benchmarks do this as well, except fibonacci.tst (even
though it does have four names longer than three characters ...?)


I'm on a microVAX running 4.3 bsd unix.

Has anyone seen anything like this?  Or even vaguely similar?  Any help at
all would be greatly appreciated.

mike
mwnewman@watmsg.waterloo.edu
my sig is vry sml bec I can ony use shr wds.  :-(

bartho@obs.unige.ch (PAUL BARTHOLDI) (03/12/90)

In article <35009@watmath.waterloo.edu>, mwnewman@watmsg.waterloo.edu (mike newman) writes:
> I just started playing around with TILEforth a little while ago, and I can't
> seem to get it quite running.  The problem seems to be occur when defining
> new words.  After the third definition of any word whose name is longer than
> three characters, I get:
> 
> 	foreground#250880: signal#11: segmentation violation
> 
> I know it sounds rather strange, but
> 	: word-a 1 2 3 .s ;
> 	: word-b 4 5 6 .s ;
> 	: word-c 7 8 9 .s ;
> causes the error while
> 	: a 1 2 3 .s ;
> 	: b 1 2 3 .s ;
> 	: c 1 2 3 .s ;
> does not.  There can be an arbitrary number of words with three or less
> character names interspersed: as soon as the third one with more than three
> is defined, I get the error.  The words can be constants or variables as well.
> 
> ...
> 
> I'm on a microVAX running 4.3 bsd unix.
> 
> mike
> mwnewman@watmsg.waterloo.edu

I put Tile on my sun3.60, os4.2, and tryed the examples above without any
error.  For me, Tile works correctly for all tests of my own, but is quite
slow (about 5* slower than Forthmacs from Mike Bradley), so testing was not
very deep.  I also tryed to compile Tile on other machines like Alliant Fx-1,
but coud'nt get it (wrongly defined variables ?).

                          Paul Bartholdi,    Observatory of Geneva, Switzerland

gary@softway.oz (Gary Corby) (03/15/90)

bartho@obs.unige.ch (PAUL BARTHOLDI) writes:

>In article <35009@watmath.waterloo.edu>, mwnewman@watmsg.waterloo.edu (mike newman) writes:
>> ...The problem seems to be occur when defining
>> new words.  After the third definition of any word whose name is longer than
>> three characters, I get:
>> 
>> 	foreground#250880: signal#11: segmentation violation
>> 
>> ...There can be an arbitrary number of words with three or less
>> character names interspersed: as soon as the third one with more than three
>> is defined, I get the error.  The words can be constants or variables as well.
>> I'm on a microVAX running 4.3 bsd unix.
>> mike
>> mwnewman@watmsg.waterloo.edu

Possibly it's time to look at the malloc() on your machine.  A bad malloc()
can do very strange things at completely unpredictable times.  Try using 
sdb to find the exact point at which it crashes.  If the crash occurred 
while trying to allocate through a pointer look very closely at the 
pointer value.  Make sure it is not odd.  Also make sure the value is
divisible by four.

>...I also tryed to compile Tile on other machines like Alliant Fx-1,
>but coud'nt get it (wrongly defined variables ?).

I have it compiled on a sequent balance running 4.3bsd.  At first it
wouldn't compile for seemingly no reason.  I kept getting syntax errors
associated with the variable "private", which you'll find correctly
declared in the TILE code.  Then I discovered some fool had hardwired 
"private" into the C compiler as a reserved word, presumably to mean the
same as static.  If you're getting wrongly defined variables that could
be the reason.
-- 
Gary Corby  (Friend of Elvenkind)			Softway Pty Ltd
						ACSnet: gary@softway.oz
					UUCP: ...!uunet!softway.oz!gary