mojira.dev
MC-139712

Copying one half of unrecognised Unicode character crashes client

When copying a Unicode character into Minecraft that it doesn't know, it comes out as two squares. Example character: 🤦
When trying to copy just one of these squares, Minecraft crashes. Crash log:

---- Minecraft Crash Report ----
// But it works on my machine.

Time: 21/11/18 18:09
Description: keyPressed event handler

java.lang.StringIndexOutOfBoundsException: String index out of range: 1
	at java.lang.String.charAt(String.java:658)
	at org.lwjgl.system.MemoryAccess$MemoryAccessorUnsafe$MemoryTextUtilUnsafe.encodeUTF8(MemoryAccess.java:605)
	at org.lwjgl.system.MemoryAccess$MemoryAccessorUnsafe$MemoryTextUtilUnsafe.encodeUTF8(MemoryAccess.java:578)
	at org.lwjgl.system.MemoryUtil.memUTF8(MemoryUtil.java:1504)
	at org.lwjgl.system.MemoryUtil.memUTF8(MemoryUtil.java:1488)
	at clv.a(SourceFile:26)
	at clv.a(SourceFile:33)
	at cnk.a(SourceFile:507)
	at com.keyPressed(SourceFile:281)
	at cqt.keyPressed(SourceFile:152)
	at cnk.a(SourceFile:391)
	at crq.a(SourceFile:430)
	at cnk.a(SourceFile:389)
	at org.lwjgl.glfw.GLFWKeyCallbackI.callback(GLFWKeyCallbackI.java:37)
	at org.lwjgl.system.JNI.invokeV(Native Method)
	at org.lwjgl.glfw.GLFW.glfwPollEvents(GLFW.java:3029)
	at com.mojang.blaze3d.platform.GLX.pollEvents(SourceFile:223)
	at cnl.d(SourceFile:830)
	at cnl.b(SourceFile:389)
	at net.minecraft.client.main.Main.main(SourceFile:154)


A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- Head --
Thread: Client thread
Stacktrace:
	at java.lang.String.charAt(String.java:658)
	at org.lwjgl.system.MemoryAccess$MemoryAccessorUnsafe$MemoryTextUtilUnsafe.encodeUTF8(MemoryAccess.java:605)
	at org.lwjgl.system.MemoryAccess$MemoryAccessorUnsafe$MemoryTextUtilUnsafe.encodeUTF8(MemoryAccess.java:578)
	at org.lwjgl.system.MemoryUtil.memUTF8(MemoryUtil.java:1504)
	at org.lwjgl.system.MemoryUtil.memUTF8(MemoryUtil.java:1488)
	at clv.a(SourceFile:26)
	at clv.a(SourceFile:33)
	at cnk.a(SourceFile:507)
	at com.keyPressed(SourceFile:281)
	at cqt.keyPressed(SourceFile:152)
	at cnk.a(SourceFile:391)

-- Affected screen --
Details:
	Screen name: cqt
Stacktrace:
	at crq.a(SourceFile:430)
	at cnk.a(SourceFile:389)
	at org.lwjgl.glfw.GLFWKeyCallbackI.callback(GLFWKeyCallbackI.java:37)
	at org.lwjgl.system.JNI.invokeV(Native Method)
	at org.lwjgl.glfw.GLFW.glfwPollEvents(GLFW.java:3029)

-- Affected level --
Details:
	Level name: MpServer
	All players: 1 total; [dbb['FaRo1'/0, l='MpServer', x=-38.00, y=60.00, z=139.36]]
	Chunk stats: MultiplayerChunkCache: 4225, 389
	Level seed: 0
	Level generator: ID 01 - flat, ver 0. Features enabled: false
	Level generator options: {}
	Level spawn location: World: (-4,2,-6), Chunk: (at 12,0,10 in -1,-1; contains blocks -16,0,-16 to -1,255,-1), Region: (-1,-1; contains chunks -32,-32 to -1,-1, blocks -512,0,-512 to -1,255,-1)
	Level time: 26536571 game time, 13000 day time
	Level dimension: 0
	Level storage version: 0x00000 - Unknown?
	Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false)
	Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false
	Forced entities: 1 total; [dbb['FaRo1'/0, l='MpServer', x=-38.00, y=60.00, z=139.36]]
	Retry entities: 0 total; []
	Server brand: vanilla
	Server type: Integrated singleplayer server
Stacktrace:
	at cyy.a(SourceFile:368)
	at cnl.b(SourceFile:1867)
	at cnl.b(SourceFile:397)
	at net.minecraft.client.main.Main.main(SourceFile:154)

-- System Details --
Details:
	Minecraft Version: 18w47a
	Operating System: Linux (amd64) version 4.9.0-8-amd64
	Java Version: 1.8.0_181, Oracle Corporation
	Java VM Version: OpenJDK 64-Bit Server VM (mixed mode), Oracle Corporation
	Memory: 608904792 bytes (580 MB) / 2147483648 bytes (2048 MB) up to 2147483648 bytes (2048 MB)
	JVM Flags: 8 total; -Xss1M -Xmx2G -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M
	Launched Version: 18w47a
	LWJGL: 3.1.6 build 14
	OpenGL: Mesa DRI Intel(R) Kabylake GT2  GL version 3.0 Mesa 13.0.6, Intel Open Source Technology Center
	GL Caps: Using GL 1.3 multitexturing.
Using GL 1.3 texture combiners.
Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported.
Shaders are available because OpenGL 2.1 is supported.
VBOs are available because OpenGL 1.5 is supported.

	Using VBOs: Yes
	Is Modded: Probably not. Jar signature remains and client brand is untouched.
	Type: Client (map_client.txt)
	Resource Packs: vanilla
	Current Language: English (United Kingdom)
	CPU: 7x Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz

Comments 1

The emoji provided is an interesting one, as it consists of somewhere between 1 and 4 codepoints. The possible codepoints included are: 

I would guess that you are copying two of these, it is being interpreted as two codepoints but one character due to Unicode combining, and somewhere in the code it sees two codepoints and looks for the second character. Just my analysis purely from the crash report, hard to tell w/o code analysis or trying out some things in-game.

FaRo1

migrated

Unconfirmed

Minecraft 1.13.2, Minecraft 18w47a

Minecraft 18w49a

Retrieved