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: 4762039
Votes 1
Synopsis EXCEPTION_ACCESS_VIOLATION in Fontmanager.dll
Category java:classes_2d
Reported Against 1.4
Release Fixed 1.4.2(mantis-b17)
State 10-Fix Delivered, bug
Priority: 4-Low
Related Bugs 4482430
Submit Date 11-OCT-2002
Description




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

FULL OPERATING SYSTEM VERSION :
Microsoft Windows 2000 [Version 5.00.2195]

ADDITIONAL OPERATING SYSTEMS :
This bug occurs on all Windows versions

A DESCRIPTION OF THE PROBLEM :
sun.awt.font.NativeFontWrapper.registerFonts occasionally
traps on an illegal memory read. This occurs because the
information in the table headers in the font files -
specifically table sizes - are not checked for consistency.


STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1.Compile and run test program below, with one of the
following font files installed:

ameb____.TTF
bdbi____.TTF
bdb_____.TTF
bdri____.TTF
bd______.TTF
bl______.TTF
cpb_____.TTF

2. Let the test program run until the access violation
exception occurs, or use a debugger to verify that an
illegal memory access is in fact made in InitializeCMAPin
cmaps.cpp every time.



ERROR MESSAGES/STACK TRACES THAT OCCUR :
An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : EXCEPTION_ACCESS_VIOLATION occurred at PC=0x6D1B3B4C
Function=[Unknown.]
Library=D:\j2sdk1.4.0\jre\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.registerFonts(Native Method)
	- locked <06AF6468> (a java.lang.Class)
	at FontTester.addPathFonts(FontTester.java:32)
	at FontTester.main(FontTester.java:41)

Dynamic libraries:
0x00400000 - 0x00406000 	D:\j2sdk1.4.0\bin\java.exe
0x77F80000 - 0x77FFB000 	D:\WINNT\System32\ntdll.dll
0x77DB0000 - 0x77E0D000 	D:\WINNT\system32\ADVAPI32.dll
0x77E80000 - 0x77F36000 	D:\WINNT\system32\KERNEL32.DLL
0x77D30000 - 0x77DA1000 	D:\WINNT\system32\RPCRT4.DLL
0x78000000 - 0x78046000 	D:\WINNT\system32\MSVCRT.dll
0x6D330000 - 0x6D442000 	D:\j2sdk1.4.0\jre\bin\client\jvm.dll
0x77E10000 - 0x77E75000 	D:\WINNT\system32\USER32.dll
0x77F40000 - 0x77F7C000 	D:\WINNT\system32\GDI32.DLL
0x77570000 - 0x775A0000 	D:\WINNT\System32\WINMM.dll
0x6D1D0000 - 0x6D1D7000 	D:\j2sdk1.4.0\jre\bin\hpi.dll
0x6D300000 - 0x6D30D000 	D:\j2sdk1.4.0\jre\bin\verify.dll
0x6D210000 - 0x6D228000 	D:\j2sdk1.4.0\jre\bin\java.dll
0x6D320000 - 0x6D32D000 	D:\j2sdk1.4.0\jre\bin\zip.dll
0x6D000000 - 0x6D0F6000 	D:\j2sdk1.4.0\jre\bin\awt.dll
0x77800000 - 0x7781E000 	D:\WINNT\System32\WINSPOOL.DRV
0x76620000 - 0x76630000 	D:\WINNT\system32\MPR.DLL
0x75E60000 - 0x75E7A000 	D:\WINNT\System32\IMM32.dll
0x77A50000 - 0x77B45000 	D:\WINNT\system32\ole32.dll
0x6D180000 - 0x6D1D0000 	D:\j2sdk1.4.0\jre\bin\fontmanager.dll
0x77920000 - 0x77943000 	D:\WINNT\system32\imagehlp.dll
0x72A00000 - 0x72A2D000 	D:\WINNT\system32\DBGHELP.dll
0x690A0000 - 0x690AB000 	D:\WINNT\System32\PSAPI.DLL

Local Time = Sat Sep 28 00:19:49 2002
Elapsed Time = 4
#
# The exception above was detected in native code outside the VM
#
# Java VM: Java HotSpot(TM) Client VM (1.4.0-b92 mixed mode)
#


REPRODUCIBILITY :
This bug can be reproduced occasionally.

---------- BEGIN SOURCE ----------

import java.io.*;
import java.util.*;
import sun.awt.font.*;

public class FontTester {
 static Vector vector2 = new Vector();
 static {
   vector2.add(new Vector());
 }

 static void addPathFonts(String s, FilenameFilter
   filenamefilter, int i) {
   File file = new File(s);
   String as[] = file.list(filenamefilter);
   if (as == null) {
     return;
   }
   for (int j = 0; j < as.length; j++) {
     File file1 = new File(file, as[j]);
     String s1 = null;
         try {
           s1 = file1.getCanonicalPath();
       }
         catch(IOException ex) {
           s1 = file1.getAbsolutePath();
       }

         Vector vector = new Vector(1);
     vector.addElement(s1);
     System.out.println("Registering (" + i + ") " + s1);
     NativeFontWrapper.registerFonts(vector, 1, vector2, i, false);
   }
 }

 public static void main(String[] args) {
   String directory = "d:/temp/fonts";
   for (int i = 0; i < 10000; i++) {
     System.out.println("Test Number: " + i);
     addPathFonts(directory,
       new FilenameFilter() {
       public boolean accept(File file, String s) {
         return s.endsWith(".ttf") || s.endsWith(".TTF") || s.endsWith(".ttc")
|| s.endsWith(".TTC");
       }
     }, 0);
     addPathFonts(directory,
       new FilenameFilter() {
       public boolean accept(File file, String s) {
         return s.endsWith(".ps") || s.endsWith(".PS") || s.endsWith(".pfb") ||
s.endsWith(".PFB") || s.endsWith(".pfa") || s.endsWith(".PFA");
       }
     }, 1);
     addPathFonts(directory,
       new FilenameFilter() {
       public boolean accept(File file, String s) {
         return s.endsWith(".t2k") || s.endsWith(".T2K");
       }
     }, 2);
   }
   System.out.println("Done...");
 }
}
---------- END SOURCE ----------

CUSTOMER WORKAROUND :
Uninstall corrupt font files
(Review ID: 165494) 
======================================================================
Attached font files   
 xxxxx@xxxxx  2002-10-16
Work Around
N/A
Evaluation
Font files needed.  Marking as incomplete.

 xxxxx@xxxxx  2002-10-28




  Fonts causing crash have same problem with CMAP table - 
length of last subtable seems to be random and may exceed table size.  
In fact subtable itself seems to be ok and its end coincidence with table   
end but length in the table header is not valid. 
  BTW, all known fonts with such problem are from same source 
(@ 1991 Digital Typeface Corp). 
  Proposed solution is check for this problem and ignore problematic fonts.


======================================================================
Comments
  
  Include a link with my name & email   

Submitted On 23-OCT-2002
casithereal
I have this error with java version: 1.4.1 on a windows xp
Machine. Application is running under Webstart.

When i try to use the desktop-shortcut the exception
occures. But only every 2.nd try fails.

The App. launches and runs via Webstart-Startmanager very
propery.


Submitted On 13-NOV-2002
zeth_russ
I have reproduced this bug running java1.4.1. I don't use
any font specific calls, a step-by-step analysis crashed on
a call to DragSource.getDefaultDragSource. This bug happens
almost ALWAYS after one successfull run.


Submitted On 19-NOV-2002
mctaylor
I can also reproduce this under 1.4.1_01 and WinNT4sp6.

It happens randomly. Very difficult to tell which fonts are
causing it. (I have many installed...). I deleted the fonts
specifically named above, but there must be others that have
this problem. This is really nasty...


Submitted On 03-DEC-2002
yoonkhsc
I am Korean java user, and so many times i've got this error.
In Korea, most popular font is 'Gulim' font. (like Arial in 
America) but it creshed! 

MyFont = new Font("Gulim", Font.PLAIN, 9);

In JDK 1.3.1_02, it works fine.
In JDK 1.3.1._06 and JDK 1.4 beta and JDK 1.4.1_02, 
it must be cresh and virtual machine down.

and make file that 'HS_ERR~~'..

How solve it?


Submitted On 09-DEC-2002
BerndMoos
I get this bug on a Windows ME machine, almost always. It makes the 
application I have developped useless to many of my users - so I'd 
aprreciate it if this was high priority!


Submitted On 10-DEC-2002
t34
another workaround:
put all fonts the jre need into jre/lib/fonts (look into 
fonts.properties for font names)
set JAVA_FONTS=jre/lib/fonts


Submitted On 12-DEC-2002
Razul
On my PC (Windows 2000 Pro, Java 1.4.0) this error occurs 
on every action that involves showing a file dialog in Sun ONE 
Studio CE (Forte 4.0).
It also occurs in a lot of applets around the web, causing 
Internet Explorer to shut down immediately.


Submitted On 12-DEC-2002
springdrops
I know this is a report for only 1.4.0 version, but I couldn't 
find any bug report on version 1.3.1, so I just want to let you 
all know that this problem is also persists in earlier version.


Submitted On 23-DEC-2002
Meleck
It looks a lot like bug #4486066. You should check privileges for fonts on your system. Does this problem occur if you're not part of a domain network.


Submitted On 23-DEC-2002
Meleck
Sorry. Text was cut off.

Does this bug occur when you aren't part of a
domain network? 



Submitted On 06-JAN-2003
Matt.T
I have this error occasionally with java 1.4.1_01 on win98SE.
Putting my program in a jar-file this error occurs every time.


Submitted On 14-JAN-2003
pieries
t34's solution (dated Dec 10 2002) worked fine for me


Submitted On 05-FEB-2003
adfunk
I had this error constantly on Win ME under java 1.4 and 
1.4.1.  t34's workaround worked, but the real fix for me was 
to eliminate corrupt font files in \Windows\Fonts.  I needed to 
get a 3rd party program to identify the files.

That being said, the ACCESS_VIOLATION exception seems 
inappropriate for a corrupt font database. 


Submitted On 01-MAR-2003
japastor
By what logic has this bug been tagged as CLOSED, FIXED?!!

It most certainly has not been fixed as of 1.4.1 -- it happens 
like clockwork when certain fonts are installed (e.g., after a 
reinstall of MS Office).

Please un-mark this as fixed and FIX IT!


Submitted On 03-MAR-2003
neigor
Fix was integrated into forthcoming 1.4.2. 


Submitted On 16-MAR-2003
babul_reddy
I have this error with java version 1.4.0.


Submitted On 19-MAR-2003
stantonea
I have 1.4.1_02 installed and this issue is still occurring. It is 
NOT FIXED. BTW adfunk, what 3rd party font checking utility 
did you use to identify corrupt font files?


Submitted On 23-MAR-2003
jayasimha.ks
I am also facing the same problem. I am using j2sdk 1.4.1_01 
on a winnt machine.


Submitted On 16-MAY-2003
juv3nal
i can confirm that 1.4.1_02 dies not fix the problem.
the workaround works.


Submitted On 20-MAY-2003
hauga
We get less, but still crashes in version 1.4.1_02.


Submitted On 27-JUN-2003
merrick_stemen
t34's solution (dated Dec 10 2002) worked fine for me, too.


Submitted On 04-AUG-2003
dashman@aol.com
Could someone describe in detail how to make the change t34 
suggests to a non-savvy java person.  I am unable to located 
fonts.properties nor do I know how to do the JAVA_FONTS 
thing.  Please e-mail me at dasher@aol.com.

Thank you in advance.


Submitted On 06-AUG-2003
neigor
Try to upgrade to JDK1.4.2 - hopefully your problem will
gone.
(http://java.sun.com/j2se/1.4.2/download.html)


Submitted On 27-AUG-2003
andrewbranch
This bug, or something very similar, is still occuring in JDK 
1.4.2 but what really irks me, is that it appears that they 
have removed the JAVA_FONTS workaround!!! 

It appears to mostly be happeing with Chinese and Japanese 
Fonts.  Here is the exception....

An unexpected exception has been detected in native code 
outside the VM.
Unexpected Signal : EXCEPTION_ACCESS_VIOLATION 
(0xc0000005) occurred at PC=0x78020A3C
Function=setjmp3+0x4
Library=C:\WINNT\system32\MSVCRT.dll

Current Java thread:
	at sun.awt.font.NativeFontWrapper.getFontMetrics
(Native Method)
	- locked <0x302a3008> (a java.lang.Class)
	at 
sun.awt.font.FontDesignMetrics.initMatrixAndMetrics
(FontDesignMetrics.java:175)
	at sun.awt.font.FontDesignMetrics.<init>
(FontDesignMetrics.java:160)
	at sun.awt.font.FontDesignMetrics.<init>
(FontDesignMetrics.java:145)
	at sun.awt.SunToolkit.getFontMetrics
(SunToolkit.java:402)
	at sun.awt.windows.WToolkit.getFontMetrics
(WToolkit.java:573)
	at 
javax.swing.plaf.basic.BasicLabelUI.getPreferredSize
(BasicLabelUI.java:206)
	at javax.swing.JComponent.getPreferredSize
(JComponent.java:1275)
	at 
javax.swing.plaf.basic.BasicListUI.updateLayoutState
(BasicListUI.java:1150)
	at 
javax.swing.plaf.basic.BasicListUI.maybeUpdateLayoutState
(BasicListUI.java:1098)
	at 
javax.swing.plaf.basic.BasicListUI$ListSelectionHandler.valueC
hanged(BasicListUI.java:1466)
	at 
javax.swing.DefaultListSelectionModel.fireValueChanged
(DefaultListSelectionModel.java:187)
	at 
javax.swing.DefaultListSelectionModel.fireValueChanged
(DefaultListSelectionModel.java:167)
	at 
javax.swing.DefaultListSelectionModel.fireValueChanged
(DefaultListSelectionModel.java:214)
	at 
javax.swing.DefaultListSelectionModel.changeSelection
(DefaultListSelectionModel.java:402)
	at 
javax.swing.DefaultListSelectionModel.changeSelection
(DefaultListSelectionModel.java:411)
	at 
javax.swing.DefaultListSelectionModel.setSelectionInterval
(DefaultListSelectionModel.java:435)
	at javax.swing.JList.setSelectedIndex
(JList.java:1733)
	at 
javax.swing.plaf.basic.BasicComboPopup.setListSelection
(BasicComboPopup.java:998)
	at 
javax.swing.plaf.basic.BasicComboPopup.access$000
(BasicComboPopup.java:43)
	at 
javax.swing.plaf.basic.BasicComboPopup$ItemHandler.itemStat
eChanged(BasicComboPopup.java:782)
	at javax.swing.JComboBox.fireItemStateChanged
(JComboBox.java:1162)
	at javax.swing.JComboBox.selectedItemChanged
(JComboBox.java:1219)
	at javax.swing.JComboBox.contentsChanged
(JComboBox.java:1266)
	at 
javax.swing.AbstractListModel.fireContentsChanged
(AbstractListModel.java:100)
	at 
javax.swing.DefaultComboBoxModel.setSelectedItem
(DefaultComboBoxModel.java:88)
	at javax.swing.JComboBox.setSelectedItem
(JComboBox.java:551)
	at javax.swing.JComboBox.setSelectedIndex
(JComboBox.java:597)


Submitted On 29-AUG-2003
iznogoud_23
i confirm : the bug is still present in JDK 1.4.2

Please, remove the FIXED tag! it's not true!
In my workstation, ALL java programs (App. and applet) 
crashes with this error...


Submitted On 31-AUG-2003
philr
 " EXCEPTION_ACCESS_VIOLATION in Fontmanager.dll" : 
This message is a symptom,not a single cause, so if you
see still see the same message in 1.4.2 it means you see a
different bug which provokes the same message.
Recall that C programs say SEGV (unix) or 
EXCEPTION_ACCESS_VIOLATION (windoze)
for all manner of causes. Fixing a specific SEGV bug does not
mean there's no other way for that to happen.

1.4.2 fixes many issues, apparently not all,
just saying "its not fixed" will make it fixed nowor ever. You
need to help identify the data (the font on your system) that
caused it and submit a new bug.


Submitted On 11-SEP-2003
rsimms
I had this problem intermittently on Windows 2000 with Jdks 
1.4 through 1.4.2.01. The problem did not occur with 
1.3.1.01. I eventually traced the problem to a 
damaged/corrupt font in c:\WINNT\Fonts.  I copied all the 
fonts in that directory to a temporary location, then deleted 
all the fonts in c:\WINNT\Fonts. I then copied all the fonts 
from the temporary location back into c:\WINNT\Fonts. This 
reinstalls the fonts and detects any corrupt/damaged fonts. I 
have not seen this error since reinstalling the fonts.


Submitted On 26-SEP-2003
Hedgehog39
Yeah, I'm getting the same problem (as, it seems, are a lot of 
people trying to run an app on win xp pro). I get pretty much 
the same error (see below) whenever I try to open up a file 
dialog box. I tried the JAVA_FONTS workaround but it didn't 
work. Any ideas as to what causing this? It seems to work on 
xp home, win 2000, and winNT.


An unexpected exception has been detected in native code 
outside the VM.
Unexpected Signal : EXCEPTION_ACCESS_VIOLATION 
occurred at PC=0x6D1C1E4C
Function=Java_sun_awt_font_GlyphList_discardData+0x651C
Library=C:\Program Files\Java\j2re1.4.1_02
\bin\fontmanager.dll

Current Java thread:
	at sun.awt.font.NativeFontWrapper.registerFonts
(Native Method)


Submitted On 29-SEP-2003
Hedgehog39
did as you suggested and it produced a lot of output. The 
RegisterFonts mehtod comes up with "No native Name" for all 
of them. I tried removing the last font mentioned before the 
error several times, but to no avail.

The output is long and there seems to be a problem with 
posting it, so I can sent it to you if you want to examine it 
and see where I bolloxed up.


Submitted On 29-SEP-2003
neigor
If you expirience crash of 1.4.x due to broken font then
please try to reproduce it from command line passing
-Dsun.java2d.debugfonts=true to jvm. 

This will print debug information about font being used. 
Font causing problems is typically one mentioned last.
Try to remove it (or move to other) location. 

Please also report here name of broken font and (if you
know) its origin.
If you can then please make it accessible somethere on the
web to give developers chance to reproduce your problem and
fix it.


Submitted On 25-OCT-2003
Dan_Simon
Hedgehog39:  You're close, but you're not removing the right 
file.

The last font listed in the output is the last font to be 
successfully read in.  Rather than removing that font, remove 
the <i>next</i> one (alphabetically).  That will allow the 
system to move on.....there may be more than one font that 
is bad, so you may have to repeat the process multiple times, 
but you should see the font list continue to grow as the 
system makes it through more and more of the fonts.


Submitted On 15-JAN-2004
stuuf133t
fontmanager.dll crashes whenever it opens a bad font file.
so, just get rid of all your corrupt files.
do something to get windows to display $(SYSTEMROOT)\Fonts
as a normal directory. You can rename/kill/modify
desktop.ini or use subst to make a virtual drive.
scroll through and delete any files without an icon.
that might work.


Submitted On 19-SEP-2004
SlayerBBBB@@
Custom workaround!!!

Create a file named badfonts.txt in JRE_HOME/lib/fonts.

It includes the Windows all of Fonts lists.
the format like following
C:\WINDOWS\Fonts\ARIALNBI.TTF
....
....

But I cannot confirm it would supported futher JRE.

I tested it Windows 2000, Windows XP 
JRE 1.4.2_04 JRE 1.4.2_05 plug-in with Internet Explorer.





Submitted On 26-SEP-2004
PoisonMushroom
I don't know how to apply -Dsun.java2d.debugfonts=true to jvm.  I'm new to Java, and I'm only trying to run Java applications, but this problem is keeping me from doing anything with it.  Can anyone help me?


Submitted On 28-SEP-2004
neigor
When you start your java application from command line just add -Dsun.java2d.debugfonts=true to command line, e.g. 
instead of 
  java -cp . Test
use 
  java -Dsun.java2d.debugfonts=true -cp . Test

Alternatively you may want  to try recent version of jdk 5.9 - 
it is much more robust and likely to not  fail because of broken fonts on your system.


Submitted On 25-MAR-2005
show_me_whats_the_big_deal
I encountered this problem while launching weblogic builder using jdk1.4.1_05. Using debugfonts=true option worked fine for me.


Submitted On 29-MAR-2005
respig
#
# An unexpected error has been detected by HotSpot Virtual Machine:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x2d222022, pid=1764, tid=4020
#
# Java VM: Java HotSpot(TM) Client VM (1.5.0_02-b09 mixed mode, sharing)
# Problematic frame:
# C  0x2d222022
#

---------------  T H R E A D  ---------------

Current thread (0x00a6e320):  JavaThread "AWT-Windows" daemon [_thread_in_native, id=4020]

siginfo: ExceptionCode=0xc0000005, reading address 0x2d222022

Registers:
EAX=0x00000000, EBX=0x02d5efc4, ECX=0x00542fe0, EDX=0x682e7870
ESP=0x02d5ef78, EBP=0x02d5ef98, ESI=0x00050003, EDI=0x00000003
EIP=0x2d222022, EFLAGS=0x00010202

Top of Stack: (sp=0x02d5ef78)
0x02d5ef78:   615c3a63 69757172 20736f76 70206564
0x02d5ef88:   72676f72 73616d61 76616a5c 726a5c61
0x02d5ef98:   352e3165 305f302e 69625c32 2d20226e
0x02d5efa8:   6c6e6a64 732e7870 73616c70 726f7068
0x02d5efb8:   32313d74 22203237 6e6a642d 2e78706c
0x02d5efc8:   3d6d766a 3a63225c 7172615c 6f766975
0x02d5efd8:   65642073 6f727020 6d617267 6a5c7361
0x02d5efe8:   5c617661 3165726a 302e352e 5c32305f 

Instructions: (pc=0x2d222022)
0x2d222012:   
[error occurred during error reporting, step 100, id 0xc0000005]


Submitted On 24-JUL-2006
HelloKitty
t34's solution (dated Dec 10 2002) worked fine for me, three.



PLEASE NOTE: JDK6 is formerly known as Project Mustang