Pages: [1] 2   Go Down
Author Topic: Occasional "Couldn't determine program size" error  (Read 3371 times)
0 Members and 1 Guest are viewing this topic.
Indiana
Offline Offline
Full Member
***
Karma: 1
Posts: 234
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Arduino-0012
Mac OSX 10.4.11 PPC

About 1 time in 10 I randomly get the following error while Verifying a sketch:

Code:
Couldn't determine program size:    text         data          bss          dec          hex      filename
[/color]

Verifying again immediately after the error will work without any problems so it doesn't seem to be a critical bug.  It's only annoying.  :-/
Logged

0
Offline Offline
Sr. Member
****
Karma: 0
Posts: 430
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It happens all the time and it doesn't seem to be causing any problems smiley
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 9
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I had the same problem but I solved... I didn't put void setup() and it didn't like it smiley-razz  
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17263
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I've had it happen many times but I just ignored it or sometimes just uploaded again to make sure, either way it doesn't seem to be a error message that causes any problems, nor does it seem to be based on any error in the sketch code.

Lefty

« Last Edit: April 01, 2009, 01:57:56 pm by retrolefty » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 40
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

"It hurts when I look at the output and see an error".

So don't look...

Well, I've been seeing this message for ages as well. But it really isn't great in terms of building confidence in the Arduino IDE. Not only does it keep distracting me and wondering whether I need to upload again just to rule out a problem while chasing my own bugs, I think it also sends out the wrong message when this bug pops up since at least version 0011 and no-one seems to be doing anything about it.

Just my € .02 ...
Logged

Connecticut, US
Offline Offline
Edison Member
*
Karma: 2
Posts: 1036
Whatduino
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Agreed, jcw, it's a flaw that should be investigated.  Should have been investigated for some time now.

The error reporting mechanism often drops errors (only showing "In function foo():" but no error text), and often fails to collect any output at all (only showing "Couldn't determine program size").

It seems like the IDE is not properly getting the stdin/stdout handles of the spawned build process, and since it's more flaky on a platform that has a lot of dual-core machines, I'm putting money on a race condition of some kind:  the routine returns but the returned handles aren't really ready yet.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 40
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for following up - I don't know enough about the IDE to help with tracking this down, unfortunately. Maybe the race condition could be worked around with a short sleep/delay of some sort... somewhere...

Best of luck on this one - race conditions can be very hard to track down.

(Edited: or even to repeat the call if it failed the first time?)
« Last Edit: April 03, 2009, 08:32:49 am by jcw » Logged

Canada
Offline Offline
Full Member
***
Karma: 0
Posts: 246
Code Monkey
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Almost certainly a race condition, when I look at the offending code.

I never saw this on an iMac, but with a multi-core Mac Pro I get it every single time.  An annoyance, for sure.

I'll try to look at this one this week-end.

[later]

Ok, try this patch (for Arduino-0015):

http://clevermonkey.org/arduino/Sizer-patch.zip

How you patch an installed Arduino IDE is platform dependent.  I can't figure out how to tweak the classpath on OS X, but I suspect it involves hacking the Info.plist in the .app.  If someone figures this out, please reply back with instructions.

Windows users can probably unzip this into the directory (you may have to create it) referred to in the run.bat (this same directory is also known to the Arduino.exe.)

I don't know where you put it for Linux.

In a nutshell: unzip this file into a location that is before any of the Arduinbo jarfiles on the CLASSPATH, making sure to preserve the path.  Restart Arduino.

I'll post the code back to the right place once I convince myself my approach is sane.  I'm essentially using Thread.join() to force the IDE to wait for the stdout/stderr threads to be setup until trying to start the avr-size process.  Under the right circumstances the MessageSiphon threads would not even be near complete by the time the avr-exit command has exited.

We really ought to switch to Java 5 and ProcessBuilder for this smiley
« Last Edit: April 11, 2009, 12:38:41 pm by clvrmnky » Logged

I yield() for co-routines.

Canada
Offline Offline
Full Member
***
Karma: 0
Posts: 246
Code Monkey
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Er, I guess I should have replied, instead of just adding to my last comment.

So: bump!
Logged

I yield() for co-routines.

0
Offline Offline
Newbie
*
Karma: 0
Posts: 40
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Great - here's what I see on Mac OS X:

                <key>ClassPath</key>
                <array>
                        <string>$JAVAROOT/antlr.jar</string>
                        <string>$JAVAROOT/Arduino.jar</string>
                        <string>$JAVAROOT/oro.jar</string>
                        <string>$JAVAROOT/mrj.jar</string>
                        <string>$JAVAROOT/registry.jar</string>
                        <string>$JAVAROOT/RXTXcomm.jar</string>
                        <string>$JAVAROOT/quaqua.jar</string>
                        <string>/System/Library/Java</string>
                </array>

That's in the file:
    /Applications/arduino-0015/Arduino 15.app/Contents/Info.plist

Should I add a path, or ... (I know nothing about Java) - please advise...

-jcw
Logged

Canada
Offline Offline
Full Member
***
Karma: 0
Posts: 246
Code Monkey
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Ah foo. I messed up the patch.  Grab another copy.

And then change Info.plist like:
Code:
              <array>
                       <string>$JAVAROOT/lib/patch</string>
                       <string>$JAVAROOT/antlr.jar</string>
                       <string>$JAVAROOT/Arduino.jar</string>
                       <string>$JAVAROOT/oro.jar</string>
Then, unzip the patch into Arduino 15.app/Contents/Resources/Java/lib/patch/

Logged

I yield() for co-routines.

0
Offline Offline
Newbie
*
Karma: 0
Posts: 40
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Can do - one more Q: so I end up with .../lib/patch/processing/app/Sizer.class, right?

-jcw
Logged

Canada
Offline Offline
Full Member
***
Karma: 0
Posts: 246
Code Monkey
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Correct.
Logged

I yield() for co-routines.

0
Offline Offline
Newbie
*
Karma: 0
Posts: 40
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok, done. I can confirm that without the patch, I get occasional errors when doing dozens of compiles with cmd-R (the most common one is right after starting up), whereas with your patch the problem NEVER showed up. Done many many dozens of tests and at least a dozen re-launches.

It's not conclusive, but yeay - IMO you've nailed it.

Next step: dear Mr. Mellis, please consider including this patch for 0016...

Thanks for squashing the bug (as far as I can tell - Mac OS X 10.5.6, Core 2 duo).

-jcw
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 10
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for this, it fixes it for me too (8 core mac pro).

Is there any chance that you could fix the problem with errors in .h files the same way?

Details: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1235432803/0#0

Logged

Pages: [1] 2   Go Up
Jump to: