[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bison bug.

From: James Harris
Subject: Re: bison bug.
Date: Fri, 28 Dec 2001 17:14:05 -0800 (PST)

As I suspected, the mixing of shorts and ints seems to be the root of the
problem.  As an example in output_gram() yyrhs_size is declared as size_t,
then is passed as the last argrument of output_short_table wich is
expecting a short. I think the root of problem is that the test case
nitems is larger then SHRT_MAX.  

What about changing all of the shorts to ints, while this doesnt *solve*
the problem it does make it much harder to reproduce.   Finally I would
suggest placing some asserts in reader.c:readgram() to keep nitems and
possibly even nrules in check, this might *solve* the bug.

-- James Harris

On 22 Dec 2001, Akim Demaille wrote:

> | This isn't the only bug I have run across in bison, but I belive they are
> | all symptoms of the same bug. 
> I don't think so, 1.30 has a lot of problems.
> | I belive a some internal variable is to
> | small. As you can see the number 256 rules is rather telling. 255 is
> | acceptable, 256 produces the bug.
> Your test case doesn't make it clear exactly what is the problem?  The
> total number of rules only, or is the number of symbols on the RHS
> relevant?
> Whatever the answer, I agree this is a bug.  Nonetheless, it is not
> clear how to fix it: die with dignity diagnosing an overflow, or try
> to work with such grammars?
> In other words: is your test case realistic of some real condition
> uses, or just a torture test?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]