We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexSuggestions & BugsSoftware Bugs › 0087 flooding itself w javax.swing.text messages
Page Index Toggle Pages: 1
0087 flooding itself w javax.swing.text messages (Read 1533 times)
0087 flooding itself w javax.swing.text messages
May 7th, 2005, 2:53pm
 
This is not critical or high prio and I have no idea how the P5 UI works so maybe this is a swing problem that can't be fixed. But I didn't find anything about it in neither faq or forums, so thought I'd just mention it anyway.

I accidently flooded 0087 with print()s that froze the entire processing environment. That's not very strange, but here comes the fun part... When I look at my 5 MB (!) stdout.txt it looks like processing goes into eternal recoursive behaviour by, even after sketch output being stopped, flooding itself with javax.swing.text error messages that in turn generates more almost identical error messages and so on until the Java process tree is shut down from the task manager.
Re: 0087 flooding itself w javax.swing.text messag
Reply #1 - May 7th, 2005, 4:14pm
 
hm, could you post a copy (zipped, perhaps) of that stdout.txt somewhere and the sketch that you were using that kicks off the behavior?

it's possible to have an error in your code that would trigger a recursive set of error messages like that, but it may be the environment causing the trouble as well.

there are problems with the way the ui works with println(), that too many of them will flood the ui, but i'm not sure whether that's what's happening here.
Re: 0087 flooding itself w javax.swing.text messag
Reply #2 - May 7th, 2005, 7:24pm
 
I don't have that sketch "intact" any more, but I can take try to repeat the effect. The stdout has been cleared since then but I found this snippet:

Code:

java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)javax.swing.text.StateInvariantError: infinite loop in formatting
at javax.swing.text.FlowView$FlowStrategy.layout(Unknown Source)
at javax.swing.text.FlowView.layout(Unknown Source)
at javax.swing.text.BoxView.setSize(Unknown Source)
at javax.swing.text.BoxView.modelToView(Unknown Source)
at javax.swing.text.CompositeView.modelToView(Unknown Source)
at javax.swing.text.BoxView.modelToView(Unknown Source)
at javax.swing.plaf.basic.BasicTextUI$RootView.modelToView(Unknown Source)
at javax.swing.plaf.basic.BasicTextUI.modelToView(Unknown Source)
at javax.swing.text.DefaultCaret.repaintNewCaret(Unknown Source)
at javax.swing.text.DefaultCaret$1.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
javax.swing.text.StateInvariantError: infinite loop in formatting
at javax.swing.text.FlowView$FlowStrategy.layout(Unknown Source)
at javax.swing.text.FlowView.layout(Unknown Source)
at javax.swing.text.BoxView.setSize(Unknown Source)
at javax.swing.text.BoxView.modelToView(Unknown Source)
at javax.swing.text.CompositeView.modelToView(Unknown Source)
at javax.swing.text.BoxView.modelToView(Unknown Source)
at javax.swing.plaf.basic.BasicTextUI$RootView.modelToView(Unknown Source)
at javax.swing.plaf.basic.BasicTextUI.modelToView(Unknown Source)
at javax.swing.text.DefaultCaret.repaintNewCaret(Unknown Source)
at javax.swing.text.DefaultCaret$1.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

Which I think was pretty much what the stdout.txt was filled with. The program that triggered this self flooding was not uncontrollably recursive and neither was it an infinite loop. The print() was used to write out debug data in a search routine. Not in uncontrollable amounts, when I think of it, and the self flooding continued for quite a while after the intended output was finished, until I grew tired of waiting for it to finish and killed the process instead.
Re: 0087 flooding itself w javax.swing.text messag
Reply #3 - May 7th, 2005, 7:36pm
 
k, i'll need your sketch then (or a sketch that'll do the same thing). perhaps you were using print() and what was being printed had no spaces, causing it to freak out because it couldn't properly do the line breaks?

the error messages are for something deep within java so we just have to figure out what's triggering it.
Re: 0087 flooding itself w javax.swing.text messag
Reply #4 - May 7th, 2005, 8:12pm
 
Ok, results after some testing. Spaces are not relevant. Line breaks are.

This works:
Code:

for(int i=0;i<1000;i++) print("baa boo ");


This causes flood of swing errors:
Code:

for(int i=0;i<10000;i++) print("baa boo ");


Then again, this does not:
Code:

for(int i=0;i<10000;i++) {
print("baa boo ");
if(i%1000==0) print("\n");
}


And after some even more hard core testing, the limit of working print() output without line breaks seem to be at 32775 characters.

Code:

println();
for(int i=0;i<32775;i++) { print("b"); }


..works, but adding another number to the iteration makes the stdout.txt grow and P5 go good night.
Re: 0087 flooding itself w javax.swing.text messag
Reply #5 - May 7th, 2005, 8:29pm
 
i'm guessing you meant the middle one to be println() ?

so it appears that sun's text component has a problem and can't deal with lines > 32k characters..

i guess i'll just add something to catch this and force line breaks (real ones) along the way.
Re: 0087 flooding itself w javax.swing.text messag
Reply #6 - May 11th, 2005, 10:29am
 
fixed for 0091.
Page Index Toggle Pages: 1