Go Down

Topic: IDE weirdness - window does not always get repainted (Read 2232 times) previous topic - next topic

Nick Gammon

I was just typing in a small, simple, sketch to help with a forum issue.

IDE 1.0. Mac version.

This sketch:

Code: [Select]
#include <iterator>
#include <string>
#include <pnew.cpp>
#

void setup ()
{
   std::string foo = "Hello, world";
   
   Serial.begin (115200);
   Serial.println (foo.c_str ());
}
void loop () {}


Now, and this has happened before a few times suddenly the screen goes mostly blank, like this:



The cursor is down at the end (where I was typing) so I up-arrow a bit, and see this:



Up-arrow a bit more and see this:



No changes, just moving the cursor around.

Right now, as I type this, the window looks like the top screen dump, but I was able to hit copy, and paste the sketch into this message. So clearly the text is there, but it is not displaying it.

Oh yes, and in the error window at the bottom all this stuff appears:

Code: [Select]
java.lang.ArrayIndexOutOfBoundsException: 69
at processing.app.syntax.SyntaxUtilities.paintSyntaxLine(SyntaxUtilities.java:151)
at processing.app.syntax.TextAreaPainter.paintSyntaxLine(TextAreaPainter.java:644)
at processing.app.syntax.TextAreaPainter.paintLine(TextAreaPainter.java:603)
at processing.app.syntax.TextAreaPainter.paint(TextAreaPainter.java:415)
at javax.swing.JComponent.paintChildren(JComponent.java:862)
at javax.swing.JComponent.paint(JComponent.java:1038)
at javax.swing.JComponent.paintChildren(JComponent.java:862)
at javax.swing.JComponent.paint(JComponent.java:1038)
at javax.swing.JComponent.paintChildren(JComponent.java:862)
at javax.swing.JSplitPane.paintChildren(JSplitPane.java:1030)
at javax.swing.JComponent.paint(JComponent.java:1038)
at javax.swing.JComponent.paintChildren(JComponent.java:862)
at javax.swing.JComponent.paint(JComponent.java:1038)
at javax.swing.JComponent.paintChildren(JComponent.java:862)
at javax.swing.JComponent.paint(JComponent.java:1038)
at javax.swing.JComponent.paintChildren(JComponent.java:862)
at javax.swing.JComponent.paint(JComponent.java:1038)
at javax.swing.JComponent.paintChildren(JComponent.java:862)
at javax.swing.JComponent.paint(JComponent.java:1038)
at javax.swing.JLayeredPane.paint(JLayeredPane.java:567)
at javax.swing.JComponent.paintChildren(JComponent.java:862)
at javax.swing.JComponent.paint(JComponent.java:1038)
at javax.swing.JComponent._paintImmediately(JComponent.java:5098)
at javax.swing.JComponent.paintImmediately(JComponent.java:4882)
at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:812)
at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:714)
at javax.swing.RepaintManager.prePaintDirtyRegions(RepaintManager.java:694)
at javax.swing.RepaintManager.access$700(RepaintManager.java:41)
at javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1672)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:677)
at java.awt.EventQueue.access$000(EventQueue.java:85)
at java.awt.EventQueue$1.run(EventQueue.java:638)
at java.awt.EventQueue$1.run(EventQueue.java:636)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:647)
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)
Error repainting line range {0,47}:
Please post technical questions on the forum, not by personal message. Thanks!

More info:
http://www.gammon.com.au/electronics

Nick Gammon

Further testing appears to indicate that typing a line like this triggers it:

Code: [Select]
#

Now, of course you will say "well don't do that".

But to be fair, I was planning to type:

Code: [Select]
#include <string>

It is kind of hard to type that when the window goes blank after the initial # is typed.

Please post technical questions on the forum, not by personal message. Thanks!

More info:
http://www.gammon.com.au/electronics

Nick Gammon

So, no comments, huh?

Can anyone reproduce this at least?
Please post technical questions on the forum, not by personal message. Thanks!

More info:
http://www.gammon.com.au/electronics

Coding Badly


I cannot reproduce it and I've never seen anything like it (Windows 7 64b and Vista 32b; Arduino 1.0).

Quote
Further testing appears to indicate that typing a line like this triggers it: #


Typing a # into an empty sketch causes triggers the symptom?

"string" is highlighted for you but is not for me.  But that does not appear to be relevant; this is fine here...
Code: [Select]
#include <loop>
#include <setup>
void setup( void ) { }
void loop( void ) { }


Nick Gammon


"string" is highlighted for you but is not for me.  But that does not appear to be relevant; this is fine here...
Code: [Select]
#include <loop>
#include <setup>
void setup( void ) { }
void loop( void ) { }



I entered your above sketch into Arduino 1.0 on Windows XP. So far so good. I typed a single "#" after the two include lines. Now I see this:



Clicking on the window appears to trigger the behaviour (ie. somewhere in the code).

On OS/X Lion with 1.0 of the IDE, identical behaviour:



The remaining lines have disappeared and a lot of Java errors occur.


I just downloaded it under Windows 7. The problem did not occur there.

Please post technical questions on the forum, not by personal message. Thanks!

More info:
http://www.gammon.com.au/electronics

Coding Badly


Is there a way to check the Java version under the errant operating systems?  

On my Vista computer, "java -version" in a command shell returns this from the Arduino folder (I assume this is the version used by the Arduino IDE)...

[font=Courier New]  java version "1.6.0_16"
  Java(TM) SE Runtime Environment (build 1.6.0_16-b01)
  Java HotSpot(TM) Client VM (build 14.2-b01, mixed mode)[/font]

And this from the root of C...

[font=Courier New]  java version "1.6.0_31"
  Java(TM) SE Runtime Environment (build 1.6.0_31-b05)
  Java HotSpot(TM) Client VM (build 20.6-b01, mixed mode, sharing)[/font]

Nick Gammon

Mac:

Code: [Select]
java version "1.6.0_29"
Java(TM) SE Runtime Environment (build 1.6.0_29-b11-402-11D50b)
Java HotSpot(TM) 64-Bit Server VM (build 20.4-b02-402, mixed mode)


Windows XP (java in the java\bin folder of the Arduino install directory):

Code: [Select]
java version "1.6.0_16"
Java(TM) SE Runtime Environment (build 1.6.0_16-b01)
Java HotSpot(TM) Client VM (build 14.2-b01, mixed mode)


Ditto on Windows 7 of course, because it is the same downloaded files.

On Windows "java -version" returns:

Code: [Select]
'java' is not recognized as an internal or external command,
operable program or batch file.


So I guess it is using the one in the Arduino folder, but who knows for sure?
Please post technical questions on the forum, not by personal message. Thanks!

More info:
http://www.gammon.com.au/electronics

jpbot

This is a bug in the IDE. I discovered it independently last week. Found your thread while searching for a place to report it.

Take a look at your libraries. I'm guessing you made some of your own? I suspect one has a keywords.txt with an error.

I can reproduce the behavior you explained by having a library including a keywords.txt where a keyword is defined as "KEYWORD" instead of "KEYWORD1" or "KEYWORD2" etc.

SirNickity

Anyone seen a case where the menus don't draw properly?

On my XP machine with dual monitors (on a relatively recent Radeon board), the menus are unusable on the primary monitor.  Clicking on them causes the labels to disappear, the menu background color to shift a little, and sluggish response.  I can usually move the mouse to where the option should be and sometimes it'll render that part of the menu long enough to see what I'm supposed to click on.  Sometimes it locks the window until I kill Java.

If I move the window to the secondary monitor, menus work fine.

Nick Gammon

I haven't seen that, however I use a Mac usually. Sometimes the File -> Sketchbook menu can be slow to draw initially but that, I think, is because it scans the entire sketches folder to build up the list, and I'm starting to accumulate a lot of them.
Please post technical questions on the forum, not by personal message. Thanks!

More info:
http://www.gammon.com.au/electronics

Go Up