[5996] in Athena Bugs
vax 7.1D: twm (lex)
daemon@ATHENA.MIT.EDU (marc@MIT.EDU)
Tue Sep 11 03:08:37 1990
From: marc@MIT.EDU
To: bugs@ATHENA.MIT.EDU
Date: Tue, 11 Sep 90 03:08:12 EDT
System name: beeblebrox
Type and version: CVAXSTAR 7.1D (3 update(s) to same version)
Display type: SM
What were you trying to do?
Run twm.
What's wrong:
[1] Illegal instruction twm
Lots of bashing on saber reveals a limitation which is known,
but I didn't think about, and isn't documented (not in the twm docs,
at least). twm uses lex to tokenize the .twmrc file. Unfortunately,
there's a hardcoded maximum of 200 characters for a token. I had a
246 character string. In my case, a function pointer got blown away
when a static array overflowed, jumping into the data area. Game
over. The failure can also happen if you use a comment longer than
200 characters, since this is treated as a single token by lex.l.
On the rt and the mips, twm didn't lose. This is undoubtedly good
luck; nothing important was being overwritten.
What should have happened:
twm shouldn't use lex. lex is brain-damaged. If flex doesn't
have hardcoded magic comment limits, use that, otherwise write the
lexical analyzer from scratch in C.
Please describe any relevant documentation references:
[Please replace this line with your information.]