JDK-4434668 : Crash on fonts in headless mode - Solaris only, build 58
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 1.4.0
  • Priority: P1
  • Status: Closed
  • Resolution: Fixed
  • OS: solaris_8
  • CPU: sparc
  • Submitted: 2001-04-05
  • Updated: 2001-05-03
  • Resolved: 2001-04-24
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 Availability Release.

To download the current JDK release, click here.
Other
1.4.0 betaFixed
Related Reports
Relates :  
Relates :  
Description
The enclosed tests (see attached tar file) crash in font related code
while in headless mode on Solaris.  On Win2k there is no crash, and there is
no crash if run on Solaris not in headless mode.  I have not tested this
on Linux.  These test ran perfectly on Solaris with build 57, and are 
crashing on build 58.

Each test does some rendering into a BufferedImage, and this BufferedImage
is written to a disk file using ImageIO.

It crashes with both:

HEADLESS="-Djava.awt.headless=true -Djava.awt.headlesslib=true"
and
HEADLESS="-Djava.awt.headless=true"

In the attached files, unpack the tar.gz, cd bug, then type make.
Once it's built, type ./runit.

There are two slightly different crashes as shown below.  I notice that
both are crashing in XLoadQueryFont and this is a no-no for headless code.
A lot more of my test cases crash than these two, but the stack traces all
boil down to these two examples.


dherron@tokyojoe:/home/dherron/work/headless/Headless( 27 )% showrev -p
Patch: 109279-08 Obsoletes: 109048-06, 110180-01 Requires:  Incompatibles:  Packages: SUNWcsu, SUNWcsr, SUNWcarx, SUNWcsxu, SUNWhea, SUNWmdb, SUNWmdbx
Patch: 109740-03 Obsoletes: 109056-01, 110196-01 Requires:  Incompatibles:  Packages: SUNWcsr, SUNWcarx
Patch: 109742-02 Obsoletes: 109052-01 Requires:  Incompatibles:  Packages: SUNWcsr, SUNWcarx
Patch: 108652-28 Obsoletes:  Requires:  Incompatibles:  Packages: SUNWxwfnt, SUNWxwice, SUNWxwplt, SUNWxwicx, SUNWxwplx, SUNWxwdxm, SUNWxwinc, SUNWxwman, SUNWxwpmn, SUNWxwslb
Patch: 108940-07 Obsoletes:  Requires:  Incompatibles:  Packages: SUNWmfrun, SUNWdtbax
Patch: 108921-06 Obsoletes:  Requires:  Incompatibles:  Packages: SUNWdtwm


============== TextLayout

An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : 11 occurred at PC=0xF3FABA30
Function=XLoadQueryFont+0x4
Library=/usr/openwin/lib/libX11.so.4

Current Java thread:
        at sun.awt.font.NativeFontWrapper.getFontMetrics(Native Method)
        - locked <f8a04d18> (a java.lang.Class)
        at java.awt.Font.defaultLineMetrics(Font.java:1358)
        at java.awt.Font.getLineMetrics(Font.java:1425)
        at java.awt.font.TextLayout.fastInit(TextLayout.java:544)
        at java.awt.font.TextLayout.<init>(TextLayout.java:344)
        at headless.image.ACimages.render(ACimages.java:85)
        at headless.bit.Main.renderTest(Main.java:30)
        at headless.util.TestMain.runTest(TestMain.java:146)
        at headless.bit.Main.main(Main.java:45)

Dynamic libraries:
0x10000         /usr/local/java/jdk1.4/solsparc/bin/../bin/sparc/native_threads/java
0xff360000      /usr/lib/libthread.so.1
0xff3a0000      /usr/lib/libdl.so.1
0xff280000      /usr/lib/libc.so.1
0xff270000      /usr/platform/SUNW,Ultra-5_10/lib/libc_psr.so.1
0xfe400000      /net/jdk.eng/export/disk6/promoted/jdk/1.4/beta/b58/binaries/solsparc/jre/lib/sparc/client/libjvm.so
0xff210000      /usr/lib/libCrun.so.1
0xff1f0000      /usr/lib/libsocket.so.1
0xff100000      /usr/lib/libnsl.so.1
0xff1c0000      /usr/lib/libm.so.1
0xff240000      /usr/lib/libw.so.1
0xff0d0000      /usr/lib/libmp.so.2
0xff0a0000      /net/jdk.eng/export/disk6/promoted/jdk/1.4/beta/b58/binaries/solsparc/jre/lib/sparc/native_threads/libhpi.so
0xff070000      /net/jdk.eng/export/disk6/promoted/jdk/1.4/beta/b58/binaries/solsparc/jre/lib/sparc/libverify.so
0xff020000      /net/jdk.eng/export/disk6/promoted/jdk/1.4/beta/b58/binaries/solsparc/jre/lib/sparc/libjava.so
0xfe7e0000      /net/jdk.eng/export/disk6/promoted/jdk/1.4/beta/b58/binaries/solsparc/jre/lib/sparc/libzip.so
0xfa880000      /net/jdk.eng/export/disk6/promoted/jdk/1.4/beta/b58/binaries/solsparc/jre/lib/sparc/libawt.so
0xf4280000      /usr/local/java/jdk1.4/solsparc/bin/../jre/lib/sparc/libmlib_image.so
0xfaad0000      /net/jdk.eng/export/disk6/promoted/jdk/1.4/beta/b58/binaries/solsparc/jre/lib/sparc/headless/libmawt.so
0xf4080000      /usr/lib/libXm.so.3
0xfa810000      /usr/openwin/lib/libXt.so.4
0xfaa90000      /usr/openwin/lib/libXext.so.0
0xfa9e0000      /usr/openwin/lib/libXtst.so.1
0xf3f80000      /usr/openwin/lib/libX11.so.4
0xfa9c0000      /usr/openwin/lib/libSM.so.6
0xfa990000      /usr/openwin/lib/libICE.so.6
0xf47c0000      /usr/openwin/lib/libdga.so.1
0xf46b0000      /net/jdk.eng/export/disk6/promoted/jdk/1.4/beta/b58/binaries/solsparc/jre/lib/sparc/libcmm.so
0xf45b0000      /net/jdk.eng/export/disk6/promoted/jdk/1.4/beta/b58/binaries/solsparc/jre/lib/sparc/libjpeg.so
0xf44d0000      /net/jdk.eng/export/disk6/promoted/jdk/1.4/beta/b58/binaries/solsparc/jre/lib/sparc/libnet.so
0xf4690000      /usr/lib/nss_files.so.1
0xf4590000      /usr/lib/nss_nis.so.1
0xf3d80000      /net/jdk.eng/export/disk6/promoted/jdk/1.4/beta/b58/binaries/solsparc/jre/lib/sparc/libfontmanager.so

Local Time = Wed Apr  4 18:49:41 2001
Elapsed Time = 10
#
# The exception above was detected in native code outside the VM
#
# Java VM: Java HotSpot(TM) Client VM (1.4.0-beta-b58 mixed mode)
#
# An error report file has been saved as hs_err_pid582.log.
# Please refer to the file for further information.
#
Abort


============= drawString

An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : 11 occurred at PC=0xF3FABA30
Function=XLoadQueryFont+0x4
Library=/usr/openwin/lib/libX11.so.4

Current Java thread:
        at sun.awt.font.GlyphList.setupStringData(Native Method)
        at sun.awt.font.GlyphList.setFromString(GlyphList.java:104)
        - locked <f8953ce8> (a java.lang.Class)
        at sun.java2d.pipe.GlyphListPipe.drawString(GlyphListPipe.java:49)
        at sun.java2d.SunGraphics2D.drawString(SunGraphics2D.java:2982)
        at headless.image.Append.render(Append.java:61)
        at headless.bit.Main.renderTest(Main.java:30)
        at headless.util.TestMain.runTest(TestMain.java:146)
        at headless.bit.Main.main(Main.java:45)

Dynamic libraries:
0x10000         /usr/local/java/jdk1.4/solsparc/bin/../bin/sparc/native_threads/java
0xff360000      /usr/lib/libthread.so.1
0xff3a0000      /usr/lib/libdl.so.1
0xff280000      /usr/lib/libc.so.1
0xff270000      /usr/platform/SUNW,Ultra-5_10/lib/libc_psr.so.1
0xfe400000      /net/jdk.eng/export/disk6/promoted/jdk/1.4/beta/b58/binaries/solsparc/jre/lib/sparc/client/libjvm.so
0xff210000      /usr/lib/libCrun.so.1
0xff1f0000      /usr/lib/libsocket.so.1
0xff100000      /usr/lib/libnsl.so.1
0xff1c0000      /usr/lib/libm.so.1
0xff240000      /usr/lib/libw.so.1
0xff0d0000      /usr/lib/libmp.so.2
0xff0a0000      /net/jdk.eng/export/disk6/promoted/jdk/1.4/beta/b58/binaries/solsparc/jre/lib/sparc/native_threads/libhpi.so
0xff070000      /net/jdk.eng/export/disk6/promoted/jdk/1.4/beta/b58/binaries/solsparc/jre/lib/sparc/libverify.so
0xff020000      /net/jdk.eng/export/disk6/promoted/jdk/1.4/beta/b58/binaries/solsparc/jre/lib/sparc/libjava.so
0xfe7e0000      /net/jdk.eng/export/disk6/promoted/jdk/1.4/beta/b58/binaries/solsparc/jre/lib/sparc/libzip.so
0xfa880000      /net/jdk.eng/export/disk6/promoted/jdk/1.4/beta/b58/binaries/solsparc/jre/lib/sparc/libawt.so
0xf4280000      /usr/local/java/jdk1.4/solsparc/bin/../jre/lib/sparc/libmlib_image.so
0xfaad0000      /net/jdk.eng/export/disk6/promoted/jdk/1.4/beta/b58/binaries/solsparc/jre/lib/sparc/headless/libmawt.so
0xf4080000      /usr/lib/libXm.so.3
0xfa810000      /usr/openwin/lib/libXt.so.4
0xfaa90000      /usr/openwin/lib/libXext.so.0
0xfa9e0000      /usr/openwin/lib/libXtst.so.1
0xf3f80000      /usr/openwin/lib/libX11.so.4
0xfa9c0000      /usr/openwin/lib/libSM.so.6
0xfa990000      /usr/openwin/lib/libICE.so.6
0xf47c0000      /usr/openwin/lib/libdga.so.1
0xf3e80000      /net/jdk.eng/export/disk6/promoted/jdk/1.4/beta/b58/binaries/solsparc/jre/lib/sparc/libfontmanager.so

Local Time = Wed Apr  4 18:49:44 2001
Elapsed Time = 2
#
# The exception above was detected in native code outside the VM
#
# Java VM: Java HotSpot(TM) Client VM (1.4.0-beta-b58 mixed mode)
#
# An error report file has been saved as hs_err_pid599.log.
# Please refer to the file for further information.
#
Abort


Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: merlin-beta FIXED IN: merlin-beta merlin-beta2 INTEGRATED IN: merlin-beta merlin-beta2 VERIFIED IN: merlin-beta
14-06-2004

SUGGESTED FIX ------- fontObject.cpp ------- *** /tmp/d4.aiz4 Fri Apr 6 14:21:15 2001 --- fontObject.cpp Fri Apr 6 14:02:02 2001 *************** *** 1878,1884 **** // require hints in the font file // require recognition by native system ! if (!isAntiAliased && !usesFractionalMetrics) { if (ttContainsHintsTable(this)) { Strike *theStrike = --- 1878,1884 ---- // require hints in the font file // require recognition by native system ! if (!isAntiAliased && !usesFractionalMetrics && !AWTIsHeadless()) { if (ttContainsHintsTable(this)) { Strike *theStrike =
11-06-2004

EVALUATION Probably another duplicate. eric.hawkes@eng 2001-04-05 This is not quite a duplicate. This crash occurs in both build 58 as well as the latest AWT build (build 59), though I would imagine the crash occurs for different reasons in both 58 vs. 59. In build 59, we are not registering a native nrFontScaler in headless mode. Portions of the code that are reliant on the presence of this object are making incorrect assumptions about it, which cause the crash (in this case, a Strike C++ object is being dereferenced when it is NULL). I am checking with Phil Race about what the best course of action is. michael.martak@Eng 2001-04-06
06-04-2001