JDK-8234473 : Emoji crashes JavaFX GUI
  • Type: Bug
  • Component: javafx
  • Sub-Component: graphics
  • Affected Version: openjfx11
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: linux
  • CPU: x86_64
  • Submitted: 2019-11-17
  • Updated: 2019-12-05
  • Resolved: 2019-12-05
Related Reports
Duplicate :  
Description
ADDITIONAL SYSTEM INFORMATION :
Debian Linux 10, OpenJDK 11.0.5

A DESCRIPTION OF THE PROBLEM :
Pasting an emoji such as U+1F4A5 ("��������") into a JavaFX TextField or displaying it in a Label causes various combinations of freezing and graphics corruption.

This has so far only been observed on Linux (various distributions: Arch, Debian, Fedora) in Java versions ranging from 11 to 14.

Prior discussion: https://github.com/javafxports/openjdk-jfx/issues/287

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Launch a JavaFX application that contains a TextField
2. Paste an emoji such as �������� into the text field

(Alternative: Launch a JavaFX application with a Label that contains that character.)

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Emoji displays as a character, with or without color (I'm not picky)
ACTUAL -
The application either freezes entirely, or displays various graphics glitches, including blacking out or copying and vertical inversion of Nodes.

The application also emits a number of stack traces like this (middle trimmed):

java.lang.ArrayIndexOutOfBoundsException: Index -21 out of bounds for length 32
	at com.sun.prism.impl.GlyphCache.getCachedGlyph(GlyphCache.java:332)
	at com.sun.prism.impl.GlyphCache.render(GlyphCache.java:148)
	at com.sun.prism.impl.ps.BaseShaderGraphics.drawString(BaseShaderGraphics.java:2101)
	at com.sun.javafx.sg.prism.NGText.renderText(NGText.java:312)
	at com.sun.javafx.sg.prism.NGText.renderContent2D(NGText.java:270)
	at com.sun.javafx.sg.prism.NGShape.renderContent(NGShape.java:261)
	at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:2072)
	at com.sun.javafx.sg.prism.NGNode.render(NGNode.java:1964)
        [...trimmed...]
	at com.sun.javafx.sg.prism.NGNode.renderForClip(NGNode.java:2313)
	at com.sun.javafx.sg.prism.NGNode.renderRectClip(NGNode.java:2207)
	at com.sun.javafx.sg.prism.NGNode.renderClip(NGNode.java:2233)
	at com.sun.javafx.sg.prism.CacheFilter.renderNodeToCache(CacheFilter.java:683)
	at com.sun.javafx.sg.prism.CacheFilter.render(CacheFilter.java:587)
	at com.sun.javafx.sg.prism.NGNode.renderCached(NGNode.java:2377)
	at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:2063)
	at com.sun.javafx.sg.prism.NGNode.render(NGNode.java:1964)
	at com.sun.javafx.sg.prism.NGGroup.renderContent(NGGroup.java:270)
	at com.sun.javafx.sg.prism.NGRegion.renderContent(NGRegion.java:578)
	at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:2072)
	at com.sun.javafx.sg.prism.NGNode.render(NGNode.java:1964)
	at com.sun.javafx.sg.prism.NGGroup.renderContent(NGGroup.java:270)
	at com.sun.javafx.sg.prism.NGRegion.renderContent(NGRegion.java:578)
	at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:2072)
	at com.sun.javafx.sg.prism.NGNode.render(NGNode.java:1964)
	at com.sun.javafx.tk.quantum.ViewPainter.doPaint(ViewPainter.java:479)
	at com.sun.javafx.tk.quantum.ViewPainter.paintImpl(ViewPainter.java:321)
	at com.sun.javafx.tk.quantum.PresentingPainter.run(PresentingPainter.java:91)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
	at com.sun.javafx.tk.RenderJob.run(RenderJob.java:58)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125)
	at java.base/java.lang.Thread.run(Thread.java:834)

---------- BEGIN SOURCE ----------
Full source and execution instructions here: https://gitlab.com/timmc/sscce-javafx-emoji-crash

Core code:

    public void start(Stage primaryStage) {
        TextField textField = new TextField();
        textField.setText("Paste emoji here (e.g. U+1F4A5)"); // ��������
        primaryStage.setScene(new Scene(new StackPane(textField)));
        primaryStage.show();
    }

---------- END SOURCE ----------

FREQUENCY : always



Comments
I am not able to reproduce this. I have tried running the app on Ubuntu 18.04 (works fine), Ubuntu 19.10 (doesn't render anything, but doesn't throw the exception), and Oracle Linux 7 (works fine). It might be dependent on installed fonts or something else in the platform configuration.
05-12-2019