[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-2d-dev
Subject:    Re: [OpenJDK 2D-Dev] RFR: 8221741 ClassCastException happen when fontconfig.properties was used
From:       "Langer, Christoph" <christoph.langer () sap ! com>
Date:       2019-12-19 21:48:28
Message-ID: DB8PR02MB5547A0B57080BAA3E578C71D8A520 () DB8PR02MB5547 ! eurprd02 ! prod ! outlook ! com
[Download RAW message or body]

[Attachment #2 (text/plain)]

I still might not fully get it…

So, the call to AccessController.doPrivileged() with a PrivilegedExceptionAction \
might eventually yield a PrivilegedActionException which I catch and handle (as \
before the NPE). The only thing that differs now is that I don't handle NPE any more. \
I was thinking that the only possible source of NPE was when raf is null. That can't \
happen now any more because ‘new RandomAccessFile' either delivers an Object or \
throws. But maybe a more defensive approach would be to still handle NPE in case it \
occurs for whatever other reason?

So, generally, I'm running this patch fine through all our platform testing. I agree \
that it should be pushed to client-dev and not rushed into 14. Maybe that would give \
enough test coverage and time to bake?

/Christoph

From: Phil Race <philip.race@oracle.com>
Sent: Donnerstag, 19. Dezember 2019 21:59
To: Langer, Christoph <christoph.langer@sap.com>; Ichiroh Takiguchi \
                <takiguc@linux.vnet.ibm.com>
Cc: 2d-dev@openjdk.java.net
Subject: Re: [OpenJDK 2D-Dev] RFR: 8221741 ClassCastException happen when \
fontconfig.properties was used

Here you are seeing the exception during initialisation but if the font is in use
we might get an exception handed to native code when it has not had to deal
with that. We should check that code and if it is ready to deal with pending
exceptions. Other JNI calls in native will fail if it is not and the exception will
ultimately propagate back to the original Java code. It all needs to be looked \
through for problems.

-phil.
On 12/19/19 12:39 PM, Langer, Christoph wrote:
I don't understand what's intriguing you with that code, please help me…

It was done like this before, e.g. the RandomAccessFile was opened in the privileged \
block. But before you'd only see a null reference coming out in case something went \
wrong. Now you'd have the FileNotFoundException at hand to be able to trace this \
detail… Are you concerned that this information could be leaked out of the \
Privileged block when it shouldn't?

/Christoph

From: Phil Race <philip.race@oracle.com><mailto:philip.race@oracle.com>
Sent: Donnerstag, 19. Dezember 2019 21:04
To: Langer, Christoph <christoph.langer@sap.com><mailto:christoph.langer@sap.com>; \
                Ichiroh Takiguchi \
                <takiguc@linux.vnet.ibm.com><mailto:takiguc@linux.vnet.ibm.com>
Cc: 2d-dev@openjdk.java.net<mailto:2d-dev@openjdk.java.net>
Subject: Re: [OpenJDK 2D-Dev] RFR: 8221741 ClassCastException happen when \
fontconfig.properties was used

This makes me very nervous because it is up-called from native code.
I am not sure I would want this change in any release ...

317             try {

 318                 RandomAccessFile raf = AccessController.doPrivileged(

 319                     new PrivilegedExceptionAction<RandomAccessFile>() {

 320                         public RandomAccessFile run() throws \
FileNotFoundException {

 321                             return new RandomAccessFile(platName, "r");

-phil.

On 12/19/19 12:01 PM, Langer, Christoph wrote:

Hi Phil,



Type 1 fonts were available but got skipped.



/Christoph



-----Original Message-----

From: Phil Race <philip.race@oracle.com><mailto:philip.race@oracle.com>

Sent: Donnerstag, 19. Dezember 2019 20:58

To: Langer, Christoph <christoph.langer@sap.com><mailto:christoph.langer@sap.com>; \
Ichiroh Takiguchi

<takiguc@linux.vnet.ibm.com><mailto:takiguc@linux.vnet.ibm.com>

Cc: 2d-dev@openjdk.java.net<mailto:2d-dev@openjdk.java.net>

Subject: Re: [OpenJDK 2D-Dev] RFR: 8221741 ClassCastException happen

when fontconfig.properties was used



Hi,



If this can get reviewed, I intend to push this fix to JDK14.



Not for 14. This will take some time to review and test and is too risky at this

stage.



You say no TrueType fonts are installed, does that mean there are no

scaleable fonts at all,

or are there Type 1 fonts we are skipping over ?



-phil.







On 12/18/19 6:31 AM, Langer, Christoph wrote:

Hi,



sorry for the long time that it took me to come back to this item.



I eventually spent quite a significant amount of time analyzing what's going

wrong here. At least, I have a few AIX LPARs, where we would always

encounter this type of Exception:



Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException:

class sun.font.CompositeFont cannot be cast to class sun.font.PhysicalFont

(sun.font.CompositeFont and sun.font.PhysicalFont are in module

java.desktop of loader 'bootstrap')

         at

java.desktop/sun.font.SunFontManager.getDefaultPhysicalFont(SunFontMa

nager.java:1081)

         at

java.desktop/sun.font.SunFontManager.initialiseDeferredFont(SunFontMan

ager.java:960)

         at

java.desktop/sun.font.SunFontManager.findOtherDeferredFont(SunFontM

anager.java:898)

         at

java.desktop/sun.font.SunFontManager.findDeferredFont(SunFontManager

.java:914)

         at

java.desktop/sun.font.SunFontManager.findFont2D(SunFontManager.java:2

105)

         ...



The problem on our systems is triggered by two factors. First is that the

font configuration file contains paths to font files that don't exist. Secondly,

the system's fontconfig has no TrueType Fonts installed. Now, during loading

of fonts, it goes over these non-existing font files and tries to mark their

initialization in sun.font.SunFontManager::initialiseDeferredFont(String

fileNameKey) by adding the key into the initialisedFonts map. Since there is

no font handle available because the font couldn't be loaded but the map's

value must not be null, it wants to use the handle of the default physical

font. So, calling getDefaultPhysicalFont at this place triggers findFont2D and

then recursive calls into

initialiseDeferredFont/getDefaultPhysicalFont/findFont2D until a matching

default physical font was loaded. But it's quite indeterministic which font is

returned at what place in findFont2D when the recursion is unwinded, so this

ClassCastException occurs.



I propose to fix this by adding a "NULL FONT HANDLE" to use in

initialisedFonts for fonts that can't be loaded. This will remove the recursion

during loading of fonts. And afterwards a default physical font can then still

be resolved, even if our font configuration contains less fonts (no true type

fonts).



In my change I also add small improvements to the exception cases when

trying to load non-existent true type fonts and to method

getDefaultPhysicalFont.



The test exercises font loading and it would demonstrate the issue without

the fix on several of our AIX systems.



Here is the webrev:

http://cr.openjdk.java.net/~clanger/webrevs/8221741.0/



@Ichiroh-san: Can you test this fix in your environment and let me know if

it fixes your issue?



I'll run a full platform test here at SAP, including JDK11.



If this can get reviewed, I intend to push this fix to JDK14.



Thanks & Best regards

Christoph



-----Original Message-----

From: Phil Race <philip.race@oracle.com><mailto:philip.race@oracle.com>

Sent: Mittwoch, 30. Oktober 2019 17:07

To: Langer, Christoph <christoph.langer@sap.com><mailto:christoph.langer@sap.com>; \
Ichiroh Takiguchi

<takiguc@linux.vnet.ibm.com><mailto:takiguc@linux.vnet.ibm.com>

Cc: 2d-dev@openjdk.java.net<mailto:2d-dev@openjdk.java.net>; Zeller, Arno \
<arno.zeller@sap.com><mailto:arno.zeller@sap.com>

Subject: Re: [OpenJDK 2D-Dev] RFR: 8221741 ClassCastException happen

when fontconfig.properties was used



Yes probably best if this is reviewed and approved by someone who

has access to AIX. I have no idea if the XLFDs are even correct ...



-phil.



On 10/30/19 8:00 AM, Langer, Christoph wrote:

Hi Ichiroh,



I'm currently observing a test issue on one of our AIX boxes with that

patch

in place. Please give me some time to have a closer look...

Best regards

Christoph



-----Original Message-----

From: 2d-dev <2d-dev-bounces@openjdk.java.net><mailto:2d-dev-bounces@openjdk.java.net> \
On Behalf Of

Ichiroh

Takiguchi

Sent: Montag, 28. Oktober 2019 17:59

To: Philip Race <philip.race@oracle.com><mailto:philip.race@oracle.com>

Cc: 2d-dev@openjdk.java.net<mailto:2d-dev@openjdk.java.net>; Zeller, Arno \
<arno.zeller@sap.com><mailto:arno.zeller@sap.com>

Subject: Re: [OpenJDK 2D-Dev] RFR: 8221741 ClassCastException

happen

when fontconfig.properties was used



Hello Phil and other reviewers.



I appreciate if you give me your comment and suggestion.



Thanks,

Ichiroh Takiguchi



On 2019-10-15 20:33, Ichiroh Takiguchi wrote:

Hello Phil.



Sorry for bad response.



AIX is following case, but physical font is not defined by default.

If you have fonts installed and have a custom fontconfig.properties

file for AIX

which references those, then you should be able to get a default

font

from that

set of known existent physical fonts.

Please try following steps to emulate same kind this on linux (RHEL7).

1. Download DefaultFontTestA.java and fontconfig.properties files

     Please modify fontconfig.properties if c0419bt_.pfb is not in

/usr/share/X11/fonts/Type1 directory.



2. Compile and run with following options and environment variable.

      $ javac --add-exports java.desktop/sun.font=ALL-UNNAMED

DefaultFontTestA.java

      $ USE_J2D_FONTCONFIG=no java --add-opens

java.desktop/sun.font=ALL-UNNAMED

-Dsun.awt.fontconfigfontconfig.properties DefaultFontTestA

      defaultFontName=Dialog

      defaultFontFileName=/dialog.ttf

      Exception in thread "main" java.lang.ClassCastException: class

sun.font.CompositeFont cannot be cast to class sun.font.PhysicalFont

(sun.font.CompositeFont and sun.font.PhysicalFont are in module

java.desktop of loader 'bootstrap')

              at





java.desktop/sun.font.SunFontManager.getDefaultPhysicalFont(SunFontMa

nager.java:1081)

              at DefaultFontTestA.main(DefaultFontTestA.java:48)



         Font2D font2d =

              findFont2D(getDefaultFontFaceName(), Font.PLAIN,

NO_FALLBACK);

    Note:

      USE_J2D_FONTCONFIG is defined into

src/java.desktop/unix/native/common/awt/fontpath.c

      Dialog and /dialog.ttf are defined into

src/java.desktop/unix/classes/sun/awt/FcFontManager.java



getDefaultFontFaceName returns defaultFontName, it's "Dialog".

findFont2D() returns Dialog CompositeFont instead of physical font.

I think we cannot control return value for

physicalFonts.values().iterator();

"defaultPhysicalFont = ((CompositeFont) font2d).getSlotFont(0);" is

useful.



Please give me your comment.



Thanks,

Ichiroh Takiguchi



On 2019-10-09 01:06, Philip Race wrote:

I think this needs a little bit more explanation first.

Systems without fontconfig ... meaning without libfontconfig.

So does that mean you just can't find fonts or have none installed ?

If you have fonts installed and have a custom fontconfig.properties

file for AIX

which references those, then you should be able to get a default

font

from that

set of known existent physical fonts.



If you have neither .. then you have a system configuration problem

and without

a physical font installed avoiding an exception here isn't really

going to help you

get much further. Perhaps we should throw InternalError a bit

earlier.

I see no point in trying to survive ..



-phil





On 10/8/19, 12:35 AM, Langer, Christoph wrote:

Hi Ichiroh,



thanks for the update. It looks good to me. I'll run it through test

system tonight and let you know if we see issues by tomorrow.

Should

you not hear back from me, consider it as reviewed and tested 😊



Thanks

Christoph



-----Original Message-----

From: Ichiroh Takiguchi<takiguc@linux.vnet.ibm.com><mailto:takiguc@linux.vnet.ibm.com>


Sent: Montag, 7. Oktober 2019 19:16

To: Langer, Christoph<christoph.langer@sap.com><mailto:christoph.langer@sap.com>

Cc: 2d-dev@openjdk.java.net<mailto:2d-dev@openjdk.java.net>; Zeller,

Arno<arno.zeller@sap.com><mailto:arno.zeller@sap.com>

Subject: RE: [OpenJDK 2D-Dev] RFR: 8221741 ClassCastException

happen

when fontconfig.properties was used



Hello Christoph.



I appreciate your suggestion.

JTreg testcase could throw ClassCastException instead of

InvocationTargetException.

JTreg results were in JDK-8221741



Bug:    https://bugs.openjdk.java.net/browse/JDK-8221741

Change:

https://cr.openjdk.java.net/~itakiguchi/8221741/webrev.05/

Could you review the fix ?



Thanks,

Ichiroh Takiguchi

IBM Japan, Ltd.



On 2019-10-07 22:53, Langer, Christoph wrote:

Hi Ichiroh,



this is great, thanks for doing this. We regularly see this and

just

stumbled over it the other day where the fontconfig of our test

user

was corrupted somehow.



As for the test, I would reduce the amount of reflection a little

bit.

It should not be necessary to access SunFontManager via

Class.forName,

you already exported it to the test via the @modules statement.

You

can probably use this coding (please try as I didn't test it😊):



           SunFontManager sfm = SunFontManager.getInstance();

           Field defaultFontName_fid =

SunFontManager.class.getDeclaredField("defaultFontName");

           defaultFontName_fid.setAccessible(true);

           defaultFontName_fid.set(sfm, "Dialog");

           Method loadFonts_mid =

SunFontManager.class.getDeclaredMethod("loadFonts");

           loadFonts_mid.setAccessible(true);

           loadFonts_mid.invoke(sfm);

           PhysicalFont physicalFont = sfm.getDefaultPhysicalFont();

           System.out.println(physicalFont);



If you want, I can run your (updated) patch through our test

system.



Thanks

Christoph





-----Original Message-----

From: 2d-dev<2d-dev-bounces@openjdk.java.net><mailto:2d-dev-bounces@openjdk.java.net> \
On Behalf

Of

Ichiroh

Takiguchi

Sent: Montag, 7. Oktober 2019 09:33

To: 2d-dev@openjdk.java.net<mailto:2d-dev@openjdk.java.net>

Subject: [OpenJDK 2D-Dev] RFR: 8221741 ClassCastException

happen

when

fontconfig.properties was used



Hello.



Could you review the fix ?



Bug:    https://bugs.openjdk.java.net/browse/JDK-8221741

Change:

https://cr.openjdk.java.net/~itakiguchi/8221741/webrev.04/

JTreg testcase and results are including JDK-8221741 [1].



[1] https://bugs.openjdk.java.net/browse/JDK-8221741



Thanks,

Ichiroh Takiguchi

IBM Japan, Ltd.


[Attachment #3 (text/html)]

<html xmlns:v="urn:schemas-microsoft-com:vml" \
xmlns:o="urn:schemas-microsoft-com:office:office" \
xmlns:w="urn:schemas-microsoft-com:office:word" \
xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" \
xmlns="http://www.w3.org/TR/REC-html40"> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
	{font-family:"Segoe UI Emoji";
	panose-1:2 11 5 2 4 2 4 2 2 3;}
@font-face
	{font-family:Consolas;
	panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0cm;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	font-family:"Calibri",sans-serif;
	color:black;}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{mso-style-priority:99;
	color:purple;
	text-decoration:underline;}
pre
	{mso-style-priority:99;
	mso-style-link:"HTML Preformatted Char";
	margin:0cm;
	margin-bottom:.0001pt;
	font-size:10.0pt;
	font-family:"Courier New";
	color:black;}
p.msonormal0, li.msonormal0, div.msonormal0
	{mso-style-name:msonormal;
	mso-margin-top-alt:auto;
	margin-right:0cm;
	mso-margin-bottom-alt:auto;
	margin-left:0cm;
	font-size:11.0pt;
	font-family:"Calibri",sans-serif;
	color:black;}
span.HTMLPreformattedChar
	{mso-style-name:"HTML Preformatted Char";
	mso-style-priority:99;
	mso-style-link:"HTML Preformatted";
	font-family:Consolas;
	color:black;}
span.changed
	{mso-style-name:changed;}
span.EmailStyle21
	{mso-style-type:personal;
	font-family:"Calibri",sans-serif;
	color:windowtext;}
span.EmailStyle22
	{mso-style-type:personal-reply;
	font-family:"Calibri",sans-serif;
	color:windowtext;}
.MsoChpDefault
	{mso-style-type:export-only;
	font-size:10.0pt;}
@page WordSection1
	{size:612.0pt 792.0pt;
	margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
	{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body bgcolor="white" lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="color:windowtext">I still might not fully get \
it…<o:p></o:p></span></p> <p class="MsoNormal"><span \
style="color:windowtext"><o:p>&nbsp;</o:p></span></p> <p class="MsoNormal"><span \
style="color:windowtext">So, the call to AccessController.doPrivileged() with a \
PrivilegedExceptionAction might eventually yield a PrivilegedActionException which I \
catch and handle (as before the NPE). The only thing that differs  now is that I \
don't handle NPE any more. I was thinking that the only possible source of NPE was \
when raf is null. That can't happen now any more because ‘new RandomAccessFile' \
either delivers an Object or throws. But maybe a more defensive approach would  be to \
still handle NPE in case it occurs for whatever other reason?<o:p></o:p></span></p> \
<p class="MsoNormal"><span style="color:windowtext"><o:p>&nbsp;</o:p></span></p> <p \
class="MsoNormal"><span style="color:windowtext">So, generally, I'm running this \
patch fine through all our platform testing. I agree that it should be pushed to \
client-dev and not rushed into 14. Maybe that would give enough test coverage and \
time to bake?<o:p></o:p></span></p> <p class="MsoNormal"><span \
style="color:windowtext"><o:p>&nbsp;</o:p></span></p> <p class="MsoNormal"><span \
style="color:windowtext">/Christoph<o:p></o:p></span></p> <p \
class="MsoNormal"><o:p>&nbsp;</o:p></p> <div style="border:none;border-left:solid \
blue 1.5pt;padding:0cm 0cm 0cm 4.0pt"> <div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="color:windowtext">From:</span></b><span \
style="color:windowtext"> Phil Race &lt;philip.race@oracle.com&gt; <br>
<b>Sent:</b> Donnerstag, 19. Dezember 2019 21:59<br>
<b>To:</b> Langer, Christoph &lt;christoph.langer@sap.com&gt;; Ichiroh Takiguchi \
&lt;takiguc@linux.vnet.ibm.com&gt;<br> <b>Cc:</b> 2d-dev@openjdk.java.net<br>
<b>Subject:</b> Re: [OpenJDK 2D-Dev] RFR: 8221741 ClassCastException happen when \
fontconfig.properties was used<o:p></o:p></span></p> </div>
</div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt">Here you are seeing the exception \
during initialisation but if the font is in use<br> we might get an exception handed \
to native code when it has not had to deal<br> with that. We should check that code \
and if it is ready to deal with pending<br> exceptions. Other JNI calls in native \
will fail if it is not and the exception will<br> ultimately propagate back to the \
original Java code. It all needs to be looked through for problems.<br> <br>
-phil.<o:p></o:p></p>
<div>
<p class="MsoNormal">On 12/19/19 12:39 PM, Langer, Christoph wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal"><span style="color:windowtext">I don't understand what's \
intriguing you with that code, please help me…</span><o:p></o:p></p> <p \
class="MsoNormal"><span style="color:windowtext">&nbsp;</span><o:p></o:p></p> <p \
class="MsoNormal"><span style="color:windowtext">It was done like this before, e.g. \
the RandomAccessFile was opened in the privileged block. But before you'd only see a \
null reference coming out in case something went wrong. Now you'd have the \
FileNotFoundException  at hand to be able to trace this detail… Are you concerned \
that this information could be leaked out of the Privileged block when it \
shouldn't?</span><o:p></o:p></p> <p class="MsoNormal"><span \
style="color:windowtext">&nbsp;</span><o:p></o:p></p> <p class="MsoNormal"><span \
style="color:windowtext">/Christoph</span><o:p></o:p></p> <p \
class="MsoNormal">&nbsp;<o:p></o:p></p> <div style="border:none;border-left:solid \
blue 1.5pt;padding:0cm 0cm 0cm 4.0pt"> <div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="color:windowtext">From:</span></b><span \
style="color:windowtext"> Phil Race <a \
href="mailto:philip.race@oracle.com">&lt;philip.race@oracle.com&gt;</a> <br> \
<b>Sent:</b> Donnerstag, 19. Dezember 2019 21:04<br> <b>To:</b> Langer, Christoph <a \
href="mailto:christoph.langer@sap.com">&lt;christoph.langer@sap.com&gt;</a>; Ichiroh \
Takiguchi <a href="mailto:takiguc@linux.vnet.ibm.com">&lt;takiguc@linux.vnet.ibm.com&gt;</a><br>
 <b>Cc:</b> <a href="mailto:2d-dev@openjdk.java.net">2d-dev@openjdk.java.net</a><br>
<b>Subject:</b> Re: [OpenJDK 2D-Dev] RFR: 8221741 ClassCastException happen when \
fontconfig.properties was used</span><o:p></o:p></p> </div>
</div>
<p class="MsoNormal">&nbsp;<o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt">This makes me very nervous because \
it is up-called from native code.<br> I am not sure I would want this change in any \
release ...<o:p></o:p></p> \
<pre>317&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; try \
{<o:p></o:p></pre> <pre><span class="changed"> \
318&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
RandomAccessFile raf = AccessController.doPrivileged(</span><o:p></o:p></pre> \
<pre><span class="changed"> \
319&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
new PrivilegedExceptionAction&lt;RandomAccessFile&gt;() {</span><o:p></o:p></pre> \
<pre><span class="changed"> \
320&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
public RandomAccessFile run() throws FileNotFoundException {</span><o:p></o:p></pre> \
<pre><span class="changed"> \
321&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp \
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
return new RandomAccessFile(platName, &quot;r&quot;);</span><o:p></o:p></pre> <div>
<p class="MsoNormal"><br>
-phil.<br>
<br>
On 12/19/19 12:01 PM, Langer, Christoph wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>Hi Phil,<o:p></o:p></pre>
<pre>&nbsp;<o:p></o:p></pre>
<pre>Type 1 fonts were available but got skipped.<o:p></o:p></pre>
<pre>&nbsp;<o:p></o:p></pre>
<pre>/Christoph<o:p></o:p></pre>
<pre>&nbsp;<o:p></o:p></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>-----Original Message-----<o:p></o:p></pre>
<pre>From: Phil Race <a \
href="mailto:philip.race@oracle.com">&lt;philip.race@oracle.com&gt;</a><o:p></o:p></pre>
 <pre>Sent: Donnerstag, 19. Dezember 2019 20:58<o:p></o:p></pre>
<pre>To: Langer, Christoph <a \
href="mailto:christoph.langer@sap.com">&lt;christoph.langer@sap.com&gt;</a>; Ichiroh \
Takiguchi<o:p></o:p></pre> <pre><a \
href="mailto:takiguc@linux.vnet.ibm.com">&lt;takiguc@linux.vnet.ibm.com&gt;</a><o:p></o:p></pre>
 <pre>Cc: <a href="mailto:2d-dev@openjdk.java.net">2d-dev@openjdk.java.net</a><o:p></o:p></pre>
 <pre>Subject: Re: [OpenJDK 2D-Dev] RFR: 8221741 ClassCastException \
happen<o:p></o:p></pre> <pre>when fontconfig.properties was used<o:p></o:p></pre>
<pre>&nbsp;<o:p></o:p></pre>
<pre>Hi,<o:p></o:p></pre>
<pre>&nbsp;<o:p></o:p></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>If this can get reviewed, I intend to push this fix to JDK14.<o:p></o:p></pre>
</blockquote>
<pre>&nbsp;<o:p></o:p></pre>
<pre>Not for 14. This will take some time to review and test and is too risky at \
this<o:p></o:p></pre> <pre>stage.<o:p></o:p></pre>
<pre>&nbsp;<o:p></o:p></pre>
<pre>You say no TrueType fonts are installed, does that mean there are \
no<o:p></o:p></pre> <pre>scaleable fonts at all,<o:p></o:p></pre>
<pre>or are there Type 1 fonts we are skipping over ?<o:p></o:p></pre>
<pre>&nbsp;<o:p></o:p></pre>
<pre>-phil.<o:p></o:p></pre>
<pre>&nbsp;<o:p></o:p></pre>
<pre>&nbsp;<o:p></o:p></pre>
<pre>&nbsp;<o:p></o:p></pre>
<pre>On 12/18/19 6:31 AM, Langer, Christoph wrote:<o:p></o:p></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>Hi,<o:p></o:p></pre>
<pre>&nbsp;<o:p></o:p></pre>
<pre>sorry for the long time that it took me to come back to this \
item.<o:p></o:p></pre> <pre>&nbsp;<o:p></o:p></pre>
<pre>I eventually spent quite a significant amount of time analyzing what's \
going<o:p></o:p></pre> </blockquote>
<pre>wrong here. At least, I have a few AIX LPARs, where we would \
always<o:p></o:p></pre> <pre>encounter this type of Exception:<o:p></o:p></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>&nbsp;<o:p></o:p></pre>
<pre>Exception in thread &quot;AWT-EventQueue-0&quot; \
java.lang.ClassCastException:<o:p></o:p></pre> </blockquote>
<pre>class sun.font.CompositeFont cannot be cast to class \
sun.font.PhysicalFont<o:p></o:p></pre> <pre>(sun.font.CompositeFont and \
sun.font.PhysicalFont are in module<o:p></o:p></pre> <pre>java.desktop of loader \
'bootstrap')<o:p></o:p></pre> <blockquote \
style="margin-top:5.0pt;margin-bottom:5.0pt"> \
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at<o:p></o:p></pre> \
</blockquote> <pre>java.desktop/sun.font.SunFontManager.getDefaultPhysicalFont(SunFontMa<o:p></o:p></pre>
 <pre>nager.java:1081)<o:p></o:p></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at<o:p></o:p></pre>
</blockquote>
<pre>java.desktop/sun.font.SunFontManager.initialiseDeferredFont(SunFontMan<o:p></o:p></pre>
 <pre>ager.java:960)<o:p></o:p></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at<o:p></o:p></pre>
</blockquote>
<pre>java.desktop/sun.font.SunFontManager.findOtherDeferredFont(SunFontM<o:p></o:p></pre>
 <pre>anager.java:898)<o:p></o:p></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at<o:p></o:p></pre>
</blockquote>
<pre>java.desktop/sun.font.SunFontManager.findDeferredFont(SunFontManager<o:p></o:p></pre>
 <pre>.java:914)<o:p></o:p></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at<o:p></o:p></pre>
</blockquote>
<pre>java.desktop/sun.font.SunFontManager.findFont2D(SunFontManager.java:2<o:p></o:p></pre>
 <pre>105)<o:p></o:p></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ...<o:p></o:p></pre>
<pre>&nbsp;<o:p></o:p></pre>
<pre>The problem on our systems is triggered by two factors. First is that \
the<o:p></o:p></pre> </blockquote>
<pre>font configuration file contains paths to font files that don't exist. \
Secondly,<o:p></o:p></pre> <pre>the system's fontconfig has no TrueType Fonts \
installed. Now, during loading<o:p></o:p></pre> <pre>of fonts, it goes over these \
non-existing font files and tries to mark their<o:p></o:p></pre> <pre>initialization \
in sun.font.SunFontManager::initialiseDeferredFont(String<o:p></o:p></pre> \
<pre>fileNameKey) by adding the key into the initialisedFonts map. Since there \
is<o:p></o:p></pre> <pre>no font handle available because the font couldn't be loaded \
but the map's<o:p></o:p></pre> <pre>value must not be null, it wants to use the \
handle of the default physical<o:p></o:p></pre> <pre>font. So, calling \
getDefaultPhysicalFont at this place triggers findFont2D and<o:p></o:p></pre> \
<pre>then recursive calls into<o:p></o:p></pre> \
<pre>initialiseDeferredFont/getDefaultPhysicalFont/findFont2D until a \
matching<o:p></o:p></pre> <pre>default physical font was loaded. But it's quite \
indeterministic which font is<o:p></o:p></pre> <pre>returned at what place in \
findFont2D when the recursion is unwinded, so this<o:p></o:p></pre> \
<pre>ClassCastException occurs.<o:p></o:p></pre> <blockquote \
style="margin-top:5.0pt;margin-bottom:5.0pt"> <pre>&nbsp;<o:p></o:p></pre>
<pre>I propose to fix this by adding a &quot;NULL FONT HANDLE&quot; to use \
in<o:p></o:p></pre> </blockquote>
<pre>initialisedFonts for fonts that can't be loaded. This will remove the \
recursion<o:p></o:p></pre> <pre>during loading of fonts. And afterwards a default \
physical font can then still<o:p></o:p></pre> <pre>be resolved, even if our font \
configuration contains less fonts (no true type<o:p></o:p></pre> \
<pre>fonts).<o:p></o:p></pre> <blockquote \
style="margin-top:5.0pt;margin-bottom:5.0pt"> <pre>&nbsp;<o:p></o:p></pre>
<pre>In my change I also add small improvements to the exception cases \
when<o:p></o:p></pre> </blockquote>
<pre>trying to load non-existent true type fonts and to method<o:p></o:p></pre>
<pre>getDefaultPhysicalFont.<o:p></o:p></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>&nbsp;<o:p></o:p></pre>
<pre>The test exercises font loading and it would demonstrate the issue \
without<o:p></o:p></pre> </blockquote>
<pre>the fix on several of our AIX systems.<o:p></o:p></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>&nbsp;<o:p></o:p></pre>
<pre>Here is the webrev:<o:p></o:p></pre>
</blockquote>
<pre><a href="http://cr.openjdk.java.net/~clanger/webrevs/8221741.0/">http://cr.openjdk.java.net/~clanger/webrevs/8221741.0/</a><o:p></o:p></pre>
 <blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>&nbsp;<o:p></o:p></pre>
<pre>@Ichiroh-san: Can you test this fix in your environment and let me know \
if<o:p></o:p></pre> </blockquote>
<pre>it fixes your issue?<o:p></o:p></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>&nbsp;<o:p></o:p></pre>
<pre>I'll run a full platform test here at SAP, including JDK11.<o:p></o:p></pre>
<pre>&nbsp;<o:p></o:p></pre>
<pre>If this can get reviewed, I intend to push this fix to JDK14.<o:p></o:p></pre>
<pre>&nbsp;<o:p></o:p></pre>
<pre>Thanks &amp; Best regards<o:p></o:p></pre>
<pre>Christoph<o:p></o:p></pre>
<pre>&nbsp;<o:p></o:p></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>-----Original Message-----<o:p></o:p></pre>
<pre>From: Phil Race <a \
href="mailto:philip.race@oracle.com">&lt;philip.race@oracle.com&gt;</a><o:p></o:p></pre>
 <pre>Sent: Mittwoch, 30. Oktober 2019 17:07<o:p></o:p></pre>
<pre>To: Langer, Christoph <a \
href="mailto:christoph.langer@sap.com">&lt;christoph.langer@sap.com&gt;</a>; Ichiroh \
Takiguchi<o:p></o:p></pre> <pre><a \
href="mailto:takiguc@linux.vnet.ibm.com">&lt;takiguc@linux.vnet.ibm.com&gt;</a><o:p></o:p></pre>
 <pre>Cc: <a href="mailto:2d-dev@openjdk.java.net">2d-dev@openjdk.java.net</a>; \
Zeller, Arno <a href="mailto:arno.zeller@sap.com">&lt;arno.zeller@sap.com&gt;</a><o:p></o:p></pre>
 <pre>Subject: Re: [OpenJDK 2D-Dev] RFR: 8221741 ClassCastException \
happen<o:p></o:p></pre> <pre>when fontconfig.properties was used<o:p></o:p></pre>
<pre>&nbsp;<o:p></o:p></pre>
<pre>Yes probably best if this is reviewed and approved by someone \
who<o:p></o:p></pre> <pre>has access to AIX. I have no idea if the XLFDs are even \
correct ...<o:p></o:p></pre> <pre>&nbsp;<o:p></o:p></pre>
<pre>-phil.<o:p></o:p></pre>
<pre>&nbsp;<o:p></o:p></pre>
<pre>On 10/30/19 8:00 AM, Langer, Christoph wrote:<o:p></o:p></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>Hi Ichiroh,<o:p></o:p></pre>
<pre>&nbsp;<o:p></o:p></pre>
<pre>I'm currently observing a test issue on one of our AIX boxes with \
that<o:p></o:p></pre> </blockquote>
</blockquote>
</blockquote>
<pre>patch<o:p></o:p></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>in place. Please give me some time to have a closer look...<o:p></o:p></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>Best regards<o:p></o:p></pre>
<pre>Christoph<o:p></o:p></pre>
<pre>&nbsp;<o:p></o:p></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>-----Original Message-----<o:p></o:p></pre>
<pre>From: 2d-dev <a \
href="mailto:2d-dev-bounces@openjdk.java.net">&lt;2d-dev-bounces@openjdk.java.net&gt;</a> \
On Behalf Of<o:p></o:p></pre> </blockquote>
</blockquote>
</blockquote>
</blockquote>
<pre>Ichiroh<o:p></o:p></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>Takiguchi<o:p></o:p></pre>
<pre>Sent: Montag, 28. Oktober 2019 17:59<o:p></o:p></pre>
<pre>To: Philip Race <a \
href="mailto:philip.race@oracle.com">&lt;philip.race@oracle.com&gt;</a><o:p></o:p></pre>
 <pre>Cc: <a href="mailto:2d-dev@openjdk.java.net">2d-dev@openjdk.java.net</a>; \
Zeller, Arno <a href="mailto:arno.zeller@sap.com">&lt;arno.zeller@sap.com&gt;</a><o:p></o:p></pre>
 <pre>Subject: Re: [OpenJDK 2D-Dev] RFR: 8221741 ClassCastException<o:p></o:p></pre>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
<pre>happen<o:p></o:p></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>when fontconfig.properties was used<o:p></o:p></pre>
<pre>&nbsp;<o:p></o:p></pre>
<pre>Hello Phil and other reviewers.<o:p></o:p></pre>
<pre>&nbsp;<o:p></o:p></pre>
<pre>I appreciate if you give me your comment and suggestion.<o:p></o:p></pre>
<pre>&nbsp;<o:p></o:p></pre>
<pre>Thanks,<o:p></o:p></pre>
<pre>Ichiroh Takiguchi<o:p></o:p></pre>
<pre>&nbsp;<o:p></o:p></pre>
<pre>On 2019-10-15 20:33, Ichiroh Takiguchi wrote:<o:p></o:p></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>Hello Phil.<o:p></o:p></pre>
<pre>&nbsp;<o:p></o:p></pre>
<pre>Sorry for bad response.<o:p></o:p></pre>
<pre>&nbsp;<o:p></o:p></pre>
<pre>AIX is following case, but physical font is not defined by \
default.<o:p></o:p></pre> <blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>If you have fonts installed and have a custom \
fontconfig.properties<o:p></o:p></pre> <pre>file for AIX<o:p></o:p></pre>
<pre>which references those, then you should be able to get a \
default<o:p></o:p></pre> </blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
<pre>font<o:p></o:p></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>from that<o:p></o:p></pre>
<pre>set of known existent physical fonts.<o:p></o:p></pre>
</blockquote>
<pre>Please try following steps to emulate same kind this on linux \
(RHEL7).<o:p></o:p></pre> <pre>1. Download DefaultFontTestA.java and \
fontconfig.properties files<o:p></o:p></pre> <pre>&nbsp;&nbsp;&nbsp;&nbsp; Please \
modify fontconfig.properties if c0419bt_.pfb is not in<o:p></o:p></pre> \
<pre>/usr/share/X11/fonts/Type1 directory.<o:p></o:p></pre> \
<pre>&nbsp;<o:p></o:p></pre> <pre>2. Compile and run with following options and \
environment variable.<o:p></o:p></pre> <pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $ javac \
--add-exports java.desktop/sun.font=ALL-UNNAMED<o:p></o:p></pre> \
<pre>DefaultFontTestA.java<o:p></o:p></pre> <pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $ \
USE_J2D_FONTCONFIG=no java --add-opens<o:p></o:p></pre> \
<pre>java.desktop/sun.font=ALL-UNNAMED<o:p></o:p></pre> \
<pre>-Dsun.awt.fontconfigfontconfig.properties DefaultFontTestA<o:p></o:p></pre> \
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; defaultFontName=Dialog<o:p></o:p></pre> \
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; defaultFontFileName=/dialog.ttf<o:p></o:p></pre> \
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Exception in thread &quot;main&quot; \
java.lang.ClassCastException: class<o:p></o:p></pre> <pre>sun.font.CompositeFont \
cannot be cast to class sun.font.PhysicalFont<o:p></o:p></pre> \
<pre>(sun.font.CompositeFont and sun.font.PhysicalFont are in module<o:p></o:p></pre> \
<pre>java.desktop of loader 'bootstrap')<o:p></o:p></pre> \
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
at<o:p></o:p></pre> <pre>&nbsp;<o:p></o:p></pre>
</blockquote>
</blockquote>
</blockquote>
<pre>&nbsp;<o:p></o:p></pre>
</blockquote>
</blockquote>
<pre>java.desktop/sun.font.SunFontManager.getDefaultPhysicalFont(SunFontMa<o:p></o:p></pre>
 <blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>nager.java:1081)<o:p></o:p></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
at DefaultFontTestA.main(DefaultFontTestA.java:48)<o:p></o:p></pre> \
<pre>&nbsp;<o:p></o:p></pre> <pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
Font2D font2d =<o:p></o:p></pre> \
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
findFont2D(getDefaultFontFaceName(), Font.PLAIN,<o:p></o:p></pre> \
<pre>NO_FALLBACK);<o:p></o:p></pre> <pre>&nbsp;&nbsp;&nbsp; Note:<o:p></o:p></pre>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; USE_J2D_FONTCONFIG is defined \
into<o:p></o:p></pre> \
<pre>src/java.desktop/unix/native/common/awt/fontpath.c<o:p></o:p></pre> \
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dialog and /dialog.ttf are defined \
into<o:p></o:p></pre> \
<pre>src/java.desktop/unix/classes/sun/awt/FcFontManager.java<o:p></o:p></pre> \
<pre>&nbsp;<o:p></o:p></pre> <pre>getDefaultFontFaceName returns defaultFontName, \
it's &quot;Dialog&quot;.<o:p></o:p></pre> <pre>findFont2D() returns Dialog \
CompositeFont instead of physical font.<o:p></o:p></pre> <pre>I think we cannot \
control return value for<o:p></o:p></pre> \
<pre>physicalFonts.values().iterator();<o:p></o:p></pre> \
<pre>&quot;defaultPhysicalFont = ((CompositeFont) font2d).getSlotFont(0);&quot; \
is<o:p></o:p></pre> <pre>useful.<o:p></o:p></pre>
<pre>&nbsp;<o:p></o:p></pre>
<pre>Please give me your comment.<o:p></o:p></pre>
<pre>&nbsp;<o:p></o:p></pre>
<pre>Thanks,<o:p></o:p></pre>
<pre>Ichiroh Takiguchi<o:p></o:p></pre>
<pre>&nbsp;<o:p></o:p></pre>
<pre>On 2019-10-09 01:06, Philip Race wrote:<o:p></o:p></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>I think this needs a little bit more explanation first.<o:p></o:p></pre>
<pre>Systems without fontconfig ... meaning without libfontconfig.<o:p></o:p></pre>
<pre>So does that mean you just can't find fonts or have none installed \
?<o:p></o:p></pre> <pre>If you have fonts installed and have a custom \
fontconfig.properties<o:p></o:p></pre> <pre>file for AIX<o:p></o:p></pre>
<pre>which references those, then you should be able to get a \
default<o:p></o:p></pre> </blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
<pre>font<o:p></o:p></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>from that<o:p></o:p></pre>
<pre>set of known existent physical fonts.<o:p></o:p></pre>
<pre>&nbsp;<o:p></o:p></pre>
<pre>If you have neither .. then you have a system configuration \
problem<o:p></o:p></pre> <pre>and without<o:p></o:p></pre>
<pre>a physical font installed avoiding an exception here isn't \
really<o:p></o:p></pre> <pre>going to help you<o:p></o:p></pre>
<pre>get much further. Perhaps we should throw InternalError a bit<o:p></o:p></pre>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
<pre>earlier.<o:p></o:p></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>I see no point in trying to survive ..<o:p></o:p></pre>
<pre>&nbsp;<o:p></o:p></pre>
<pre>-phil<o:p></o:p></pre>
<pre>&nbsp;<o:p></o:p></pre>
<pre>&nbsp;<o:p></o:p></pre>
<pre>On 10/8/19, 12:35 AM, Langer, Christoph wrote:<o:p></o:p></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>Hi Ichiroh,<o:p></o:p></pre>
<pre>&nbsp;<o:p></o:p></pre>
<pre>thanks for the update. It looks good to me. I'll run it through \
test<o:p></o:p></pre> <pre>system tonight and let you know if we see issues by \
tomorrow.<o:p></o:p></pre> </blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
<pre>Should<o:p></o:p></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>you not hear back from me, consider it as reviewed and tested <span \
style="font-family:&quot;Segoe UI \
Emoji&quot;,sans-serif">&#128522;</span><o:p></o:p></pre> \
<pre>&nbsp;<o:p></o:p></pre> <pre>Thanks<o:p></o:p></pre>
<pre>Christoph<o:p></o:p></pre>
<pre>&nbsp;<o:p></o:p></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>-----Original Message-----<o:p></o:p></pre>
<pre>From: Ichiroh Takiguchi<a \
href="mailto:takiguc@linux.vnet.ibm.com">&lt;takiguc@linux.vnet.ibm.com&gt;</a><o:p></o:p></pre>
 <pre>Sent: Montag, 7. Oktober 2019 19:16<o:p></o:p></pre>
<pre>To: Langer, Christoph<a \
href="mailto:christoph.langer@sap.com">&lt;christoph.langer@sap.com&gt;</a><o:p></o:p></pre>
 <pre>Cc: <a href="mailto:2d-dev@openjdk.java.net">2d-dev@openjdk.java.net</a>; \
Zeller,<o:p></o:p></pre> </blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
<pre>Arno<a href="mailto:arno.zeller@sap.com">&lt;arno.zeller@sap.com&gt;</a><o:p></o:p></pre>
 <blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>Subject: RE: [OpenJDK 2D-Dev] RFR: 8221741 ClassCastException<o:p></o:p></pre>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
<pre>happen<o:p></o:p></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>when fontconfig.properties was used<o:p></o:p></pre>
<pre>&nbsp;<o:p></o:p></pre>
<pre>Hello Christoph.<o:p></o:p></pre>
<pre>&nbsp;<o:p></o:p></pre>
<pre>I appreciate your suggestion.<o:p></o:p></pre>
<pre>JTreg testcase could throw ClassCastException instead of<o:p></o:p></pre>
<pre>InvocationTargetException.<o:p></o:p></pre>
<pre>JTreg results were in JDK-8221741<o:p></o:p></pre>
<pre>&nbsp;<o:p></o:p></pre>
<pre>Bug:&nbsp;&nbsp;&nbsp; <a \
href="https://bugs.openjdk.java.net/browse/JDK-8221741">https://bugs.openjdk.java.net/browse/JDK-8221741</a><o:p></o:p></pre>
 <pre>Change:<o:p></o:p></pre>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
<pre><a href="https://cr.openjdk.java.net/~itakiguchi/8221741/webrev.05/">https://cr.openjdk.java.net/~itakiguchi/8221741/webrev.05/</a><o:p></o:p></pre>
 <blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>Could you review the fix ?<o:p></o:p></pre>
<pre>&nbsp;<o:p></o:p></pre>
<pre>Thanks,<o:p></o:p></pre>
<pre>Ichiroh Takiguchi<o:p></o:p></pre>
<pre>IBM Japan, Ltd.<o:p></o:p></pre>
<pre>&nbsp;<o:p></o:p></pre>
<pre>On 2019-10-07 22:53, Langer, Christoph wrote:<o:p></o:p></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>Hi Ichiroh,<o:p></o:p></pre>
<pre>&nbsp;<o:p></o:p></pre>
<pre>this is great, thanks for doing this. We regularly see this and<o:p></o:p></pre>
<pre>just<o:p></o:p></pre>
<pre>stumbled over it the other day where the fontconfig of our test<o:p></o:p></pre>
<pre>user<o:p></o:p></pre>
<pre>was corrupted somehow.<o:p></o:p></pre>
<pre>&nbsp;<o:p></o:p></pre>
<pre>As for the test, I would reduce the amount of reflection a \
little<o:p></o:p></pre> <pre>bit.<o:p></o:p></pre>
<pre>It should not be necessary to access SunFontManager via<o:p></o:p></pre>
<pre>Class.forName,<o:p></o:p></pre>
<pre>you already exported it to the test via the @modules statement.<o:p></o:p></pre>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
<pre>You<o:p></o:p></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>can probably use this coding (please try as I didn't test it<span \
style="font-family:&quot;Segoe UI \
Emoji&quot;,sans-serif">&#128522;</span>):<o:p></o:p></pre> \
<pre>&nbsp;<o:p></o:p></pre> \
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SunFontManager sfm \
= SunFontManager.getInstance();<o:p></o:p></pre> \
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Field \
defaultFontName_fid =<o:p></o:p></pre> \
<pre>SunFontManager.class.getDeclaredField(&quot;defaultFontName&quot;);<o:p></o:p></pre>
 <pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
defaultFontName_fid.setAccessible(true);<o:p></o:p></pre> \
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
defaultFontName_fid.set(sfm, &quot;Dialog&quot;);<o:p></o:p></pre> \
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Method \
loadFonts_mid =<o:p></o:p></pre> \
<pre>SunFontManager.class.getDeclaredMethod(&quot;loadFonts&quot;);<o:p></o:p></pre> \
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
loadFonts_mid.setAccessible(true);<o:p></o:p></pre> \
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
loadFonts_mid.invoke(sfm);<o:p></o:p></pre> \
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PhysicalFont \
physicalFont = sfm.getDefaultPhysicalFont();<o:p></o:p></pre> \
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
System.out.println(physicalFont);<o:p></o:p></pre> <pre>&nbsp;<o:p></o:p></pre>
<pre>If you want, I can run your (updated) patch through our test<o:p></o:p></pre>
<pre>system.<o:p></o:p></pre>
<pre>&nbsp;<o:p></o:p></pre>
<pre>Thanks<o:p></o:p></pre>
<pre>Christoph<o:p></o:p></pre>
<pre>&nbsp;<o:p></o:p></pre>
<pre>&nbsp;<o:p></o:p></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>-----Original Message-----<o:p></o:p></pre>
<pre>From: 2d-dev<a href="mailto:2d-dev-bounces@openjdk.java.net">&lt;2d-dev-bounces@openjdk.java.net&gt;</a>&nbsp; \
On Behalf<o:p></o:p></pre> </blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
<pre>Of<o:p></o:p></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>Ichiroh<o:p></o:p></pre>
<pre>Takiguchi<o:p></o:p></pre>
<pre>Sent: Montag, 7. Oktober 2019 09:33<o:p></o:p></pre>
<pre>To: <a href="mailto:2d-dev@openjdk.java.net">2d-dev@openjdk.java.net</a><o:p></o:p></pre>
 <pre>Subject: [OpenJDK 2D-Dev] RFR: 8221741 ClassCastException<o:p></o:p></pre>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
<pre>happen<o:p></o:p></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>when<o:p></o:p></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>fontconfig.properties was used<o:p></o:p></pre>
<pre>&nbsp;<o:p></o:p></pre>
<pre>Hello.<o:p></o:p></pre>
<pre>&nbsp;<o:p></o:p></pre>
<pre>Could you review the fix ?<o:p></o:p></pre>
<pre>&nbsp;<o:p></o:p></pre>
<pre>Bug:&nbsp;&nbsp;&nbsp; <a \
href="https://bugs.openjdk.java.net/browse/JDK-8221741">https://bugs.openjdk.java.net/browse/JDK-8221741</a><o:p></o:p></pre>
 <pre>Change:<o:p></o:p></pre>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
<pre><a href="https://cr.openjdk.java.net/~itakiguchi/8221741/webrev.04/">https://cr.openjdk.java.net/~itakiguchi/8221741/webrev.04/</a><o:p></o:p></pre>
 <blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>JTreg testcase and results are including JDK-8221741 [1].<o:p></o:p></pre>
<pre>&nbsp;<o:p></o:p></pre>
<pre>[1] <a href="https://bugs.openjdk.java.net/browse/JDK-8221741">https://bugs.openjdk.java.net/browse/JDK-8221741</a><o:p></o:p></pre>
 <pre>&nbsp;<o:p></o:p></pre>
<pre>Thanks,<o:p></o:p></pre>
<pre>Ichiroh Takiguchi<o:p></o:p></pre>
<pre>IBM Japan, Ltd.<o:p></o:p></pre>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
<pre>&nbsp;<o:p></o:p></pre>
</blockquote>
<p class="MsoNormal">&nbsp;<o:p></o:p></p>
</div>
</blockquote>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
</div>
</body>
</html>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic