I expected this answer and I know that batik doesn't contain native code, but I hoped that I use batik in the wrong way, cause I have two separate applications which both are using batik in the same way as I described and both has the same problem(s). If I start GLIPSGraffiti or batik svgbrowser (squiggle) under Linux everthing is ok, there're both working great under Linux. Because of this I thought I do something wrong in my code.
Regards Fabian Am Mittwoch, 30. Januar 2008 19:23:00 schrieb Archie Cobbs: > This is a Sun JVM bug and not specific to Batik (Batik doesn't contain any > native code). > > You should report it to Sun's bug database: http://bugs.sun.com/ > > Including clear & precise instructions on how to reproduce the bug will > help them track it down. > > -Archie > > On Jan 30, 2008 12:04 PM, Fabian Unfried <[EMAIL PROTECTED]> wrote: > > Hi, > > > > I'm having a problem in using batik on Linux (no matter what distri). The > > Problem CAN (it's not happening always only sometimes) happen when the > > svg is > > rendered the first time or when it's already loaded and you're doing a > > scroll > > or a resize action on the svg. > > > > This is the output of the JavaVM: > > > > *** glibc detected *** java: munmap_chunk(): invalid pointer: 0x8fc41840 > > *** > > ======= Backtrace: ========= > > /lib/i686/libc.so.6(cfree+0x1bb)[0xb7e6113b] > > /usr/java/jdk1.6.0_03/jre/lib/i386/libdcpr.so[0x8ef89282] > > /usr/java/jdk1.6.0_03/jre/lib/i386/libdcpr.so[0x8ef8979c] > > /usr/java/jdk1.6.0_03/jre/lib/i386/libdcpr.so[0x8ef8ad1f] > > /usr/java/jdk1.6.0_03/jre/lib/i386/libdcpr.so[0x8ef8fcb7] > > > > /usr/java/jdk1.6.0_03/jre/lib/i386/libdcpr.so(Java_sun_dc_pr_PathFiller_d > >ispose+0x5c) [0x8ef8c4dc] > > [0xb4d1bb7b] > > [0xb4d143e9] > > [0xb4d143e9] > > [0xb4d143e9] > > [0xb4d11243] > > /usr/java/jdk1.6.0_03/jre/lib/i386/server/libjvm.so[0x62c5ecd] > > /usr/java/jdk1.6.0_03/jre/lib/i386/server/libjvm.so[0x64523b8] > > /usr/java/jdk1.6.0_03/jre/lib/i386/server/libjvm.so[0x62c57e0] > > /usr/java/jdk1.6.0_03/jre/lib/i386/server/libjvm.so[0x62c586d] > > /usr/java/jdk1.6.0_03/jre/lib/i386/server/libjvm.so[0x6335aa5] > > /usr/java/jdk1.6.0_03/jre/lib/i386/server/libjvm.so[0x65038c0] > > /usr/java/jdk1.6.0_03/jre/lib/i386/server/libjvm.so[0x64532a9] > > /lib/i686/libpthread.so.0[0xb7f48462] > > /lib/i686/libc.so.6(clone+0x5e)[0xb7ec582e] > > ======= Memory map: ======== > > 06000000-065a0000 r-xp 00000000 08:06 > > 4620302 /usr/java/jdk1.6.0_03/jre/lib/i386/server/libjvm.so > > 065a0000-065db000 rwxp 005a0000 08:06 > > 4620302 /usr/java/jdk1.6.0_03/jre/lib/i386/server/libjvm.so > > 065db000-069fc000 rwxp 065db000 00:00 0 > > 08048000-08052000 r-xp 00000000 08:06 > > 4313227 /usr/java/jdk1.6.0_03/bin/java > > 08052000-08053000 rwxp 00009000 08:06 > > 4313227 /usr/java/jdk1.6.0_03/bin/java > > 08053000-08a24000 rwxp 08053000 00:00 0 [heap] > > 8dd1f000-8e100000 rwxs 00000000 00:08 62816272 /SYSV00000000 (deleted) > > 8e100000-8e1fa000 rwxp 8e100000 00:00 0 > > 8e1fa000-8e200000 ---p 8e1fa000 00:00 0 > > 8e200000-8e2ff000 rwxp 8e200000 00:00 0 > > 8e2ff000-8e300000 ---p 8e2ff000 00:00 0 > > 8e300000-8e3ff000 rwxp 8e300000 00:00 0 > > 8e3ff000-8e400000 ---p 8e3ff000 00:00 0 > > 8e400000-8e500000 rwxp 8e400000 00:00 0 > > 8e500000-8e5fe000 rwxp 8e500000 00:00 0 > > 8e5fe000-8e600000 ---p 8e5fe000 00:00 0 > > 8e600000-8e6f4000 rwxp 8e600000 00:00 0 > > 8e6f4000-8e700000 ---p 8e6f4000 00:00 0 > > 8e700000-8e7a8000 rwxp 8e700000 00:00 0 > > 8e7a8000-8e800000 ---p 8e7a8000 00:00 0 > > 8e800000-8e8ff000 rwxp 8e800000 00:00 0 > > 8e8ff000-8e900000 ---p 8e8ff000 00:00 0 > > 8e900000-8ea00000 rwxp 8e900000 00:00 0 > > 8ea00000-8ec00000 rwxp 8ea00000 00:00 0 > > 8ec00000-8ee00000 rwxp 8ec00000 00:00 0 > > 8ee00000-8eeff000 rwxp 8ee00000 00:00 0 > > 8eeff000-8ef00000 ---p 8eeff000 00:00 0 > > 8ef87000-8ef9c000 r-xp 00000000 08:06 > > 4606612 /usr/java/jdk1.6.0_03/jre/lib/i386/libdcpr.so > > 8ef9c000-8efaf000 rwxp 00014000 08:06 > > 4606612 /usr/java/jdk1.6.0_03/jre/lib/i386/libdcpr.so > > 8efaf000-8efb2000 rwxp 8efaf000 00:00 0 > > 8efb2000-8f0fc000 rwxp 8efb2000 00:00 0 > > 8f0fc000-8f100000 ---p 8f0fc000 00:00 0 > > 8f100000-8f1fb000 rwxp 8f100000 00:00 0 > > 8f1fb000-8f200000 ---p 8f1fb000 00:00 0 > > 8f200000-8f300000 rwxp 8f200000 00:00 0 > > 8f30d000-8f310000 ---p 8f30d000 00:00 0 > > 8f310000-8f35e000 rwxp 8f310000 00:00 0 > > 8f35e000-8f361000 ---p 8f35e000 00:00 0 > > 8f361000-8f3af000 rwxp 8f361000 00:00 0 > > 8f3af000-8f3b2000 rwxp 8f3af000 00:00 0 > > 8f3b2000-8f4d4000 rwxp 8f3b2000 00:00 0 > > 8f4d4000-8f500000 ---p 8f4d4000 00:00 0 > > 8f500000-8f5d9000 rwxp 8f500000 00:00 0 > > 8f5d9000-8f600000 ---p 8f5d9000 00:00 0 > > 8f600000-8f6ff000 rwxp 8f600000 00:00 0 > > 8f6ff000-8f700000 ---p 8f6ff000 00:00 0 > > 8f700000-8f7fe000 rwxp 8f700000 00:00 0 > > 8f7fe000-8f800000 ---p 8f7fe000 00:00 0 > > 8f800000-8f8fe000 rwxp 8f800000 00:00 0 > > 8f8fe000-8f900000 ---p 8f8fe000 00:00 0 > > 8f905000-8f908000 ---p 8f905000 00:00 0 > > 8f908000-8f956000 rwxp 8f908000 00:00 0 > > 8f965000-8f9b9000 r-xp 00000000 08:06 > > 4606586 /usr/java/jdk1.6.0_03/jre/lib/i386/libcmm.so > > 8f9b9000-8f9bc000 rwxp 00054000 08:06 > > 4606586 /usr/java/jdk1.6.0_03/jre/lib/i386/libcmm.so > > 8f9bc000-8f9bf000 ---p 8f9bc000 00:00 0 > > 8f9bf000-8fa0d000 rwxp 8f9bf000 00:00 0 > > 8fa0d000-8fa10000 ---p 8fa0d000 00:00 0 > > 8fa10000-8fa5e000 rwxp 8fa10000 00:00 0 > > 8fa5e000-8fa61000 ---p 8fa5e000 00:00 0 > > 8fa61000-8faaf000 rwxp 8fa61000 00:00 0 > > 8faaf000-8fab2000 ---p 8faaf000 00:00 0 > > 8fab2000-8fb00000 rwxp 8fab2000 00:00 0 > > 8fb03000-8fb0e000 r-xp 00000000 08:06 5390390 /lib/libgcc_s-4.2.2.so.1 > > 8fb0e000-8fb0f000 rwxp 0000a000 08:06 5390390 /lib/libgcc_s-4.2.2.so.1 > > 8fb26000-8fb2c000 r-xs 00000000 08:15 > > 260629 /var/cache/fontconfig/20b58f14c9b581391d79ea335a81488a- > > x86.cache-2 > > 8fb2c000-8fb2e000 r-xs 00000000 08:15 > > 260628 /var/cache/fontconfig/87f5e051180a7a75f16eb6fe7dbd3749- > > x86.cache-2 > > 8fb2e000-8fb34000 r-xs 00000000 08:15 > > 260668 /var/cache/fontconfig/b79f3aaa7d385a141ab53ec885cc22a8- > > x86.cache-2 > > 8fb34000-8fb37000 r-xs 00000000 08:15 > > 260625 /var/cache/fontconfig/5d999c1bbe32f61af008974facb58b71- > > x86.cache-2 > > 8fb37000-8fb3d000 r-xs 00000000 08:15 > > 260624 /var/cache/fontconfig/79aeb4e90a401e55ec91db207072ba77- > > x86.cache-2 > > 8fb3d000-8fb43000 r-xs 00000000 08:15 > > 260629 /var/cache/fontconfig/20b58f14c9b581391d79ea335a81488a- > > x86.cache-2 > > 8fb43000-8fb51000 r-xs 00000000 08:15 > > 260673 /var/cache/fontconfig/8d4af663993b81a124ee82e610bb31f9- > > x86.cache-2 > > 8fb51000-8fb58000 r-xs 00106000 08:06 > > 4508028 /usr/java/jdk1.6.0_03/jre/lib/resources.jar > > 8fb58000-8fb5e000 r-xs 00091000 08:06 > > 4508032 /usr/java/jdk1.6.0_03/jre/lib/jsse.jar > > 8fb5e000-8fb61000 ---p 8fb5e000 00:00 0 > > 8fb61000-8fbaf000 rwxp 8fb61000 00:00 0 > > 8fbaf000-8fbb2000 ---p 8fbaf000 00:00 0 > > 8fbb2000-8fd00000 rwxp 8fbb2000 00:00 0 > > 8fd00000-8fd04000 rwxs 00000000 00:08 62881806 /SYSV00000000 (deleted) > > 8fd04000-8fd0a000 r-xs 00000000 08:15 > > 260668 /var/cache/fontconfig/b79f3aaa7d385a141ab53ec885cc22a8- > > x86.cache-2 > > 8fd0a000-8fd0d000 ---p 8fd0a000 00:00 0 > > 8fd0d000-8fd5b000 rwxp 8fd0d000 00:00 0 > > 8fd5b000-8fd5f000 r-xp 00000000 08:06 3736843 > > /usr/lib/libXfixes.so.3.1.0 > > 8fd5f000-8fd60000 rwxp 00003000 08:06 3736843 > > /usr/lib/libXfixes.so.3.1.0 > > 8fd60000-8fd68000 r-xp 00000000 08:06 3736777 > > /usr/lib/libXrender.so.1.3.0 > > 8fd68000-8fd69000 rwxp 00007000 08:06 3736777 > > /usr/lib/libXrender.so.1.3.0 > > 8fd69000-8fd72000 r-xp 00000000 08:06 3738165 > > /usr/lib/libXcursor.so.1.0.2 > > 8fd72000-8fd73000 rwxp 00008000 08:06 3738165 > > /usr/lib/libXcursor.so.1.0.2 > > > > > > Sometimes the JavaVM creates a hs_err_pidXXXXX.log (maybe there is more > > than > > one problem) I attached the last hs_err_pidXXXXX.log I got, the > > hs_err_log have nothing to do with the output I wrote (*** glibc detected > > *** java: munmap_chunk(): invalid pointer: 0x8fc41840 *** and so on). > > > > > > Here is the code how I open a SVG File with batik and how I handle the > > Events: > > > > [...] snip [...] > > > > SAXSVGDocumentFactory df = null; > > SVGOMDocument map = null; > > SVGSVGElement svgRootElement = null; > > SVGTransformation svgTrans = null; > > > > String parser = > > XMLResourceDescriptor.getXMLParserClassName (); > > SAXSVGDocumentFactory df = new > > SAXSVGDocumentFactory(parser); > > > > if(log.isDebugEnabled()) > > { > > log.debug("Use XML parser: '" + parser + "'"); > > } > > > > try > > { > > String imageURI = (new > > File(imageName)).toURI().toURL().toString(); > > map = (SVGOMDocument) df.createSVGDocument > > (imageURI); > > } > > catch(java.io.IOException ioe) > > { > > log.error("Error while creating > > SVGDocument-Object", ioe); > > } > > > > svgCanvas = new JSVGCanvas(this); > > svgCanvas.setDocumentState(SVGMapCanvas.ALWAYS_DYNAMIC); > > svgCanvas.setSVGDocument(map); > > > > svgRootElement = map.getRootElement(); > > > > svgTrans = new SVGTransformation(svgCanvas, > > svgRootElement); > > > > EventTarget eventTarget = (EventTarget) svgRootElement; > > eventTarget.addEventListener("SVGResize", new > > OnResizeAction(), false); > > eventTarget.addEventListener("SVGScroll", new > > OnScrollAction(), false); > > > > [...] snip [...] > > > > > > Here are the actions > > > > private class OnResizeAction implements EventListener > > { > > /** > > * DOCUMENT ME! > > * > > * @param evt DOCUMENT ME! > > */ > > public void handleEvent(Event evt) > > { > > if(log.isDebugEnabled()) > > { > > log.debug("OnResizeAction"); > > } > > > > svgTrans.update(); > > > > double[] values = new double[4]; > > values[0] = ((-10 - svgTrans.getShiftX()) / > > svgTrans.getScaleX()); > > values[1] = ((svgCanvas.getWidth() - > > svgTrans.getShiftX()) / > > svgTrans.getScaleX()); > > values[2] = ((-10 - svgTrans.getShiftY()) / > > svgTrans.getScaleY()); > > values[3] = ((svgCanvas.getHeight() - > > svgTrans.getShiftY()) / > > svgTrans.getScaleY()); > > } > > } // END class OnResizeAction > > > > private class OnScrollAction implements EventListener > > { > > /** > > * DOCUMENT ME! > > * > > * @param evt DOCUMENT ME! > > */ > > public void handleEvent(Event evt) > > { > > if(log.isDebugEnabled()) > > { > > log.debug("OnScrollAction"); > > } > > > > svgTrans.update(); > > > > double[] values = new double[4]; > > values[0] = ((-10 - svgTrans.getShiftX()) / > > svgTrans.getScaleX()); > > values[1] = ((svgCanvas.getWidth() - > > svgTrans.getShiftX()) / > > svgTrans.getScaleX()); > > values[2] = ((-10 - svgTrans.getShiftY()) / > > svgTrans.getScaleY()); > > values[3] = ((svgCanvas.getHeight() - > > svgTrans.getShiftY()) / > > svgTrans.getScaleY()); > > } > > } > > > > These actions are included in my JSVGCanvas (extends from batik > > JSVGCanvas): > > > > /** > > * A swing action to Pan/scroll the canvas. > > */ > > public class ScrollAction extends AffineAction > > { > > /** > > * Creates a new ScrollAction object. > > * > > * @param tx DOCUMENT ME! > > * @param ty DOCUMENT ME! > > */ > > public ScrollAction(double tx, double ty) > > { > > super(AffineTransform.getTranslateInstance(tx, > > ty)); > > } > > } > > > > /** > > * A swing action to scroll the canvas down, > > * by a fixed amount > > */ > > public class ScrollDownAction extends ScrollAction > > { > > /** > > * Creates a new ScrollDownAction object. > > * > > * @param inc DOCUMENT ME! > > */ > > public ScrollDownAction(int inc) > > { > > super(0, -inc); > > } > > } > > > > /** > > * A swing action to scroll the canvas to the left, > > * by a fixed amount > > */ > > public class ScrollLeftAction extends ScrollAction > > { > > /** > > * Creates a new ScrollLeftAction object. > > * > > * @param inc DOCUMENT ME! > > */ > > public ScrollLeftAction(int inc) > > { > > super(inc, 0); > > } > > } > > > > /** > > * A swing action to scroll the canvas to the right, > > * by a fixed amount > > */ > > public class ScrollRightAction extends ScrollAction > > { > > /** > > * Creates a new ScrollRightAction object. > > * > > * @param inc DOCUMENT ME! > > */ > > public ScrollRightAction(int inc) > > { > > super(-inc, 0); > > } > > } > > > > /** > > * A swing action to scroll the canvas up, > > * by a fixed amount > > */ > > public class ScrollUpAction extends ScrollAction > > { > > /** > > * Creates a new ScrollUpAction object. > > * > > * @param inc DOCUMENT ME! > > */ > > public ScrollUpAction(int inc) > > { > > super(0, inc); > > } > > } > > > > /** > > * A swing action to apply a zoom factor to the canvas. > > * This can be used to zoom in (scale > 1) and out (scale <1). > > */ > > public class ZoomAction extends AffineAction > > { > > /** > > * Creates a new ZoomAction object. > > * > > * @param scale DOCUMENT ME! > > */ > > public ZoomAction(double scale) > > { > > super(AffineTransform.getScaleInstance(scale, > > scale)); > > } > > > > /** > > * Creates a new ZoomAction object. > > * > > * @param scaleX DOCUMENT ME! > > * @param scaleY DOCUMENT ME! > > */ > > public ZoomAction(double scaleX, double scaleY) > > { > > super(AffineTransform.getScaleInstance(scaleX, > > scaleY)); > > } > > } > > > > /** > > * A swing action to zoom in the canvas. > > */ > > public class ZoomInAction extends ZoomAction > > { > > /** > > * Creates a new ZoomInAction object. > > */ > > ZoomInAction() > > { > > super(2); > > } > > } > > > > /** > > * A swing action to zoom out the canvas. > > */ > > public class ZoomOutAction extends ZoomAction > > { > > /** > > * Creates a new ZoomOutAction object. > > */ > > ZoomOutAction() > > { > > super(.5); > > } > > } > > > > public class AffineAction extends AbstractAction > > { > > /** DOCUMENT ME! */ > > AffineTransform at; > > > > /** > > * Creates a new AffineAction object. > > * > > * @param at DOCUMENT ME! > > */ > > public AffineAction(AffineTransform at) > > { > > this.at = at; > > } > > > > /** > > * DOCUMENT ME! > > * > > * @param evt DOCUMENT ME! > > */ > > public void actionPerformed(ActionEvent evt) > > { > > if(gvtRoot == null) > > { > > return; > > } > > > > AffineTransform rat = getRenderingTransform(); > > > > if(at != null) > > { > > Dimension dim = getSize(); > > int x = dim.width / 2; > > int y = dim.height / 2; > > AffineTransform t = > > AffineTransform.getTranslateInstance(x, y); > > t.concatenate(at); > > t.translate(-x, -y); > > t.concatenate(rat); > > setRenderingTransform(t); > > } > > > > svgTrans.update(); > > } > > } > > > > > > And here is SVGTransformation class: > > > > see attachment > > > > > > > > The problem I had with batik version 1.5, 1.6 and have it with version > > 1.7and it's only happening on Linux (every distri I tested, Mandriva 2007 > > & 2008, SuSE 10, Redhat Enterprise Linux 9) on Windows everything works > > great. > > > > > > Maybe someone can help me? > > > > > > Regards > > Fabian > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] -- Fabian Unfried Software Engineer proveo GmbH Rossfelder Str. 65/5 | 74564 Crailsheim | Germany Phone: +49 7951 963610 | Fax: +49 7951 963650 mailto:[EMAIL PROTECTED] | http://www.proveo.de Management Board: Steffen Knödler | Harald Knödler | Holger Gerwin Registered Office: Ulm, HRB 721672 Disclaimer: This message is intended only for the use of the individual or entity to which it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If the reader of this message is not the intended recipient, or the employee or agent responsible for delivering the message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please delete it and notify the sender immediately. Thank you. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
