[antlr-interest] Re: Intermitent bug with ANTLR.
Oliver Zeigermann
oliver at zeigermann.de
Thu Jan 29 11:52:31 PST 2004
Hi guys,
I really can't believe this is a VM bug (although I just found an
obvious one the other day, so, hmmmm, maybe). What I rather suspect is
there is some sort of race. At least this is indicated by this
undeterministic behavior. To have a race you need at least two threads
running. As far as I know ANTLR is strictly single-threaded, right? But,
trara, XPA is *not*. It uses a producer/consumer thing to give both SAX
parser an ANTLR the impression they are the master of it all. Although
this code is very simple, there might still be a bug in it. If you can
give me any hint upon which conditions this error occurs, I would highly
appreciate this.
Cheers,
Oliver
lachinois2002 wrote:
> Hi Monty,
>
> Well... I'm outa luck, after adding 2 or 3 rules to my grammar it
> seems like the bug doesnt show up anymore. This really looks like a
> java VM bug. In anycase, if this happens again I'll trace it and
> hope it behaves the same with the trace activated.
>
> Daniel Shane
>
> --- In antlr-interest at yahoogroups.com, mzukowski at y... wrote:
>
>>To continue on the theme of the week, try building with -trace and
>
> then
>
>>running. I'd be curious to see the difference between success &
>
> failure.
>
>>Monty
>>
>>-----Original Message-----
>>From: Daniel Shane [mailto:lachinois at h...]
>>Sent: Wednesday, January 28, 2004 11:49 AM
>>To: antlr-interest at yahoogroups.com
>>Subject: [antlr-interest] Intermitent bug with ANTLR.
>>
>>Hi everyone, mostly Terence.
>>
>>I will greatly need your help on this one. I have a grammar (that
>
> uses XPA)
>
>>and, listen to this, I sometimes get a grammar error, and
>
> sometimes not by
>
>>executing the same command line with the same input.
>>
>>Here is what happens:
>>
>>$ java -cp
>>"/usr/local/soft/antlr-2.7.2/lib/antlr.jar:/usr/local/soft/xpa-
>
> 1.0.1/lib/xpa
>
>>1_0_1-full.jar:.:Code"
>>MainRegulationParser tmp/Fr/C.R.C.,_c._100.06-MTE.html > /tmp/g
>>
>>$ java -cp
>>"/usr/local/soft/antlr-2.7.2/lib/antlr.jar:/usr/local/soft/xpa-
>
> 1.0.1/lib/xpa
>
>>1_0_1-full.jar:.:Code"
>>MainRegulationParser tmp/Fr/C.R.C.,_c._100.06-MTE.html > /tmp/g
>>
>>$ java -cp
>>"/usr/local/soft/antlr-2.7.2/lib/antlr.jar:/usr/local/soft/xpa-
>
> 1.0.1/lib/xpa
>
>>1_0_1-full.jar:.:Code"
>>MainRegulationParser tmp/Fr/C.R.C.,_c._100.06-MTE.html > /tmp/g
>>
>>$ java -cp
>>"/usr/local/soft/antlr-2.7.2/lib/antlr.jar:/usr/local/soft/xpa-
>
> 1.0.1/lib/xpa
>
>>1_0_1-full.jar:.:Code"
>>MainRegulationParser tmp/Fr/C.R.C.,_c._100.06-MTE.html > /tmp/g
>>line 3: expecting "<IdOfRegulation>", found 'TitleOfAct'
>>
>>$ java -cp
>>"/usr/local/soft/antlr-2.7.2/lib/antlr.jar:/usr/local/soft/xpa-
>
> 1.0.1/lib/xpa
>
>>1_0_1-full.jar:.:Code"
>>MainRegulationParser tmp/Fr/C.R.C.,_c._100.06-MTE.html > /tmp/g
>>
>>$
>>
>>These invocation were done in sequence and the input file has not
>
> changed
>
>>between invocations. I printed some debug out of ANTLR to show the
>
> sequence
>
>>of tokens that have been read and in both cases the token sequence
>
> is the
>
>>same.
>>
>>Something is happening in ANTLR that is causing it to take a
>
> different path
>
>>for what seems like a random reason.
>>
>>This is really causing me a headache, and I can trace the problem
>
> to one
>
>>rule I added in the grammar. If I remove this rule, then I do not
>
> get this
>
>>strange behavior (BTW, the rule is simple, so I'm not doing
>
> anything tricky
>
>>here). I really cannot see why this additionnal rule would break
>
> anything
>
>>and specially not like this.
>>
>>I really out of clues here, what would you like me to do to give
>
> you some
>
>>additionnal information? Do you want the java files/grammar so
>
> that you can
>
>>run it on your setup see if it does the same? Would you like an
>
> ssh access
>
>>to this linux machine to see for yourself? Do you think the bug
>
> arrises from
>
>>XPA?
>>
>>I'm running on Linux, RedHat 9 with the SUN JDK 1.4.2 for linux.
>>
>>Daniel Shane
>>
>>_________________________________________________________________
>>MSN Search, le moteur de recherche qui pense comme vous !
>>http://fr.ca.search.msn.com/
>>
>>
>>
>>
>>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/
>
>
>
>
>
> 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/
>
>
>
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