[OpenJDK 2D-Dev] RFR: 8221741 [AIX] Unexpected X11 bitmap fonts are loaded because of fontconfig.properties
Ichiroh Takiguchi
takiguc at linux.vnet.ibm.com
Fri Apr 19 12:18:44 UTC 2019
Hello Phil.
I'm using standard OpenJDK JDK13 b13 for AIX, like:
openjdk version "13-internal" 2019-09-17
OpenJDK Runtime Environment (build 13-internal+0-jdk13-13)
OpenJDK 64-Bit Server VM (build 13-internal+0-jdk13-13, mixed mode)
(Compiled it by myself)
To see stack trace, I tried following instruction:
1. Login to AIX box from another machine
2. Login to AIX box from AIX CDE on local AIX box Japanese locale
(Ja_JP) or C locale
3. Open terminal, like dtterm on local AIX box
4. Start SwingSet2 demo program
5. Check java's process id
6. Move mouse cursor to 2nd icon (ToolTipDemo) from right side
7. Move mouse cursor on cow image to display ToolTip
8. Keep moving the mouse cursor slowly, mouse cursor may be stopped
(I said this situation was "frozen".)
9. After Xserver was frozen, execute "kill -3" with java process id
10. Then stack trace is displayed
"AWT-EventQueue-0" #14 prio=6 os_prio=57 cpu=1362.57ms elapsed=31.90s
tid=0x0000000113f44800 nid=0x1516 runnable [0x0000000114159000]
java.lang.Thread.State: RUNNABLE
at sun.font.NativeFont.countGlyphs(java.desktop at 13-internal/Native
Method)
at
sun.font.NativeFont.getNumGlyphs(java.desktop at 13-internal/NativeFont.java:312)
at
sun.font.NativeFont.<init>(java.desktop at 13-internal/NativeFont.java:90)
at
sun.font.SunFontManager.registerFontFile(java.desktop at 13-internal/SunFontManager.java:1023)
at
sun.font.SunFontManager.initialiseDeferredFont(java.desktop at 13-internal/SunFontManager.java:946)
...
I could recreate same issue on AdoptOpenJDK JDK12 with Hotspot JVM.
Thanks,
Ichiroh Takiguchi
On 2019-04-19 05:20, Phil Race wrote:
> On startup ?
> What is the Java stack trace that gets you into that call ?
> Is it this with any modified IBM code, or pure OpenJDK ?
>
> -phil.
>
> On 4/17/19 11:55 PM, Ichiroh Takiguchi wrote:
>> Hello Phil.
>>
>> I appreciate your reply.
>> I put problem analysis information in JDK-8221741 [1].
>>
>> The issue is AIX's Xserver was frozen about 25 secs on my local AIX
>> box.
>> According to my problem analysis,
>> In this case, Java tried to load large 11 X11 bitmap fonts via
>> XLoadQueryFont() on Xlib.
>> The situation can emulate by "xlsfonts -ll" command, like:
>>
>> $ time xlsfonts -ll -fn
>> "-monotype-sansmonowt-medium-r-normal--*-80-72-72-*-*-ucs2.cjk_japan-0"
>> ...
>> real 0m2.07s
>> user 0m0.00s
>> sys 0m0.00s
>>
>> One of solution is, Unix's fontconfig.properties can support
>> TrueType/Type1 font name format. [2]
>>
>> Anyway,
>> I don't know the reason why X11 bitmap font is required for logical
>> font.
>> (I don't know how to use X11 bitmap font for physical font.
>> I could not see X11 bitmap font name via
>> GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames().)
>> I just want to fix Xserver frozen issue.
>> I appreciate your advice.
>> (Other solutions are welcome)
>>
>> [1] https://bugs.openjdk.java.net/browse/JDK-8221741
>> [2] https://cr.openjdk.java.net/~itakiguchi/8221741/webrev.00/
>>
>> Thanks,
>> Ichiroh Takiguchi
>> IBM Japan, Ltd.
>>
>> On 2019-04-04 01:09, Philip Race wrote:
>>> On 4/2/19, 9:27 AM, Ichiroh Takiguchi wrote:
>>>> Hello.
>>>> (I am sorry to post it again. Previously, I posted the wrong mailing
>>>> list.)
>>>>
>>>> Could you review the fix ?
>>>>
>>>> Bug: https://bugs.openjdk.java.net/browse/JDK-8221741
>>>> Change: https://cr.openjdk.java.net/~itakiguchi/8221741/webrev.00/
>>>>
>>>> I'd like to obtain a sponsor for this issue.
>>>>
>>>> On AIX platform, fontconfig.properties file is used to pick up
>>>> proper fonts.
>>>> TrueType font settings are written by XLFD format on
>>>> fontconfig.properties file.
>>>>
>>>> On current implementation, Java tries to load X11 bitmap fonts even
>>>> if these are not used.
>>>
>>> I think you need to clarify what you mean here.
>>>
>>> I'd like you to provide a step by step analysis of what happens and
>>> what the effect of your proposed change is on AIX *AND* what it might
>>> mean for other X11 platforms, as I don't have time to reverse
>>> engineer the
>>> reasons for the odd-looking change.
>>> It looks like a hack to short-circuit support your syntax.
>>> Right now I am saying no to this.
>>>
>>>> This font load work is almost name as "xlsfonts -ll".
>>>> It spends many CPU time and memories.
>>>>
>>>> Just font name format should be supported.
>>>
>>> Not clear enough for me.
>>>
>>> -phil.
>>>>
>>>> To SAP representative,
>>>> I have a question about copyright year on
>>>> make/data/fontconfig/aix.fontconfig.properties.
>>>> Please let me know how I should write down copyright year.
>>>>
>>>> Thanks,
>>>> Ichiroh Takiguchi
>>>> IBM Japan, Ltd.
>>>>
>>
More information about the 2d-dev
mailing list