You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-dev@xmlgraphics.apache.org by Vincent Hardy <vi...@eng.sun.com> on 2000/11/11 09:45:51 UTC

[bugs] TextLayout exception and Ausmap deadlock

Hello,

I have just found two problems:

a. When loading moscow.svgz, I get a null pointer exception when 
   rendering the thumbnail.

b. I get a deadlock on ausmap (we already had this problem a week or
   so ago. It seems the lock is at the same place as it used to be).

I have added the traces below for Moscow.

V.

Moscow
======

     [java] java.lang.ArrayIndexOutOfBoundsException
     [java]     at java.awt.font.TextLayout.<init>(TextLayout.java:453)
     [java]     at
org.apache.batik.refimpl.gvt.renderer.StrokingTextPainter.paint(StrokingTextPainter.java:99)
     [java]     at
org.apache.batik.refimpl.gvt.ConcreteTextNode.primitivePaint(ConcreteTextNode.java:324)
     [java]     at
org.apache.batik.refimpl.gvt.AbstractGraphicsNode.paint(AbstractGraphicsNode.java:376)
     [java]     at
org.apache.batik.refimpl.gvt.ConcreteCompositeGraphicsNode.primitivePaint(ConcreteCompositeGraphicsNo
de.java:109)
     [java]     at
org.apache.batik.refimpl.gvt.AbstractGraphicsNode.paint(AbstractGraphicsNode.java:376)
     [java]     at
org.apache.batik.refimpl.gvt.ConcreteCompositeGraphicsNode.primitivePaint(ConcreteCompositeGraphicsNo
de.java:109)
     [java]     at
org.apache.batik.refimpl.gvt.AbstractGraphicsNode.paint(AbstractGraphicsNode.java:376)
     [java]     at
org.apache.batik.refimpl.gvt.ConcreteCompositeGraphicsNode.primitivePaint(ConcreteCompositeGraphicsNo
de.java:109)
     [java]     at
org.apache.batik.refimpl.gvt.ConcreteCanvasGraphicsNode.primitivePaint(ConcreteCanvasGraphicsNode.jav
a:77)
     [java]     at
org.apache.batik.refimpl.gvt.AbstractGraphicsNode.paint(AbstractGraphicsNode.java:376)
     [java]     at
org.apache.batik.refimpl.gvt.ConcreteCompositeGraphicsNode.primitivePaint(ConcreteCompositeGraphicsNo
de.java:109)
     [java]     at
org.apache.batik.refimpl.gvt.filter.ConcreteGraphicsNodeRable.createRendering(ConcreteGraphicsNodeRab
le.java:359)
     [java]     at
org.apache.batik.refimpl.gvt.AbstractGraphicsNode.paint(AbstractGraphicsNode.java:403)
     [java]     at
org.apache.batik.refimpl.gvt.renderer.StaticRenderer.repaint(StaticRenderer.java:166)
     [java]     at
org.apache.batik.refimpl.util.JSVGCanvas$ThumbnailCanvas$ThumbnailRepaintThread.run(JSVGCanvas.java:1
271)

Re: [bugs] TextLayout exception and Ausmap deadlock

Posted by Bill Haneman <bi...@ireland.sun.com>.
Stephane Hillion wrote:

> I did: see the mail entitled '[commit] XSL and deprecation' (2000/11/05).
> --
>     Stephane.

Oh, sorry to misunderstand you, I thought you meant that you had fixed
it since
I made my post yesterday.

You are right, Component.repaint() is probably safe in a background
thread...
at least JComponent.repaint() is guaranteed to be safe.  I have not
found
confirmation that Component.repaint() is also safe but it should be. 
[The
only other JComponent call that is safe is revalidate().]

I have an implementation of MemoryMonitor that uses two new classes,
Timer and TimerTask (in org.apache.batik.util, modeled after the
1.3-only
classes java.util.Timer and java.util.TimerTask).  But yours should work
as
well.  Perhaps I will commit the Timer classes just for future use
anyway.

-Bill

--------------
Bill Haneman
+1 353 1 849 0495

Re: [bugs] TextLayout exception and Ausmap deadlock

Posted by Stephane Hillion <St...@sophia.inria.fr>.
Bill Haneman wrote:

> Stephane Hillion wrote:
> >
> > >     MemoryMonitor (unsafe, needs fixing)
> >
> > I fixed this one, Bill. You can remove it from your black list ;)
>
> I have fixed it as well.  Why didn't you tell me you were working on it?

I did: see the mail entitled '[commit] XSL and deprecation' (2000/11/05).
--
    Stephane.



Re: [bugs] TextLayout exception and Ausmap deadlock

Posted by Bill Haneman <bi...@ireland.sun.com>.
Stephane Hillion wrote:
> 
> >     MemoryMonitor (unsafe, needs fixing)
> 
> I fixed this one, Bill. You can remove it from your black list ;)

I have fixed it as well.  Why didn't you tell me you were working on it?

-Bill

-- 
--------------
Bill Haneman
+1 353 1 849 0495

Re: [bugs] TextLayout exception and Ausmap deadlock

Posted by Bill Haneman <bi...@ireland.sun.com>.
I have fixes ready which involve changes to the following files:

MemoryMonitor.java
JSVGCanvas.java 
(and some new files)

The changes to JSVGCanvas are substantial, but more are required for
best results.  Because the changes are so significant I ideally need
a bit of time to test them.  In the meantime the changes seem stable and
should no longer present a risk of thread problems.

If anyone has a pressing need for me to commit these fixes 
early (before tomorrow afternoon GMT) please let me know.  Otherwise I
will wait to commit them.

-Bill

--------------
Bill Haneman
+1 353 1 849 0495

Re: [bugs] TextLayout exception and Ausmap deadlock

Posted by Stephane Hillion <St...@sophia.inria.fr>.
Bill Haneman wrote:

> Files that use background threads:
>     ViewerFrame (fixed last week)
>     DocumentLoadRunnable (new, safe)
>     MemoryMonitor (unsafe, needs fixing)

I fixed this one, Bill. You can remove it from your black list ;)

>
>     JSVGCanvas (the source of the "moscow" bug, I think)
>     DefaultUserAgent (haven't examined yet)
>     RasterRable

--
    Stephane.



Re: [bugs] TextLayout exception and Ausmap deadlock

Posted by Bill Haneman <bi...@ireland.sun.com>.
Bill Haneman wrote:

Aha!

I should have done grep -r for Thread and Runnable days ago.
I just found lots of thread code that I wasn't aware of 
before, and there are definitely things in there that could
account for the problems.

Since thread behavior will have a significant impact on
error propagation I think I should try to fix these before 
code freeze - I will have a guesstimate this weekend on 
when I can have fixes committed, I hope.  I might be able to
make fixes this weekend...

Files that use background threads:
    ViewerFrame (fixed last week)
    DocumentLoadRunnable (new, safe)
    MemoryMonitor (unsafe, needs fixing)
    JSVGCanvas (the source of the "moscow" bug, I think)
    DefaultUserAgent (haven't examined yet)
    RasterRable

-Bill

--------------
Bill Haneman
+1 353 1 849 0495

Re: [bugs] TextLayout exception and Ausmap deadlock

Posted by Bill Haneman <bi...@ireland.sun.com>.
Vincent Hardy wrote:
> 
> Hello,
> 
> I have just found two problems:
> 
> a. When loading moscow.svgz, I get a null pointer exception when
>    rendering the thumbnail.

I'm pretty sure this is a thread problem.  I didn't change the thread
behavior on thumbnails (yet:-) - looks like I had better do so.

> b. I get a deadlock on ausmap (we already had this problem a week or
>    so ago. It seems the lock is at the same place as it used to be).

I've still never been able to duplicate this, on Linux or Solaris.

Not sure what you mean by "same place" - could you give more info
off-list?  Also, are you using the thumbnail with Ausmap?

Thanks.

----------------
Bill Haneman
+1 353 1 849 0495