JDK-4994629 : CMAP 2 truetype fonts cause crash
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 1.4.2,5.0
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_2000,windows_xp
  • CPU: x86
  • Submitted: 2004-02-13
  • Updated: 2005-10-10
  • Resolved: 2005-10-10
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availabitlity Release.

To download the current JDK release, click here.
Other JDK 6
5.0u8Resolved 6 b56Fixed
Related Reports
Duplicate :  
Description
Name: pr15447			Date: 02/13/2004


FULL PRODUCT VERSION :
java version "1.4.2_03"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_03-b02)
Java HotSpot(TM) Client VM (build 1.4.2_03-b02, mixed mode)

ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows 2000 [Version 5.00.2195]

A DESCRIPTION OF THE PROBLEM :
I was trying to create PDF files including Japanese string with FOP.
But when I wroted Japanese in SVG, the Java VM was crashed.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1)Compile 'fop-0.20.5/examples/embedding'.
2)Rewrite 'fop-0.20.5/examples/embedding/xml/fo/helloworld.fo'.

<?xml version="1.0" encoding="utf-8"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
  <fo:layout-master-set>
    <fo:simple-page-master master-name="simple">
      <fo:region-body margin-top="3cm"/>
      <fo:region-before extent="3cm"/>
      <fo:region-after extent="1.5cm"/>
    </fo:simple-page-master>
  </fo:layout-master-set>
  <fo:page-sequence master-reference="simple">
    <fo:flow flow-name="xsl-region-body">
      <fo:block>
<fo:instream-foreign-object xmlns:svg="http://www.w3.org/2000/svg">
<svg:svg width="5cm" height="5cm" viewBox="0 0 200 200">
  <svg:g style="fill:red; stroke:#000000">
     <svg:rect x="0" y="0" width="200" height="200"/>
     <svg:text x="80" y="120" font-size="40" fill="blue">&#12354;</svg:text>
  </svg:g>
</svg:svg>
</fo:instream-foreign-object>
        </fo:block>
    </fo:flow>
  </fo:page-sequence>
</fo:root>

3)Execute embedding.ExampleFO2PDF


ERROR MESSAGES/STACK TRACES THAT OCCUR :
An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x1AE36BB6
Function=[Unknown.]
Library=C:\Program Files\Java\j2re1.4.2_03\bin\fontmanager.dll

NOTE: We are unable to locate the function name symbol for the error
      just occurred. Please refer to release documentation for possible
      reason and solutions.


Current Java thread:
	at sun.awt.font.NativeFontWrapper.canDisplay(Native Method)
	- locked <0x16a2f478> (a java.lang.Class)
	at java.awt.Font.canDisplay(Unknown Source)
	at java.awt.Font.canDisplayUpTo(Unknown Source)
	at org.apache.batik.gvt.font.AWTGVTFont.canDisplayUpTo(AWTGVTFont.java:129)
	at org.apache.batik.gvt.renderer.StrokingTextPainter.createModifiedACIForFontMatching(StrokingTextPainter.java:484)
	at org.apache.batik.gvt.renderer.StrokingTextPainter.getTextRuns(StrokingTextPainter.java:196)
	at org.apache.batik.gvt.renderer.StrokingTextPainter.getBounds2D(StrokingTextPainter.java:1095)
	at org.apache.batik.gvt.TextNode.getPrimitiveBounds(TextNode.java:214)
	at org.apache.batik.gvt.AbstractGraphicsNode.getTransformedPrimitiveBounds(AbstractGraphicsNode.java:817)
	at org.apache.batik.gvt.AbstractGraphicsNode.getTransformedBounds(AbstractGraphicsNode.java:783)
	at org.apache.batik.gvt.CompositeGraphicsNode.getTransformedPrimitiveBounds(CompositeGraphicsNode.java:211)
	at org.apache.batik.gvt.AbstractGraphicsNode.getTransformedBounds(AbstractGraphicsNode.java:783)
	at org.apache.batik.gvt.CompositeGraphicsNode.getTransformedPrimitiveBounds(CompositeGraphicsNode.java:206)
	at org.apache.batik.gvt.AbstractGraphicsNode.getTransformedBounds(AbstractGraphicsNode.java:783)
	at org.apache.batik.gvt.CompositeGraphicsNode.getPrimitiveBounds(CompositeGraphicsNode.java:163)
	at org.apache.batik.gvt.AbstractGraphicsNode.getBounds(AbstractGraphicsNode.java:731)
	at org.apache.batik.gvt.AbstractGraphicsNode.paint(AbstractGraphicsNode.java:456)
	at org.apache.fop.render.pdf.PDFRenderer.renderSVGDocument(PDFRenderer.java:647)
	at org.apache.fop.render.pdf.PDFRenderer.renderSVGArea(PDFRenderer.java:549)
	at org.apache.fop.svg.SVGArea.render(SVGArea.java:98)
	at org.apache.fop.render.pdf.PDFRenderer.renderForeignObjectArea(PDFRenderer.java:533)
	at org.apache.fop.layout.inline.ForeignObjectArea.render(ForeignObjectArea.java:89)
	at org.apache.fop.render.AbstractRenderer.renderLineArea(AbstractRenderer.java:516)
	at org.apache.fop.layout.LineArea.render(LineArea.java:519)
	at org.apache.fop.render.AbstractRenderer.renderBlockArea(AbstractRenderer.java:485)
	at org.apache.fop.layout.BlockArea.render(BlockArea.java:117)
	at org.apache.fop.render.AbstractRenderer.renderAreaContainer(AbstractRenderer.java:451)
	at org.apache.fop.layout.ColumnArea.render(ColumnArea.java:71)
	at org.apache.fop.render.AbstractRenderer.renderSpanArea(AbstractRenderer.java:100)
	at org.apache.fop.layout.SpanArea.render(SpanArea.java:94)
	at org.apache.fop.render.AbstractRenderer.renderBodyAreaContainer(AbstractRenderer.java:368)
	at org.apache.fop.layout.BodyAreaContainer.render(BodyAreaContainer.java:137)
	at org.apache.fop.render.AbstractRenderer.renderRegions(AbstractRenderer.java:529)
	at org.apache.fop.render.pdf.PDFRenderer.renderPage(PDFRenderer.java:904)
	at org.apache.fop.render.pdf.PDFRenderer.render(PDFRenderer.java:880)
	at org.apache.fop.apps.StreamRenderer.queuePage(StreamRenderer.java:302)
	- locked <0x10820690> (a org.apache.fop.apps.StreamRenderer)
	at org.apache.fop.layout.AreaTree.addPage(AreaTree.java:108)
	at org.apache.fop.fo.pagination.PageSequence.makePage(PageSequence.java:415)
	at org.apache.fop.fo.pagination.PageSequence.format(PageSequence.java:338)
	at org.apache.fop.apps.StreamRenderer.render(StreamRenderer.java:262)
	at org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:223)
	at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
	at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
	at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
	at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
	at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
	at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
	at org.apache.fop.apps.Driver.render(Driver.java:498)
	- locked <0x107ffff8> (a org.apache.fop.apps.Driver)
	at org.apache.fop.apps.CommandLineStarter.run(CommandLineStarter.java:106)
	at org.apache.fop.apps.Fop.main(Fop.java:62)

Dynamic libraries:
0x00400000 - 0x00407000 	C:\Program Files\Java\j2re1.4.2_03\bin\javaw.exe
0x77F80000 - 0x77FFB000 	C:\WINNT\system32\ntdll.dll
0x79480000 - 0x794E2000 	C:\WINNT\system32\ADVAPI32.dll
0x77E50000 - 0x77F32000 	C:\WINNT\system32\KERNEL32.DLL
0x78780000 - 0x787EE000 	C:\WINNT\system32\RPCRT4.DLL
0x77DE0000 - 0x77E3F000 	C:\WINNT\system32\USER32.dll
0x77F40000 - 0x77F79000 	C:\WINNT\system32\GDI32.dll
0x78000000 - 0x78045000 	C:\WINNT\system32\MSVCRT.dll
0x75DF0000 - 0x75E0A000 	C:\WINNT\system32\IMM32.DLL
0x08000000 - 0x08138000 	C:\Program Files\Java\j2re1.4.2_03\bin\client\jvm.dll
0x77520000 - 0x77550000 	C:\WINNT\system32\WINMM.dll
0x10000000 - 0x10007000 	C:\Program Files\Java\j2re1.4.2_03\bin\hpi.dll
0x007E0000 - 0x007EE000 	C:\Program Files\Java\j2re1.4.2_03\bin\verify.dll
0x007F0000 - 0x00809000 	C:\Program Files\Java\j2re1.4.2_03\bin\java.dll
0x00810000 - 0x0081D000 	C:\Program Files\Java\j2re1.4.2_03\bin\zip.dll
0x1ACB0000 - 0x1ADBF000 	C:\Program Files\Java\j2re1.4.2_03\bin\awt.dll
0x777B0000 - 0x777CE000 	C:\WINNT\system32\WINSPOOL.DRV
0x798F0000 - 0x79901000 	C:\WINNT\system32\MPR.DLL
0x77A20000 - 0x77B0C000 	C:\WINNT\system32\ole32.dll
0x1AE00000 - 0x1AE50000 	C:\Program Files\Java\j2re1.4.2_03\bin\fontmanager.dll
0x1AE90000 - 0x1AEB2000 	C:\Program Files\Java\j2re1.4.2_03\bin\dcpr.dll
0x778F0000 - 0x77913000 	C:\WINNT\system32\imagehlp.dll
0x726C0000 - 0x726ED000 	C:\WINNT\system32\DBGHELP.dll
0x674B0000 - 0x674BB000 	C:\WINNT\system32\PSAPI.DLL

Heap at VM Abort:
Heap
 def new generation   total 576K, used 376K [0x10010000, 0x100b0000, 0x107c0000)
  eden space 512K,  60% used [0x10010000, 0x1005e038, 0x10090000)
  from space 64K, 100% used [0x100a0000, 0x100b0000, 0x100b0000)
  to   space 64K,   0% used [0x10090000, 0x10090000, 0x100a0000)
 tenured generation   total 2476K, used 1929K [0x107c0000, 0x10a2b000, 0x16410000)
   the space 2476K,  77% used [0x107c0000, 0x109a2568, 0x109a2600, 0x10a2b000)
 compacting perm gen  total 6912K, used 6865K [0x16410000, 0x16ad0000, 0x1a410000)
   the space 6912K,  99% used [0x16410000, 0x16ac47f0, 0x16ac4800, 0x16ad0000)

Local Time = Sun Feb 01 13:58:56 2004
Elapsed Time = 26
#
# The exception above was detected in native code outside the VM
#
# Java VM: Java HotSpot(TM) Client VM (1.4.2_03-b02 mixed mode)
#
# An error report file has been saved as hs_err_pid532.log.
# Please refer to the file for further information.
#


REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
See FOP examples, please.
---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
It works well on JRE1.3.1_10.
(Incident Review ID: 236694) 
======================================================================

Comments
EVALUATION We can just remove assertion for now. This will fix the crash and leave heuristics initialized with some reasonable values. Someday, we need to refactor it and remove CMAP parsing code from native layer. This is bug 6331346.
2005-09-30

EVALUATION This is because of a couple of bad fonts which crash 1.4.2, and 1.5, and likely 1.4 too .. ###@###.### 2004-02-13 ============================== Name: inR10103 Date: 02/20/2004 Font causing crash uses format 2 for CMAP and our native implementation has no support for this format. In fact we do have duplicated support for CMAPs on java and native levels. Later seems to be used by hinting engine only. There are two approaches to fix this problem - extend native level to support format 2 and try to use java implementation everythere. ======================================================================
2004-08-10