1

So I currently have a fairly large JavaFX application that deals with lots of dynamic data, a lot of which can be in unicode, both characters for languages and random unicode values (like /u0001) are used.

The problem that I have is that on Windows (this hasn't been noticed on either Linux or Mac) some of these values cause the application to crash and completely stop responding.

The crash report (shown below) seems to indicate it's a problem with the font rendering itself but doesn't show where in my application this is happening. I'm currently using JavaFX 2 and packaging the application as an exe bundled with JRE8u05. At this point I'm pretty much out of ideas for how to fix this, so thanks for any suggestions.

ArrayIndexOutOfBoundsException: 0
com.sun.javafx.font.directwrite.DWGlyphLayout.getIndices in DWGlyphLayout.java:198
com.sun.javafx.font.directwrite.DWGlyphLayout.renderShape in DWGlyphLayout.java:401
com.sun.javafx.font.directwrite.DWGlyphLayout.layout in DWGlyphLayout.java:154
com.sun.javafx.text.PrismTextLayout.shape in PrismTextLayout.java:832
com.sun.javafx.text.PrismTextLayout.layout in PrismTextLayout.java:1062
com.sun.javafx.text.PrismTextLayout.ensureLayout in PrismTextLayout.java:221
com.sun.javafx.text.PrismTextLayout.getBounds in PrismTextLayout.java:244
com.sun.javafx.scene.control.skin.Utils.computeTextWidth in Utils.java:112
com.sun.javafx.scene.control.skin.LabeledSkinBase.computeMinLabeledPartWidth in LabeledSkinBase.java:722
com.sun.javafx.scene.control.skin.LabeledSkinBase.computeMinWidth in LabeledSkinBase.java:693
javafx.scene.control.Control.computeMinWidth in Control.java:466
javafx.scene.Parent.minWidth in Parent.java:932
javafx.scene.layout.Region.minWidth in Region.java:1386
javafx.scene.layout.AnchorPane.computeWidth in AnchorPane.java:274
javafx.scene.layout.AnchorPane.computeMinWidth in AnchorPane.java:242
javafx.scene.Parent.minWidth in Parent.java:932
javafx.scene.layout.Region.minWidth in Region.java:1386
com.sun.javafx.scene.control.skin.LabeledSkinBase.layoutLabelInArea in LabeledSkinBase.java:971
com.sun.javafx.scene.control.skin.LabeledSkinBase.layoutLabelInArea in LabeledSkinBase.java:914
com.sun.javafx.scene.control.skin.LabeledSkinBase.layoutChildren in LabeledSkinBase.java:898
javafx.scene.control.Control.layoutChildren in Control.java:574
javafx.scene.Parent.layout in Parent.java:1076
javafx.scene.Parent.layout in Parent.java:1082
javafx.scene.Parent.layout in Parent.java:1082
javafx.scene.Parent.layout in Parent.java:1082
javafx.scene.Parent.layout in Parent.java:1082
javafx.scene.Parent.layout in Parent.java:1082
javafx.scene.Parent.layout in Parent.java:1082
javafx.scene.Parent.layout in Parent.java:1082
javafx.scene.Scene.doLayoutPass in Scene.java:576
javafx.scene.Scene$ScenePulseListener.pulse in Scene.java:2386
com.sun.javafx.tk.Toolkit$3.run in Toolkit.java:321
com.sun.javafx.tk.Toolkit$3.run in Toolkit.java:319
java.security.AccessController.doPrivileged in AccessController.java:-2
com.sun.javafx.tk.Toolkit.runPulse in Toolkit.java:319
com.sun.javafx.tk.Toolkit.firePulse in Toolkit.java:348
com.sun.javafx.tk.quantum.QuantumToolkit.pulse in QuantumToolkit.java:479
com.sun.javafx.tk.quantum.QuantumToolkit.pulse in QuantumToolkit.java:460
com.sun.javafx.tk.quantum.QuantumToolkit$13.run in QuantumToolkit.java:327
com.sun.glass.ui.InvokeLaterDispatcher$Future.run in InvokeLaterDispatcher.java:95
com.sun.glass.ui.win.WinApplication._runLoop in WinApplication.java:-2
com.sun.glass.ui.win.WinApplication.access$300 in WinApplication.java:39
com.sun.glass.ui.win.WinApplication$4$1.run in WinApplication.java:112
java.lang.Thread.run in Thread.java:745
5
  • You can show your code ?
    – Mailkov
    Nov 11, 2014 at 15:40
  • As far as I can tell it's not my code directly, I receive the data from my server as a byte array, and encode that as a string with UTF-8. This resulting string is then displayed using the Label widget. An example of a series of unicode that will cause this crash is: ᎧggI̅I̅ᓆш̈̇ ₍🎀ପϊଓ⁾+✈️ try { mainMessage = new String(message.getMessageBytes(), "UTF-8"); } catch (UnsupportedEncodingException uee) { Log.w(TAG, "Unable to encode message bytes with UTF-8"); mainMessage = new String(message.getMessageBytes()); } myLabel.setText(mainMessage);
    – Boshman
    Nov 12, 2014 at 9:15
  • Can you insert the byte values of message.getMessageBytes() ?
    – Mailkov
    Nov 12, 2014 at 10:26
  • Sorry I'm not quite sure what you mean by 'insert the byte values' I don't have much control over this section of the application, and should just be able to display the byte array as a string.
    – Boshman
    Nov 12, 2014 at 10:48
  • I used the series of unicode ᎧggI̅I̅ᓆш̈̇ ₍🎀ପϊଓ⁾+✈️ with this code: String mainMessage=""; byte[] msg= {}; String unic="ᎧggI̅I̅ᓆш̈̇ ₍🎀ପϊଓ⁾+✈️ "; msg=unic.getBytes(); try { mainMessage = new String(msg, "UTF-8"); } catch (UnsupportedEncodingException uee) { mainMessage = new String(msg); } Label myLabel=new Label(); myLabel.setText(mainMessage); and don't crash.
    – Mailkov
    Nov 12, 2014 at 14:27

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.