-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] buffer expansion bug in yy_refill()? [sf#60] #62
Comments
Updated by lsf37 on 2004-02-12 00:52 UTC
|
Commented by lsf37 on 2004-02-12 09:38 UTC Thanks for your bug report! Unfortunately, I couldn't Two things make me think it's not the bug you mean: 1. the yy_refill expects and should preserve the following yy_refill is usually called because currentPos==endRead. It is possible that this is not true in the piccolo In my tests buffer expansion works without problems, but Where did the ArrayIndexOutOfBoundsException occur? Can |
Commented by mrdon on 2004-08-11 23:19 UTC FWIW, I've been experiencing this problem for quite a while java.lang.ArrayIndexOutOfBoundsException The application is here: http://www.twdata.org/kokua is is HTH, Don |
Commented by mrdon on 2004-08-12 00:12 UTC Ok, more information. It looks like the exception is I slightly modifed the code to add a try block and print out
The exception was first being thrown on that arraycopy.
According to your invariant, start should never be larger Don |
Updated by lsf37 on 2004-08-12 00:28 UTC
|
Commented by mrdon on 2004-08-13 16:08 UTC I captured all the input that was causing it to die to file, The code that feeds Socket input is here: The code that runs the lexer is here: HTH, Don |
Commented by mrdon on 2004-09-11 23:52 UTC Interesting. I have confirmed this problem only occurs when |
Commented by lsf37 on 2004-09-12 02:52 UTC Yes, please zip together the test case and post it. Still wasn't able Gerwin |
Commented by mrdon on 2004-09-12 03:05 UTC Ok, I think I'm starting to narrow it down: the problem I traced it down in the generated code to the yylex() My project is at http://www.twdata.org/dakine/jflex-bug.zip Unzip it and, using Apache Ant, run "ant run-tests" in the |
Commented by mrdon on 2004-09-15 19:53 UTC Well, in the test case I sent you, I can reproduce the bug I don't know if jflex just can't handle it when it can't get |
Commented by mrdon on 2004-10-19 06:21 UTC Ok, got HEAD, and have narrowed down the problem. It seems If I changed:
to read:
my tests pass. Perhaps that breaks something else, I don't |
Commented by mrdon on 2004-10-19 20:54 UTC Actually, it is a bit cleaner to just have zzEndReadL Index: Emitter.java RCS file: /cvsroot/jflex/jflex/src/JFlex/Emitter.java,v
|
Commented by lsf37 on 2004-10-24 07:36 UTC Yes! That seems to be the one. Thank you Don for your help! I've committed the patch to the repository. It will be released together with Gerwin |
Updated by lsf37 on 2004-10-24 07:36 UTC
|
Updated by lsf37 on 2004-11-07 06:04 UTC
|
Reported by smagoun on 2004-01-30 20:35 UTC
yy_refill()
inskeleton.default
andskeleton.nested
seems tohave a problem expanding the buffer correctly. The bug
manifests itself when reading a lot of data at once. I ran into
this using the Piccolo XML parser, which uses JFlex to parse
XML. Piccolo died while reading a very long CDATA element
in the XML. I tracked it to
yy_refill()
, which seems to havebeen copied from one of the skeleton files JFlex ships with.
The problem is that the buffer never expands properly when
reading long input, which results in an
ArrayIndexOutOfBoundsException
. The following patch fixesPiccolo; I'm not sure if it applies to JFlex, but I'm guessing it
might.
(I'm not convinced that the if() should check
yy_currentPos>=buffer.length at all, but it seems harmless)
The text was updated successfully, but these errors were encountered: