Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-92783

Setting LastOutput of a command block to an invalid JSON string causes crash

XMLWordPrintable

    • Unconfirmed

      Duplicated by / duplicates:

      The bug

      When you set the LastOutput tag of a command block to an invalid JSON string the JSON parser throws an uncatched exception. This can in the worst case (FallingSand) lead to a crash of Minecraft.

      How to reproduce

      Item placing

      Item command
      /give @p command_block 1 0 {BlockEntityTag:{LastOutput:"Invalid JSON",TrackOutput:1b}}
      
      Game Output
      [20:33:36] [Server thread/FATAL]: Error executing task
      java.util.concurrent.ExecutionException: com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 1
      	at java.util.concurrent.FutureTask.report(FutureTask.java:122) ~[?:1.8.0_25]
      	at java.util.concurrent.FutureTask.get(FutureTask.java:192) ~[?:1.8.0_25]
      	at g.a(SourceFile:46) [15w46a.jar:?]
      	at net.minecraft.server.MinecraftServer.D(SourceFile:596) [15w46a.jar:?]
      	at net.minecraft.server.MinecraftServer.C(SourceFile:552) [15w46a.jar:?]
      	at bxw.C(SourceFile:154) [15w46a.jar:?]
      	at net.minecraft.server.MinecraftServer.run(SourceFile:456) [15w46a.jar:?]
      	at java.lang.Thread.run(Thread.java:745) [?:1.8.0_25]
      Caused by: com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 1
      	at com.google.gson.internal.Streams.parse(Streams.java:56) ~[gson-2.2.4.jar:?]
      	at com.google.gson.TreeTypeAdapter.read(TreeTypeAdapter.java:54) ~[gson-2.2.4.jar:?]
      	at oc.a(SourceFile:501) ~[15w46a.jar:?]
      	at oc.a(SourceFile:512) ~[15w46a.jar:?]
      	at eu$a.a(SourceFile:205) ~[15w46a.jar:?]
      	at ahc.b(SourceFile:69) ~[15w46a.jar:?]
      	at apq.a(SourceFile:42) ~[15w46a.jar:?]
      	at abv.a(SourceFile:89) ~[15w46a.jar:?]
      	at abv.a(SourceFile:56) ~[15w46a.jar:?]
      	at adk.a(SourceFile:134) ~[15w46a.jar:?]
      	at ls.a(SourceFile:338) ~[15w46a.jar:?]
      	at mb.a(SourceFile:609) ~[15w46a.jar:?]
      	at jg.a(SourceFile:55) ~[15w46a.jar:?]
      	at jg.a(SourceFile:11) ~[15w46a.jar:?]
      	at fh$1.run(SourceFile:13) ~[15w46a.jar:?]
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_25]
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_25]
      	at g.a(SourceFile:45) ~[15w46a.jar:?]
      	... 5 more
      Caused by: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 1
      	at com.google.gson.stream.JsonReader.syntaxError(JsonReader.java:1505) ~[gson-2.2.4.jar:?]
      	at com.google.gson.stream.JsonReader.checkLenient(JsonReader.java:1386) ~[gson-2.2.4.jar:?]
      	at com.google.gson.stream.JsonReader.doPeek(JsonReader.java:572) ~[gson-2.2.4.jar:?]
      	at com.google.gson.stream.JsonReader.peek(JsonReader.java:414) ~[gson-2.2.4.jar:?]
      	at com.google.gson.internal.Streams.parse(Streams.java:42) ~[gson-2.2.4.jar:?]
      	at com.google.gson.TreeTypeAdapter.read(TreeTypeAdapter.java:54) ~[gson-2.2.4.jar:?]
      	at oc.a(SourceFile:501) ~[15w46a.jar:?]
      	at oc.a(SourceFile:512) ~[15w46a.jar:?]
      	at eu$a.a(SourceFile:205) ~[15w46a.jar:?]
      	at ahc.b(SourceFile:69) ~[15w46a.jar:?]
      	at apq.a(SourceFile:42) ~[15w46a.jar:?]
      	at abv.a(SourceFile:89) ~[15w46a.jar:?]
      	at abv.a(SourceFile:56) ~[15w46a.jar:?]
      	at adk.a(SourceFile:134) ~[15w46a.jar:?]
      	at ls.a(SourceFile:338) ~[15w46a.jar:?]
      	at mb.a(SourceFile:609) ~[15w46a.jar:?]
      	at jg.a(SourceFile:55) ~[15w46a.jar:?]
      	at jg.a(SourceFile:11) ~[15w46a.jar:?]
      	at fh$1.run(SourceFile:13) ~[15w46a.jar:?]
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_25]
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_25]
      	at g.a(SourceFile:45) ~[15w46a.jar:?]
      	... 5 more
      

      Setblock

      Setblock command
      /setblock ~ ~1 ~ command_block 0 replace {LastOutput:"Invalid JSON",TrackOutput:1b}
      
      Game Output
      [20:35:36] [Server thread/WARN]: Couldn't process command: 'setblock ~ ~1 ~ command_block 0 replace {LastOutput:"Invalid JSON",TrackOutput:1b}'
      [20:35:36] [Client thread/INFO]: [CHAT] An unknown error occurred while attempting to perform this command
      

      FallingSand summoning (Crash)

      Summon Command
      /summon FallingSand ~ ~1 ~ {Time:1b,Block:"command_block",TileEntityData:{LastOutput:"Invalid JSON",TrackOutput:1b}}
      
      Crash report
      ---- Minecraft Crash Report ----
      // This is a token for 1 free hug. Redeem at your nearest Mojangsta: [~~HUG~~]
      
      Time: 15.11.15 20:37
      Description: Ticking entity
      
      com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 1
      	at com.google.gson.internal.Streams.parse(Streams.java:56)
      	at com.google.gson.TreeTypeAdapter.read(TreeTypeAdapter.java:54)
      	at oc.a(SourceFile:501)
      	at oc.a(SourceFile:512)
      	at eu$a.a(SourceFile:205)
      	at ahc.b(SourceFile:69)
      	at apq.a(SourceFile:42)
      	at xx.m(SourceFile:140)
      	at ahm.a(SourceFile:1480)
      	at lp.a(SourceFile:719)
      	at ahm.g(SourceFile:1458)
      	at ahm.k(SourceFile:1348)
      	at lp.k(SourceFile:552)
      	at net.minecraft.server.MinecraftServer.D(SourceFile:624)
      	at net.minecraft.server.MinecraftServer.C(SourceFile:552)
      	at bxw.C(SourceFile:154)
      	at net.minecraft.server.MinecraftServer.run(SourceFile:456)
      	at java.lang.Thread.run(Thread.java:745)
      Caused by: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 1
      	at com.google.gson.stream.JsonReader.syntaxError(JsonReader.java:1505)
      	at com.google.gson.stream.JsonReader.checkLenient(JsonReader.java:1386)
      	at com.google.gson.stream.JsonReader.doPeek(JsonReader.java:572)
      	at com.google.gson.stream.JsonReader.peek(JsonReader.java:414)
      	at com.google.gson.internal.Streams.parse(Streams.java:42)
      	... 17 more
      
      
      A detailed walkthrough of the error, its code path and all known details is as follows:
      ---------------------------------------------------------------------------------------
      
      -- Head --
      Stacktrace:
      	at com.google.gson.internal.Streams.parse(Streams.java:56)
      	at com.google.gson.TreeTypeAdapter.read(TreeTypeAdapter.java:54)
      	at oc.a(SourceFile:501)
      	at oc.a(SourceFile:512)
      	at eu$a.a(SourceFile:205)
      	at ahc.b(SourceFile:69)
      	at apq.a(SourceFile:42)
      	at xx.m(SourceFile:140)
      	at ahm.a(SourceFile:1480)
      	at lp.a(SourceFile:719)
      	at ahm.g(SourceFile:1458)
      
      -- Entity being ticked --
      Details:
      	Entity Type: FallingSand (xx)
      	Entity ID: 1297472
      	Entity Name: Falling Block
      	Entity's Exact location: -101,50, 57,00, -617,50
      	Entity's Block location: World: (-102,57,-618), Chunk: (at 10,3,6 in -7,-39; contains blocks -112,0,-624 to -97,255,-609), Region: (-1,-2; contains chunks -32,-64 to -1,-33, blocks -512,0,-1024 to -1,255,-513)
      	Entity's Momentum: 0,00, -0,00, 0,00
      	Entity's Passengers: []
      	Entity's Vehicle: ~~ERROR~~ NullPointerException: null
      	Immitating block ID: 137
      	Immitating block data: 0
      Stacktrace:
      	at ahm.k(SourceFile:1348)
      	at lp.k(SourceFile:552)
      
      -- Affected level --
      Details:
      	Level name: End Test
      	All players: 1 total; [lr['Marcono1234'/3, l='End Test', x=-102,24, y=57,02, z=-616,31]]
      	Chunk stats: ServerChunkCache: 625 Drop: 0
      	Level seed: 2631539174541327368
      	Level generator: ID 01 - flat, ver 0. Features enabled: true
      	Level generator options: 3;minecraft:bedrock,3*minecraft:stone,52*minecraft:sandstone;2;
      	Level spawn location: World: (-89,4,-675), Chunk: (at 7,0,13 in -6,-43; contains blocks -96,0,-688 to -81,255,-673), Region: (-1,-2; contains chunks -32,-64 to -1,-33, blocks -512,0,-1024 to -1,255,-513)
      	Level time: 1406728 game time, 1000 day time
      	Level dimension: 0
      	Level storage version: 0x04ABD - Anvil
      	Level weather: Rain time: 5704 (now: false), thunder time: 65724 (now: false)
      	Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: true
      Stacktrace:
      	at net.minecraft.server.MinecraftServer.D(SourceFile:624)
      	at net.minecraft.server.MinecraftServer.C(SourceFile:552)
      	at bxw.C(SourceFile:154)
      	at net.minecraft.server.MinecraftServer.run(SourceFile:456)
      	at java.lang.Thread.run(Thread.java:745)
      
      -- System Details --
      Details:
      	Minecraft Version: 15w46a
      	Operating System: Windows 7 (amd64) version 6.1
      	Java Version: 1.8.0_25, Oracle Corporation
      	Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
      	Memory: 165593936 bytes (157 MB) / 324124672 bytes (309 MB) up to 1060372480 bytes (1011 MB)
      	JVM Flags: 6 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xmx1G -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:-UseAdaptiveSizePolicy -Xmn128M
      	IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
      	Profiler Position: N/A (disabled)
      	Player Count: 1 / 8; [lr['Marcono1234'/3, l='End Test', x=-102,24, y=57,02, z=-616,31]]
      	Type: Integrated Server (map_client.txt)
      	Is Modded: Probably not. Jar signature remains and both client + server brands are untouched.
      

            searge [Mojang] Searge (Michael Stoyke)
            marcono1234 Marcono1234
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: