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 › sun.dc.pr.PRException: endPath: bad path
Page Index Toggle Pages: 1
sun.dc.pr.PRException: endPath: bad path (Read 3794 times)
sun.dc.pr.PRException: endPath: bad path
Apr 20th, 2005, 11:53am
 
I just got this error message and the applet has frozen in such a way that I cannot close the window.

It's happening in a simple drawing app where I'm using the JAVA2D renderer and nothing but standard line() methods. The problem is difficult to reproduce because it only happens in rare cases - but I thought it is worth mentioning.
Re: sun.dc.pr.PRException: endPath: bad path
Reply #1 - Apr 20th, 2005, 2:39pm
 
I searched google for this bug and it seems to be a Java-internal thing that occurs when calling line() with huge values or NaN or infinity and Antialiasing turned on - but that's a bit speculative.

Here's one report that might be related to this:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4696289

On another post I read that it also might be caused by a bug in the Math.round() method:

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4755500

Well it sounds nasty and is quite annoying because I always have to CTRL-ATL-DEL and kill the java thread.
Re: sun.dc.pr.PRException: endPath: bad path
Reply #2 - Apr 20th, 2005, 4:02pm
 
yeah, it's that your line is either enormously off screen (-100000, 200000), NaN (not a number), +Infinity or -Infinity. i.e. if you divide by zero.

i'll see if we can catch these errors, but in the meantime will make a note in the faq.

(edit) so in the end, it's actually your bug, but the fact that it's locking up, thats mine. Wink will see about fixing that part of it.

do you have a short piece of code that causes the lockup? i usually only get a spew of errors.
Re: sun.dc.pr.PRException: endPath: bad path
Reply #3 - Apr 20th, 2005, 4:10pm
 
Ah, this is a really irritating behaviour on the part of Java 2D.  I had to avoid this by making sure I never, ever, ever sent a NaN anywhere near the drawing functions.  Things like trying to normalise a vector of length 0.0 really messed things up.

Never completely locked up though - you can just catch the exception and throw it away, I think, which I got away with for a while (though it did slow things down a lot).
Re: sun.dc.pr.PRException: endPath: bad path
Reply #4 - Apr 20th, 2005, 4:15pm
 
In the meantime I discovered, that even though the applet window doesn't go away I could simply restart it by pressing the "play" button again - so at least CTRL-ALT-DEL is not necessary.

For a minimal example just try this:
Code:

void draw(){
 smooth();
 line(0,0,10000000,10);
}


As you will see - smooth() is necessary to trigger the bug.

The question is, if it might be an idea (or if it is even possible) to plug some security measure into the line() sourcecode, like checking for NaN or limiting the allowed coordinate space - though it might slow things down. Maybe introduce some kind of "SAFE_MODE" flag?
Re: sun.dc.pr.PRException: endPath: bad path
Reply #5 - Jul 28th, 2005, 5:27am
 
now filed:
http://dev.processing.org/bugs/show_bug.cgi?id=104
please go there for any follow-up
Page Index Toggle Pages: 1