Arduino Forum upgrade scheduled for Monday, October 20th, 11am-4pm (CEST). Sorry for the inconvenience!
Pages: [1]   Go Down
Author Topic: Compiler Problem: StackOverflowError  (Read 2084 times)
0 Members and 1 Guest are viewing this topic.
Houston, Texas, USA
Offline Offline
Full Member
***
Karma: 2
Posts: 134
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I have run into this a coupe of times.
Progress Bar and Icon remain active ---

Code:
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:
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.




* Capture.PNG (40.13 KB, 983x720 - viewed 42 times.)
« Last Edit: October 01, 2013, 07:00:19 am by lewtwo » Logged

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

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 234
Posts: 14296
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Rob Tillaart

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

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 671
Posts: 51669
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.  smiley-cool
Logged

Houston, Texas, USA
Offline Offline
Full Member
***
Karma: 2
Posts: 134
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.  smiley-cool
After a lot of year some people start to .... sorry forgot what I was going to write.  smiley-draw
Logged

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

Dallas, TX USA
Offline Offline
Faraday Member
**
Karma: 74
Posts: 2794
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Houston, Texas, USA
Offline Offline
Full Member
***
Karma: 2
Posts: 134
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: October 17, 2013, 12:03:28 pm by lewtwo » Logged

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

Mid-Atlantic, USA
Offline Offline
God Member
*****
Karma: 30
Posts: 515
"Remember kids, the only difference between Science and screwing around is writing it down." - Adam Savage
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.)
Logged


Houston, Texas, USA
Offline Offline
Full Member
***
Karma: 2
Posts: 134
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley-razz).
I might try in on a virtual machine though.

Where might the Beta version be  found ?
Logged

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

Mid-Atlantic, USA
Offline Offline
God Member
*****
Karma: 30
Posts: 515
"Remember kids, the only difference between Science and screwing around is writing it down." - Adam Savage
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley-razz).
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.)
Logged


Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 555
Posts: 27684
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Dallas, TX USA
Offline Offline
Faraday Member
**
Karma: 74
Posts: 2794
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

* quotecrash.pde (1.58 KB - downloaded 16 times.)
Logged

Pages: [1]   Go Up
Arduino Forum upgrade scheduled for Monday, October 20th, 11am-4pm (CEST). Sorry for the inconvenience!
Jump to: