Google 網路論壇不再支援新的 Usenet 貼文或訂閱項目,但過往內容仍可供查看。

lex(1) bug -- lex users BEWARE!

瀏覽次數:3 次
跳到第一則未讀訊息

R. Curtis Jackson

未讀,
1984年4月18日 下午2:27:571984/4/18
收件者:
Well, last year about this time I found a bug in yacc(1) [actually
in its documentation] that cost me three weeks of valuable time
to track down, since I assumed it was my program which was in error.

This year it is lex(1), same situation only I found this one quicker:

lex reserves a certain amount of space for its input buffer -- I haven't
taken the time to check how much -- that is left as an exercise for the
reader. If you are trying to match some hellaciously long strings or,
like myself, you screw up and accidentally match a hellaciously long
string, you will get either a memory fault or a bus error in your
program. This is because lex does not check to see whether it has
filled its input array and keeps merrily on writing into random
areas of memory.

I am going to get all the specifics on this problem to submit to the
Unix Hotline (although it has been over a year since I told them about
the bug in the yacc(1) documentation and I haven't seen that corrected).
If anyone is interested in more particulars, drop me a line and I will
send it -- the bug fix should be trivial once you know the problem.

By the way, could some lucky person who has the System V Release 2
Programmer's (not User's) Manuals look at the yacc(1) documentation and
see if anything is mentioned about token numbers over 1000 not being
allowed? Maybe they did process the documentation MR and I just haven't
seen the results.

Thanks in advance,
--

The MAD Programmer -- 919-228-3313 (Cornet 291)
alias: Curtis Jackson ...![ ihnp4 ulysses cbosgd clyde ]!burl!rcj

ku...@fluke.uucp

未讀,
1984年4月23日 上午11:36:291984/4/23
收件者:
Yacc token numbers over 1000 a bug?

Well certainly token numbers over 1000 will prevent yacc from working right
and yacc should probably warn you about them, but REALLY, what do you want.
Yacc has a number of wired in restrictions about the size of the grammar and
such. I hardly think requiring you to use less than 1000 tokens or else
revise the yacc sources is a big restriction.

Not surprised yacc has not been modified to remove this 'bug'
--
Kurt Guntheroth
John Fluke Mfg. Co., Inc.
{uw-beaver,decvax!microsof,ucbvax!lbl-csam,allegra,ssc-vax}!fluke!kurt

r...@burl.uucp

未讀,
1984年4月24日 下午5:02:031984/4/24
收件者:
I agree totally that the 1000 token number limit is a reasonable
restriction; that is why my MR was filed against the documentation
and not the program. All I want is for users to be aware of the
problem -- whether the documentation or the program warns them is
of little concern to me because I strongly believe in the ancient
epithet that has become famous here. It even has its own acronym:

RTFM -- "Read The F*ing Manual!!"

0 則新訊息