Go Down

Topic: Compiler Problem: StackOverflowError (Read 2179 times) previous topic - next topic

lewtwo

Oct 01, 2013, 01:57 pm Last Edit: Oct 01, 2013, 02:00 pm by lewtwo Reason: 1
I have run into this a coupe of times.
Progress Bar and Icon remain active ---

Code: [Select]
Exception in thread "Thread-5" java.lang.StackOverflowError
at java.util.regex.Pattern$CharProperty.match(Pattern.java:3344)
at java.util.regex.Pattern$Branch.match(Pattern.java:4114)
at java.util.regex.Pattern$GroupHead.match(Pattern.java:4168)
at java.util.regex.Pattern$Loop.match(Pattern.java:4295)
at java.util.regex.Pattern$GroupTail.match(Pattern.java:4227)
at java.util.regex.Pattern$BranchConn.match(Pattern.java:4078)


It happens when I forget closing quotation marks in a print statement.
Code: [Select]
else if ((fractionf >= 0.7))
 { // we need to offset the current reading
   Serial.println ("Case D: 3/4);
   WriteTable(DegreeC,rawValueW-3,1);
   WriteTable(DegreeC+1,rawValueW+1,1);
 }


The offending line is:  Serial.println ("Case D: 3/4);
There are no other print quoted strings past this point so the compiler tries to read in the rest of the file as the string.


engineering is the art of planning and forethought
http://www.keywild.com

robtillaart

sounds more like some preprocessing error to me but still a very nasty one. Thanks for sharing.
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

PaulS

Quote
It happens when I forget closing quotation marks in a print statement.

You'd think that, after a while, you'd stop forgetting them.  8)

lewtwo


Quote
It happens when I forget closing quotation marks in a print statement.

You'd think that, after a while, you'd stop forgetting them.  8)

After a lot of year some people start to .... sorry forgot what I was going to write.  :%
engineering is the art of planning and forethought
http://www.keywild.com

bperrybap


sounds more like some preprocessing error to me but still a very nasty one. Thanks for sharing.


Its the Arduino IDE not the gnu tools.
The IDE does some preprocessing but its parser isn't very robust and crashes on
certain sequences.

--- bill

lewtwo

#5
Oct 17, 2013, 06:02 pm Last Edit: Oct 17, 2013, 07:03 pm by lewtwo Reason: 1
You are both correct I believe.
More Info:
Apparently this ONLY occurs on source files of a certain size. For smaller files it gives the error "missing terminator". I would guess it is reading into a buffer and over runs the buffer.

Just out of curiosity I tried it in  "Arduino ERW 1.0.5": Ditto.

This could be very perplexing for a NEW user that does not know what to look for (of course they will likely not be working with larger files). If knowing there is a problem is half the solution then knowing what the problem is could be 3/4 of the solution. Perhaps someone can take a look at fixing it for the next release.
engineering is the art of planning and forethought
http://www.keywild.com

Sembazuru

Just out of curiosity, have you tried to replicate this with the latest 1.5.x beta? (I'm wondering if the fix exists, but never trickled back to the 1.0.x stable branch.)
http://www.catb.org/jargon/html/I/I-didn-t-change-anything-.html

lewtwo


Just out of curiosity, have you tried to replicate this with the latest 1.5.x beta? (I'm wondering if the fix exists, but never trickled back to the 1.0.x stable branch.)

ahh .... no. I generally do not load Beta software (I get into enough trouble with the fully released versions :P).
I might try in on a virtual machine though.

Where might the Beta version be  found ?
engineering is the art of planning and forethought
http://www.keywild.com

Sembazuru



Just out of curiosity, have you tried to replicate this with the latest 1.5.x beta? (I'm wondering if the fix exists, but never trickled back to the 1.0.x stable branch.)

ahh .... no. I generally do not load Beta software (I get into enough trouble with the fully released versions :P).
I might try in on a virtual machine though.

Where might the Beta version be  found ?


The latest beta can be found on the main Arduino download page http://arduino.cc/en/Main/Software just keep scrolling down.

You can install different versions of the IDEs next to each other. I have the following installed (in these paths):
C:\Program Files (x86)\Arduino\Arduino 1.0.3\
C:\Program Files (x86)\Arduino\Arduino 1.0.4\
C:\Program Files (x86)\Arduino\Arduino 1.0.5\
C:\Program Files (x86)\Arduino\Arduino 1.5.2\
C:\Program Files (x86)\Arduino\Arduino ERW 1.0.5\

The windows versions really don't _need_ an installer, so I just download the .zip version, extract the .zip to where I want it, and then create an appropriate shortcut on my desktop. So far it seems to work fine, but I haven't tried with any betas greater than 1.5.2 yet (I think they are up to 1.5.4r2 now). (The earlier versions are for when I find an bug or quirk with the version that I'm currently using, I can go back a few versions to try to find when the bug/quirk was introduced for bug reporting.)
http://www.catb.org/jargon/html/I/I-didn-t-change-anything-.html

CrossRoads

I did this to myself the night before last after I had working code, and put in some print statements to clean up my output.
Finally dawned on me to CTRL-T, and immediately got the mismatched ( ) message and was able to find the typo quickly - had a ) vs a }, or the other way around.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

bperrybap

It can even happen on code that has no errors or missing quotes.
I spent many days tracking down this error in my original code.
I have boiled it down to a very small minimal example for demonstration
and it is attached.
The comment after loop() is to add enough characters to cause the overflow.
If you reduce the number of characters in that comment it won't overflow.

It appears that the IDEs  parsing code gets confused and somehow loses
track of where the quotes are since the double quote in the comment
keeps the IDE parser from crashing.
Delete that line with the commented out double quote and the IDE
parser will overflow even though the rest of the code has no errors/issues.

This is not the first time time I've been burned by the IDE failing
to parse working code correctly.


--- bill

Go Up