Why does the compiler spit out things like this?

Every once in awhile while I'm editing the complier spits out nonsense like this..

Binary sketch size: 16014 bytes (of a 32256 byte maximum)
Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: 41
	at processing.app.syntax.JEditTextArea.xToOffset(JEditTextArea.java:672)
	at processing.app.syntax.JEditTextArea$DragHandler.mouseMoved(JEditTextArea.java:2034)
	at java.awt.AWTEventMulticaster.mouseMoved(AWTEventMulticaster.java:312)
	at java.awt.Component.processMouseMotionEvent(Component.java:6419)
	at javax.swing.JComponent.processMouseMotionEvent(JComponent.java:3285)
	at java.awt.Component.processEvent(Component.java:6143)
	at java.awt.Container.processEvent(Container.java:2085)
	at java.awt.Component.dispatchEventImpl(Component.java:4736)
	at java.awt.Container.dispatchEventImpl(Container.java:2143)
	at java.awt.Component.dispatchEvent(Component.java:4566)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4621)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4295)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4212)
	at java.awt.Container.dispatchEventImpl(Container.java:2129)
	at java.awt.Window.dispatchEventImpl(Window.java:2478)
	at java.awt.Component.dispatchEvent(Component.java:4566)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:680)
	at java.awt.EventQueue.access$000(EventQueue.java:86)
	at java.awt.EventQueue$1.run(EventQueue.java:639)
	at java.awt.EventQueue$1.run(EventQueue.java:637)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
	at java.awt.EventQueue$2.run(EventQueue.java:653)
	at java.awt.EventQueue$2.run(EventQueue.java:651)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:650)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

Does anyone know what this is all about?

Thanks!

-jim lee

the first line tells the size of the compiled sketch. this messages is always printed after a compile run.
the next things it spits out, is something that went wrong i geus,

it says: java.lang.ArrayIndexOutOfBoundsException
it means the compilers code tryed to acces a part of an array wich didnt exist.

im no expert, but since the compiled sketch size is bieng told, i think the compiler solved the error itself and continued compiling.

nick

Its a bug in the editor user interface code I think (AWT = abstract windowing toolkit in Java) - looks like you were dragging some text?

Not seen it myself, it could be a platform-specific problem.

The actual compiler isn't involved.

The Java exception dump indicates errors within the IDE, rather than any problems in your sketch. I see this sort of thing occasionally if I interact with the IDE while it's busy doing something - I suppose there are probably some race conditions in the IDE's event handling.

Maybe its my IDE? I'm using 1.0 on a Mac. It also randomly decides to scroll my window around and that's kinda annoying and confusing.

-jim lee

It seems like a common thing. I have had lists of errors pop up occasionally from version 0022 to 1.0.2, especially when cutting or pasting text. Haven't had random scrolling though.

Might be something to do with the IDE virtualizing the files to be compiled.

This is on windows XP / 7.

The first line is the error:

Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: 41

So, at line 41 some index got out of bounds. The rest is a "backtrace" which shows the calling stack (that is, which function called what, at that time).

I don't know Java, nor how the IDE works internally, so I can't explain more than that.

the error appears to have occured in Processing. Is the Arduino IDE written using Processing ?
And it appears to be related to a mouse movement.

michinyon:
the error appears to have occured in Processing. Is the Arduino IDE written using Processing ?
And it appears to be related to a mouse movement.

Yes, it's written in Processing.

The Arduino event handling doesn't seem very robust. I should have learned by now not to provoke the problem, but I routinely have a face/palm moment when the Arduino window locks up because I have dragged it between monitors. Sometimes it seems to get confused about what COM ports have Arduinos plugged in and I have to disconnect everything and start again, or the window just goes away for no obvious reason. If I was paying for professionally produced software I'd be pretty unhappy with the quality - but it's free, so I'm grateful for what we have got.

PeterH:

michinyon:
the error appears to have occured in Processing. Is the Arduino IDE written using Processing ?
And it appears to be related to a mouse movement.

Yes, it's written in Processing.

The Arduino event handling doesn't seem very robust. I should have learned by now not to provoke the problem, but I routinely have a face/palm moment when the Arduino window locks up because I have dragged it between monitors. Sometimes it seems to get confused about what COM ports have Arduinos plugged in and I have to disconnect everything and start again, or the window just goes away for no obvious reason. If I was paying for professionally produced software I'd be pretty unhappy with the quality - but it's free, so I'm grateful for what we have got.

It's the price you pay for Java... I have just as much problem with the "professionally produced" MPLAB-X. If you click any of the projects in the project list before it has completely loaded 100% it just crashes and vanishes without a trace. If you click upload while it's in the process of uploading it completely locks up and you have to manually kill the process...