[OpenJDK 2D-Dev] Bug in pisces Stroker (div by zero)

Mark Wielaard mark at klomp.org
Fri Nov 21 21:51:54 UTC 2008


Hi,

There is a bug in the pisces Stroker in finish(). When ldx and ldy are
so small (zero) that lineLength() will return zero, then you will get a
div by zero exception.

You can see this with for example this webstart application (you will
need to have IcedTeaWebstart [netx] installed):
http://linuxhippy.blogspot.com/2008/11/jgears2-rendermark.html

java.lang.ArithmeticException: / by zero
  at sun.java2d.pisces.Stroker.finish(Stroker.java:698)
  at sun.java2d.pisces.Stroker.close(Stroker.java:592)
  at sun.java2d.pisces.PiscesRenderingEngine.pathTo(PiscesRenderingEngine.java:248)
  at sun.java2d.pisces.PiscesRenderingEngine.strokeTo(PiscesRenderingEngine.java:231)
  at sun.java2d.pisces.PiscesRenderingEngine.strokeTo(PiscesRenderingEngine.java:181)
  at sun.java2d.pisces.PiscesRenderingEngine.strokeTo(PiscesRenderingEngine.java:145)
  at sun.java2d.pipe.LoopPipe.getStrokeSpans(LoopPipe.java:274)
  at sun.java2d.x11.X11Renderer.draw(X11Renderer.java:343)
  at sun.java2d.pipe.ValidatePipe.draw(ValidatePipe.java:154)
  at sun.java2d.SunGraphics2D.draw(SunGraphics2D.java:2392)
  at JGears2.renderShape(JGears2.java:244)
  [...]

Attached is the workaround that I checked into IcedTea to make this work
reliably:

2008-11-21  Mark Wielaard  <mark at klomp.org>

    * patches/icedtea-stroker-finish.patch: New patch.
    * Makefile.am (ICEDTEA_PATCHES): Add new patch.
    * HACKING: Document new patch.

Cheers,

Mark
-------------- next part --------------
A non-text attachment was scrubbed...
Name: icedtea-stroker-finish.patch
Type: text/x-patch
Size: 877 bytes
Desc: not available
URL: <http://mail.openjdk.java.net/pipermail/2d-dev/attachments/20081121/bf4ac721/icedtea-stroker-finish.patch>


More information about the 2d-dev mailing list