[antlr-interest] LA lookahead very long (garbage)

Ric Klaren ric.klaren at gmail.com
Tue Nov 23 16:06:50 PST 2004


Hi,

On Tue, 23 Nov 2004 23:44:55 -0000, ron_bennatan
<ron_bennatan at guardium.com> wrote:
> We've been using ANTLR very successfully for over a year and love
> it. We generate C++ code from the grammars and have 4 parsers being
> used by 4 different threads.

The parsers are completely disjunct? E.g. no data is shared or when
it's shared it's correctly mutex'ed? Which platform? If windows antlr
DLL's used/VC version ?

> Recently we've been experiencing a problem that we've not yet been
> able to solve. The system crashes randomly. We tried everything we
> can think of to no avail. The wierd thing is that it somehow always
> crashes in the parser (and only in one of them) although the code
> for using the 4 different parsers is the same. When it does crash it
> is because LA (called from nextToken()) has instead of 1 or 2 a
> value like 15 Million - obviously garbage due to some memory leak or
> misuse.

Already tried using -traceParser/Lexer/TreeParser ? To get a trace of
the error situation ? Tried running with a memory debugger ? Does a
backtrace say something intelligible ?

A bogus value would probably be a stack corruption somewhere. Best bet
is a memory debugger probably. (or do you have code that calls LA()
manually?)

Cheers,

Ric


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
    antlr-interest-unsubscribe at yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 





More information about the antlr-interest mailing list