Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 4648626
Votes 3
Synopsis Exception thrown and infinite loop in java2demo with remote display
Category java:classes_2d
Reported Against 1.4 , hopper
Release Fixed 1.4.2(mantis)
State 10-Fix Delivered, bug
Priority: 4-Low
Related Bugs 4321790
Submit Date 07-MAR-2002
Description
I found this while testing.  It occurs in Merlin as well as Hopper.  

It only occurs when rlogged into jano (Solaris 2.6) and displaying 
back to my machine (gradgrind - solaris 2.7) - not when I run it at 
the console on gradgrind.  

The problem occurs on the Composite tab.  It may be attempting to 
transfer to the next tab (Font) when the exception is thrown.  
Here is my output:  

 xxxxx@xxxxx :/home/echawkes( 41 )% setenv DISPLAY gradgrind:0.0   
 xxxxx@xxxxx :/home/echawkes( 42 )% /java/jdk/bin/jdkx -r 1.4 java2demo 
cd /usr/local/java/jdk1.4/solsparc/demo/jfc/Java2D
/usr/local/java/jdk1.4/solsparc/bin/java -jar Java2Demo.jar -runs=1 -delay=5 -ccthread

Java2D Demo RunWindow : 1 Runs, 5 second delay between tabs
java version: 1.4.0
SunOS 5.6

#0 Wed Mar 06 17:55:58 PST 2002, 4757.0547K used
sun.dc.pr.PRException: endPath: bad path
        at sun.dc.pr.Rasterizer.endPath(Rasterizer.java:537)
        at sun.java2d.pipe.DuctusRenderer.createShapeRasterizer(DuctusRenderer.java:374)
        at sun.java2d.pipe.DuctusShapeRenderer.renderPath(DuctusShapeRenderer.java:57)
        at sun.java2d.pipe.DuctusShapeRenderer.fill(DuctusShapeRenderer.java:49)
        at sun.java2d.SunGraphics2D.fill(SunGraphics2D.java:2190)
        at java.awt.font.ShapeGraphicAttribute.draw(ShapeGraphicAttribute.java:134)
        at sun.awt.font.GraphicComponent.handleDraw(GraphicComponent.java:224)
        at sun.awt.font.Decoration$DecorationImpl.drawTextAndEmbellishments(Decoration.java:236)
        at sun.awt.font.Decoration$DecorationImpl.drawTextAndDecorations(Decoration.java:301)
        at sun.awt.font.GraphicComponent.draw(GraphicComponent.java:231)
        at java.awt.font.TextLine.draw(TextLine.java:495)
        at java.awt.font.TextLayout.draw(TextLayout.java:2666)
        at java2d.demos.Fonts.AttributedStr.render(AttributedStr.java:134)
        at java2d.Surface.paint(Surface.java:325)
        at javax.swing.JComponent.paintChildren(JComponent.java:643)
        at javax.swing.JComponent.paint(JComponent.java:813)
        at javax.swing.JComponent.paintChildren(JComponent.java:643)
        at javax.swing.JComponent.paint(JComponent.java:813)
        at javax.swing.JComponent.paintChildren(JComponent.java:643)
        at javax.swing.JComponent.paint(JComponent.java:813)
        at javax.swing.JComponent.paintChildren(JComponent.java:643)
        at javax.swing.JComponent.paint(JComponent.java:813)
        at javax.swing.JComponent.paintChildren(JComponent.java:643)
        at javax.swing.JComponent.paint(JComponent.java:813)
        at javax.swing.JComponent.paintChildren(JComponent.java:643)
        at javax.swing.JComponent.paint(JComponent.java:813)
        at javax.swing.JComponent.paintWithOffscreenBuffer(JComponent.java:4735)
        at javax.swing.JComponent.paintDoubleBuffered(JComponent.java:4688)
        at javax.swing.JComponent._paintImmediately(JComponent.java:4632)
        at javax.swing.JComponent.paintImmediately(JComponent.java:4464)
        at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:404)
        at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:117)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:443)
        at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:190)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:144)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:130)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:98)
sun.dc.pr.PRException: endPath: bad path
        at sun.dc.pr.Rasterizer.endPath(Rasterizer.java:537)
        at sun.java2d.pipe.DuctusRenderer.createShapeRasterizer(DuctusRenderer.java:374)
        at sun.java2d.pipe.DuctusShapeRenderer.renderPath(DuctusShapeRenderer.java:57)
        at sun.java2d.pipe.DuctusShapeRenderer.draw(DuctusShapeRenderer.java:45)
        at sun.java2d.SunGraphics2D.draw(SunGraphics2D.java:2162)
        at sun.awt.font.Underline$StandardUnderline.drawUnderline(Underline.java:157)
        at sun.awt.font.Decoration$DecorationImpl.drawTextAndEmbellishments(Decoration.java:259)
        at sun.awt.font.Decoration$DecorationImpl.drawTextAndDecorations(Decoration.java:301)
        at sun.awt.font.ExtendedTextSourceLabel.draw(ExtendedTextSourceLabel.java:116)
        at java.awt.font.TextLine.draw(TextLine.java:495)
        at java.awt.font.TextLayout.draw(TextLayout.java:2666)
        at java2d.demos.Fonts.AttributedStr.render(AttributedStr.java:134)
        at java2d.Surface.paint(Surface.java:325)
        at javax.swing.JComponent.paintChildren(JComponent.java:643)
        at javax.swing.JComponent.paint(JComponent.java:813)
        at javax.swing.JComponent.paintChildren(JComponent.java:643)
        at javax.swing.JComponent.paint(JComponent.java:813)
        at javax.swing.JComponent.paintChildren(JComponent.java:643)
        at javax.swing.JComponent.paint(JComponent.java:813)
        at javax.swing.JComponent.paintChildren(JComponent.java:643)
        at javax.swing.JComponent.paint(JComponent.java:813)
        at javax.swing.JComponent.paintChildren(JComponent.java:643)
        at javax.swing.JComponent.paint(JComponent.java:813)
        at javax.swing.JComponent.paintChildren(JComponent.java:643)
        at javax.swing.JComponent.paint(JComponent.java:813)
        at javax.swing.JComponent.paintWithOffscreenBuffer(JComponent.java:4735)
        at javax.swing.JComponent.paintDoubleBuffered(JComponent.java:4688)
        at javax.swing.JComponent._paintImmediately(JComponent.java:4632)
        at javax.swing.JComponent.paintImmediately(JComponent.java:4464)
        at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:404)
        at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:117)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:443)
        at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:190)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:144)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:130)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:98)
sun.dc.pr.PRException: endPath: bad path
        at sun.dc.pr.Rasterizer.endPath(Rasterizer.java:537)
        at sun.java2d.pipe.DuctusRenderer.createShapeRasterizer(DuctusRenderer.java:374)
        at sun.java2d.pipe.DuctusShapeRenderer.renderPath(DuctusShapeRenderer.java:57)
        at sun.java2d.pipe.DuctusShapeRenderer.fill(DuctusShapeRenderer.java:49)
        at sun.java2d.pipe.ValidatePipe.fill(ValidatePipe.java:119)
        at sun.java2d.SunGraphics2D.fill(SunGraphics2D.java:2190)
        at sun.awt.font.Decoration$DecorationImpl.drawTextAndDecorations(Decoration.java:297)
        at sun.awt.font.ExtendedTextSourceLabel.draw(ExtendedTextSourceLabel.java:116)
        at java.awt.font.TextLine.draw(TextLine.java:495)
        at java.awt.font.TextLayout.draw(TextLayout.java:2666)
        at java2d.demos.Fonts.AttributedStr.render(AttributedStr.java:134)
        at java2d.Surface.paint(Surface.java:325)
        at javax.swing.JComponent.paintChildren(JComponent.java:643)
        at javax.swing.JComponent.paint(JComponent.java:813)
        at javax.swing.JComponent.paintChildren(JComponent.java:643)
        at javax.swing.JComponent.paint(JComponent.java:813)
        at javax.swing.JComponent.paintChildren(JComponent.java:643)
        at javax.swing.JComponent.paint(JComponent.java:813)
        at javax.swing.JComponent.paintChildren(JComponent.java:643)
        at javax.swing.JComponent.paint(JComponent.java:813)
        at javax.swing.JComponent.paintChildren(JComponent.java:643)
        at javax.swing.JComponent.paint(JComponent.java:813)
        at javax.swing.JComponent.paintChildren(JComponent.java:643)
        at javax.swing.JComponent.paint(JComponent.java:813)
        at javax.swing.JComponent.paintWithOffscreenBuffer(JComponent.java:4735)
        at javax.swing.JComponent.paintDoubleBuffered(JComponent.java:4688)
        at javax.swing.JComponent._paintImmediately(JComponent.java:4632)
        at javax.swing.JComponent.paintImmediately(JComponent.java:4464)
        at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:404)
        at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:117)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:443)
        at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:190)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:144)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:130)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:98)
sun.dc.pr.PRException: endPath: bad path
        at sun.dc.pr.Rasterizer.endPath(Rasterizer.java:537)
        at sun.java2d.pipe.DuctusRenderer.createShapeRasterizer(DuctusRenderer.java:374)
        at sun.java2d.pipe.DuctusShapeRenderer.renderPath(DuctusShapeRenderer.java:57)
        at sun.java2d.pipe.DuctusShapeRenderer.fill(DuctusShapeRenderer.java:49)
        at sun.java2d.SunGraphics2D.fill(SunGraphics2D.java:2190)
        at java.awt.font.ShapeGraphicAttribute.draw(ShapeGraphicAttribute.java:134)
        at sun.awt.font.GraphicComponent.handleDraw(GraphicComponent.java:224)
        at sun.awt.font.Decoration$DecorationImpl.drawTextAndEmbellishments(Decoration.java:236)
        at sun.awt.font.Decoration$DecorationImpl.drawTextAndDecorations(Decoration.java:301)
        at sun.awt.font.GraphicComponent.draw(GraphicComponent.java:231)


and so on.... 

Work Around
N/A
Evaluation
This seems to be a fonts problem. 
The demo that throws the exception is java2d.demos.Fonts.AttributedStr .

The exception is thrown only when the application is run remotely, even 
with the pixmaps support disabled:
[ xxxxx@xxxxx :] -< demo/jfc/Java2D >
#>../../../bin/java -Dsun.java2d.pmoffscreen=false -cp Java2Demo.jar 
sun.dc.pr.PRException: endPath: bad path
        at sun.dc.pr.Rasterizer.endPath(Rasterizer.java:537)
        at sun.java2d.pipe.DuctusRenderer.createShapeRasterizer(DuctusRenderer.java:374)
        at sun.java2d.pipe.DuctusShapeRenderer.renderPath(DuctusShapeRenderer.java:57)
        at sun.java2d.pipe.DuctusShapeRenderer.fill(DuctusShapeRenderer.java:49)
...

Also, I can't reproduce it on local display with the pixmaps turned 
on and dga/shared memory turned off (to simulate the remote display 
situation).

So the problem is probably in the way we use fonts when running remotely.

Reassigning to fonts engineer.

 xxxxx@xxxxx  2002-03-11
========================================

I think we are passing out of bounds values because TextLayout is
misbehaving. Its happening when remote displaying but I don't know why
yet. The following simple program 

import java.awt.*;
import java.awt.font.*;

public class BB {

 public static void main(String args[]) {
    FontRenderContext frc = new FontRenderContext(null, false, false);
    Font font = new Font("dialog", Font.PLAIN, 12);
    TextLayout tl = new TextLayout("str", font, frc);
    //System.out.println(tl.toString());
    System.err.println("bhgt="+ tl.getBounds().getHeight());
    System.err.println("asc="+ tl.getAscent());
    System.err.println("dsc="+ tl.getDescent());
    System.err.println("ldg="+ tl.getLeading());
 }
}

prints this displaying remotely :-

bhgt=-3.4028234663852886E38 
asc=12.0
dsc=4.0
ldg=1.0

but a sensible value when displaying locally, or with the headless toolkit.
 
 xxxxx@xxxxx  2002-03-11
============================

This can be reproduced in varying ways all the way back to JDk 1.2.

 xxxxx@xxxxx  2002-04-17

================================

We have seen a new manifestation of this which I have tracked down.
When a strike is created it is created through a cache, The constructor
(hsGGlyphStrike::hsGGlyphStrike) first ask the scaler to count
the number of glyphs in the font and if that is > 0 it initialises the
metrics. The flaw is that if font initialisation failed for some reason
(and fGlyphCount is 0) then the metrics are never initialised. Subsequent
client queries then retrieve random uninitialised values.
I believe this is the underlying cause of all of these problems.
They are typically seen remotely because that is when we tend to run
into problems where fonts that are expected to be found aren't found.
For many fonts it isn't a problem because we can fall back to using T2K
rather than the Xserver (if we were using the Xserver at all).
But for fonts which were not located as files then there is no fall back
and we hit this bug.
In this case a problem arose displaying from Solaris to Linux because the
font properties now explicitly mapped F3 fonts that previously would have
just "not found". a "default" font would have been substituted. Its probably
worth noting that not finding these fonts means that historically almost all
remote displays from Solaris to any system *other* than Solaris would trigger
a "loadfonts()"
[[ASIDE: The loadfonts is triggered because null is returned by a call in
initTerminalNames() to  getFileNameFromPlatformName(). Fixing that
requires reworking some code structure so that it would not do the loadfonts
where it was not going to help. ie it will not help if it was a native font
and the display is remote. It may still help if its a remote display and
the font is file-based. So you can only avoid loadfonts when you know that
it is a native-only font and that you will not be able to set the X font path
to locate any more fonts than are already located]].

The simple fix is to initialise the metrics to 0 values. This then
treats these fonts as having no glyphs and "zero" metrics. A more complete
fix is to discard the useless composite slot or to replace it with a 
targetted substitute.
Substituting the default font (dialog) as was currently happening is
questionable since dialog uses the components that weren't found.
We should also examine if the new code fixed under 4321790 should try to
handle this. It could try to determine if a native font that is "mapped"
by explicit font properties entries is actually available via native APIs
and subsitute a default if it isn't.

 xxxxx@xxxxx  2002-10-15
============================
Comments
  
  Include a link with my name & email   

Submitted On 25-APR-2002
javasoft_bit
I am able to reproduce the very same behaviour locally on
Windows NT but cannot provide an easy test case.

"1.3.1_03"
Java(TM) 2 Runtime Environment, Standard Edition (build
1.3.1_03-b03)
Java HotSpot(TM) Client VM (build 1.3.1_03-b03, mixed mode)


Submitted On 25-APR-2002
javasoft_bit
This seems to be duplicate of 4485298 which is open since
Jul 27, 2001!


Submitted On 25-APR-2002
javasoft_bit
Digging even further I discovered that this is a known bug
(4190780) since Nov 17, 1998.


Submitted On 01-MAY-2002
metasim
Definately the same as 4485298


Submitted On 27-SEP-2002
carcher
I am seeing the the same PRException: endPath: badPath 
exception under Windows NT as well under 1.4.0_02.  It is not 
reliably reproducible but results in the JVM crashing and the 
following appears in the Dr. Watson log:

State Dump for Thread Id 0x224

eax=00000000 ebx=259e4a3c ecx=6b27fb60 edx=6b27fb60 
esi=00000000 edi=00a00000
eip=6d08f7aa esp=6b27fb60 ebp=6b27fc04 iopl=0         nv up 
ei pl zr na po nc
cs=001b  ss=0023  ds=0023  es=0023  fs=0038  
gs=0000             efl=00000246


function: awt_getBIColorOrder
        6d08f78f 5e               pop     esi
        6d08f790 c3               ret
        6d08f791 83ec10           sub     esp,0x10
        6d08f794 56               push    esi
        6d08f795 6802000100       push    0x10002
        6d08f79a ff35e07e0c6d     push    dword ptr 
[6d0c7ee0]   ds:6d0c7ee0=6d411b2c
        6d08f7a0 e865120000       call    6d090a0a
        6d08f7a5 8bf0             mov     esi,eax
        6d08f7a7 6a01             push    0x1
        6d08f7a9 56               push    esi
FAULT ->6d08f7aa 8b06             mov     eax,[esi]              
ds:00000000=????????
        6d08f7ac ff5068           call    dword ptr [eax+0x68]   
ds:00dfea06=e4f066bc
        6d08f7af 85c0             test    eax,eax
        6d08f7b1 0f8c82000000     jl      
awt_getBIColorOrder+0x1f4 (6d08f839)
        6d08f7b7 53               push    ebx
        6d08f7b8 55               push    ebp
        6d08f7b9 57               push    edi
        6d08f7ba ff35a8810c6d     push    dword ptr 
[6d0c81a8]   ds:6d0c81a8=0079e560
        6d08f7c0 ff35b0810c6d     push    dword ptr 
[6d0c81b0]   ds:6d0c81b0=007685a8
        6d08f7c6 56               push    esi
        6d08f7c7 e89dc3fdff           call 
Java_sun_awt_windows_WColor_getDefaultColor+0x4ff8 
(6d06bb69)
        6d08f7cc ff35ac810c6d     push    dword ptr 
[6d0c81ac]   ds:6d0c81ac=0079e520

*----> Stack Back Trace <----*

FramePtr ReturnAd Param#1  Param#2  Param#3  Param#4  
Function Name
6b27fc04 6d386edb 259e4a28 1e7bfc6c 6d38c8d8 1e7bfc6c !
awt_getBIColorOrder 

*----> Raw Stack Dump <----*
6b27fb60  00 00 00 00 01 00 00 00 - 00 00 a0 00 20 00 ba 
75  ............ ..u
6b27fb70  a8 ff 27 6b 03 ef 00 78 - 48 e2 02 78 1f 59 00 
78  ..'k...xH..x.Y.x
6b27fb80  00 00 a0 00 52 cc 00 78 - 00 00 a0 00 c2 12 00 
78  ....R..x.......x
6b27fb90  00 00 a0 00 01 00 00 00 - 26 ef 38 6d 00 00 a0 
00  ........&.8m....
6b27fba0  00 00 a0 00 14 99 81 79 - a7 04 35 6d 00 00 a0 
00  .......y..5m....
6b27fbb0  3c 4a 9e 25 09 4a c3 48 - 14 99 81 79 80 70 38 
6d  <J.%.J.H...y.p8m
6b27fbc0  00 00 14 00 c0 4a c9 25 - 02 6f 38 6d c0 4a c9 
25  .....J.%.o8m.J.%
6b27fbd0  09 4a c3 48 c0 4a c9 25 - 34 4a 9e 25 15 6f 38 
6d  .J.H.J.%4J.%.o8m
6b27fbe0  c0 4a c9 25 54 09 13 67 - 34 4a 9e 25 bb 24 35 
6d  .J.%T..g4J.%.$5m
6b27fbf0  34 4a 9e 25 30 d5 42 6d - 8c a3 7f 1e 28 4a 9e 25  
4J.%0.Bm....(J.%
6b27fc00  58 09 13 67 60 fc 27 6b - db 6e 38 6d 28 4a 9e 
25  X..g`.'k.n8m(J.%
6b27fc10  6c fc 7b 1e d8 c8 38 6d - 6c fc 7b 1e e0 4c 76 00  
l.{...8ml.{..Lv.
6b27fc20  c0 01 b3 66 b1 6f 38 6d - 00 00 78 1e 75 6f 38 
6d  ...f.o8m..x.uo8m
6b27fc30  30 d5 42 6d 81 74 38 6d - 3c 19 43 6d c5 38 3b 
6d  0.Bm.t8m<.Cm.8;m
6b27fc40  3c 19 43 6d e0 4c 76 00 - e0 4c 76 00 67 94 34 
6d  <.Cm.Lv..Lv.g.4m
6b27fc50  30 d5 42 6d 01 00 00 00 - e0 4c 76 00 01 00 00 
00  0.Bm.....Lv.....
6b27fc60  b4 fc 27 6b 2b 72 38 6d - 01 00 00 00 00 00 00 
00  ..'k+r8m........
6b27fc70  01 00 00 00 02 00 00 00 - 30 d5 42 6d 30 d5 42 
6d  ........0.Bm0.Bm
6b27fc80  00 00 00 00 e0 4c 76 00 - 00 00 00 00 01 00 00 
00  .....Lv.........
6b27fc90  01 00 00 00 18 6c 76 00 - 00 00 00 00 00 00 00 
00  .....lv.........



PLEASE NOTE: JDK6 is formerly known as Project Mustang