Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-5476

Trading a Villager with a blank trade crashes the server

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • None
    • None
    • CraftBukkit version git-Spigot-05bb8bc-8073dbe (MC: 1.15.1) (Implementing API version 1.15.1-R0.1-SNAPSHOT)
    • Yes

      Upon clicking a blank trade in a Villagers trade list, the server will immediately crash.

      ---- Minecraft Crash Report ----
      // Hey, that tickles! Hehehe!Time: 12/23/19, 3:09 PM
      Description: Exception in server tick loopjava.lang.AssertionError: TRAP
      	at net.minecraft.server.v1_15_R1.ItemStack.checkEmpty(ItemStack.java:86)
      	at net.minecraft.server.v1_15_R1.ItemStack.setCount(ItemStack.java:864)
      	at net.minecraft.server.v1_15_R1.MerchantRecipe.getBuyItem1(MerchantRecipe.java:93)
      	at net.minecraft.server.v1_15_R1.ContainerMerchant.g(ContainerMerchant.java:170)
      	at net.minecraft.server.v1_15_R1.PlayerConnection.a(PlayerConnection.java:747)
      	at net.minecraft.server.v1_15_R1.PacketPlayInTrSel.a(SourceFile:30)
      	at net.minecraft.server.v1_15_R1.PacketPlayInTrSel.a(SourceFile:8)
      	at net.minecraft.server.v1_15_R1.PlayerConnectionUtils.lambda$0(PlayerConnectionUtils.java:19)
      	at net.minecraft.server.v1_15_R1.TickTask.run(SourceFile:18)
      	at net.minecraft.server.v1_15_R1.IAsyncTaskHandler.executeTask(SourceFile:144)
      	at net.minecraft.server.v1_15_R1.IAsyncTaskHandlerReentrant.executeTask(SourceFile:23)
      	at net.minecraft.server.v1_15_R1.IAsyncTaskHandler.executeNext(SourceFile:118)
      	at net.minecraft.server.v1_15_R1.MinecraftServer.aZ(MinecraftServer.java:917)
      	at net.minecraft.server.v1_15_R1.MinecraftServer.executeNext(MinecraftServer.java:910)
      	at net.minecraft.server.v1_15_R1.IAsyncTaskHandler.awaitTasks(SourceFile:127)
      	at net.minecraft.server.v1_15_R1.MinecraftServer.sleepForTick(MinecraftServer.java:894)
      	at net.minecraft.server.v1_15_R1.MinecraftServer.run(MinecraftServer.java:827)
      	at java.base/java.lang.Thread.run(Thread.java:834)
      A detailed walkthrough of the error, its code path and all known details is as follows:
      ----------------------------------------------------------------------------------------- System Details --
      Details:
      	Minecraft Version: 1.15.1
      	Minecraft Version ID: 1.15.1
      	Operating System: Windows 10 (amd64) version 10.0
      	Java Version: 11.0.4, Oracle Corporation
      	Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
      	Memory: 1085516000 bytes (1035 MB) / 2826960896 bytes (2696 MB) up to 10737418240 bytes (10240 MB)
      	CPUs: 8
      	JVM Flags: 1 total; -Xmx10G
      	CraftBukkit Information: 
         Running: CraftBukkit version git-Spigot-05bb8bc-8073dbe (MC: 1.15.1) (Implementing API version 1.15.1-R0.1-SNAPSHOT) true
         Plugins: {}
         Warnings: DEFAULT
         Reload Count: 0
         Threads: { WAITING chunk IO worker: [[email protected]/jdk.internal.misc.Unsafe.park(Native Method), [email protected]/java.util.concurrent.locks.LockSupport.park(LockSupport.java:194), app//net.minecraft.server.v1_15_R1.IOWorker.c(SourceFile:124), app//net.minecraft.server.v1_15_R1.IOWorker.d(SourceFile:134), app//net.minecraft.server.v1_15_R1.IOWorker$$Lambda$2248/0x00000008008bfc40.run(Unknown Source), [email protected]/java.lang.Thread.run(Thread.java:834)], RUNNABLE Signal Dispatcher: [], WAITING poi IO worker: [[email protected]/jdk.internal.misc.Unsafe.park(Native Method), [email protected]/java.util.concurrent.locks.LockSupport.park(LockSupport.java:194), app//net.minecraft.server.v1_15_R1.IOWorker.c(SourceFile:124), app//net.minecraft.server.v1_15_R1.IOWorker.d(SourceFile:134), app//net.minecraft.server.v1_15_R1.IOWorker$$Lambda$2248/0x00000008008bfc40.run(Unknown Source), [email protected]/java.lang.Thread.run(Thread.java:834)], WAITING Server-Worker-2: [[email protected]/jdk.internal.misc.Unsafe.park(Native Method), [email protected]/java.util.concurrent.locks.LockSupport.park(LockSupport.java:194), [email protected]/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1628), [email protected]/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)], WAITING Server-Worker-8: [[email protected]/jdk.internal.misc.Unsafe.park(Native Method), [email protected]/java.util.concurrent.locks.LockSupport.park(LockSupport.java:194), [email protected]/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1628), [email protected]/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)], RUNNABLE Server console handler: [app//org.fusesource.jansi.internal.Kernel32.ReadConsoleInputW(Native Method), app//org.fusesource.jansi.internal.Kernel32.readConsoleInputHelper(Kernel32.java:761), app//org.fusesource.jansi.internal.Kernel32.readConsoleKeyInput(Kernel32.java:794), app//org.fusesource.jansi.internal.WindowsSupport.readConsoleInput(WindowsSupport.java:97), app//org.bukkit.craftbukkit.libs.jline.WindowsTerminal.readConsoleInput(WindowsTerminal.java:215), app//org.bukkit.craftbukkit.libs.jline.WindowsTerminal.access$000(WindowsTerminal.java:55), app//org.bukkit.craftbukkit.libs.jline.WindowsTerminal$1.read(WindowsTerminal.java:157), app//org.bukkit.craftbukkit.libs.jline.internal.NonBlockingInputStream.read(NonBlockingInputStream.java:169), app//org.bukkit.craftbukkit.libs.jline.internal.NonBlockingInputStream.read(NonBlockingInputStream.java:137), app//org.bukkit.craftbukkit.libs.jline.internal.NonBlockingInputStream.read(NonBlockingInputStream.java:246), app//org.bukkit.craftbukkit.libs.jline.internal.InputStreamReader.read(InputStreamReader.java:261), app//org.bukkit.craftbukkit.libs.jline.internal.InputStreamReader.read(InputStreamReader.java:198), app//org.bukkit.craftbukkit.libs.jline.console.ConsoleReader.readCharacter(ConsoleReader.java:2145), app//org.bukkit.craftbukkit.libs.jline.console.ConsoleReader.readLine(ConsoleReader.java:2349), app//net.minecraft.server.v1_15_R1.DedicatedServer$2.run(DedicatedServer.java:95)], WAITING Server-Worker-7: [[email protected]/jdk.internal.misc.Unsafe.park(Native Method), [email protected]/java.util.concurrent.locks.LockSupport.park(LockSupport.java:194), [email protected]/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1628), [email protected]/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)], RUNNABLE Netty Server IO #1: [[email protected]/sun.nio.ch.WindowsSelectorImpl$SubSelector.poll0(Native Method), [email protected]/sun.nio.ch.WindowsSelectorImpl$SubSelector.poll(WindowsSelectorImpl.java:339), [email protected]/sun.nio.ch.WindowsSelectorImpl.doSelect(WindowsSelectorImpl.java:167), [email protected]/sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:124), [email protected]/sun.nio.ch.SelectorImpl.select(SelectorImpl.java:136), app//io.netty.channel.nio.NioEventLoop.select(NioEventLoop.java:756), app//io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:411), app//io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:884), [email protected]/java.lang.Thread.run(Thread.java:834)], WAITING Server-Worker-5: [[email protected]/jdk.internal.misc.Unsafe.park(Native Method), [email protected]/java.util.concurrent.locks.LockSupport.park(LockSupport.java:194), [email protected]/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1628), [email protected]/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)], RUNNABLE Server thread: [[email protected]/java.lang.Thread.dumpThreads(Native Method), [email protected]/java.lang.Thread.getAllStackTraces(Thread.java:1657), app//org.bukkit.craftbukkit.v1_15_R1.CraftCrashReport.call(CraftCrashReport.java:33), app//net.minecraft.server.v1_15_R1.CrashReportSystemDetails.a(SourceFile:79), app//net.minecraft.server.v1_15_R1.CrashReport.h(CrashReport.java:71), app//net.minecraft.server.v1_15_R1.CrashReport.<init>(CrashReport.java:35), app//net.minecraft.server.v1_15_R1.MinecraftServer.run(MinecraftServer.java:848), [email protected]/java.lang.Thread.run(Thread.java:834)], WAITING chunk IO worker: [[email protected]/jdk.internal.misc.Unsafe.park(Native Method), [email protected]/java.util.concurrent.locks.LockSupport.park(LockSupport.java:194), app//net.minecraft.server.v1_15_R1.IOWorker.c(SourceFile:124), app//net.minecraft.server.v1_15_R1.IOWorker.d(SourceFile:134), app//net.minecraft.server.v1_15_R1.IOWorker$$Lambda$2248/0x00000008008bfc40.run(Unknown Source), [email protected]/java.lang.Thread.run(Thread.java:834)], WAITING NonBlockingInputStreamThread: [[email protected]/java.lang.Object.wait(Native Method), app//org.bukkit.craftbukkit.libs.jline.internal.NonBlockingInputStream.run(NonBlockingInputStream.java:278), [email protected]/java.lang.Thread.run(Thread.java:834)], WAITING Server-Worker-3: [[email protected]/jdk.internal.misc.Unsafe.park(Native Method), [email protected]/java.util.concurrent.locks.LockSupport.park(LockSupport.java:194), [email protected]/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1628), [email protected]/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)], RUNNABLE Netty Server IO #0: [[email protected]/sun.nio.ch.WindowsSelectorImpl$SubSelector.poll0(Native Method), [email protected]/sun.nio.ch.WindowsSelectorImpl$SubSelector.poll(WindowsSelectorImpl.java:339), [email protected]/sun.nio.ch.WindowsSelectorImpl.doSelect(WindowsSelectorImpl.java:167), [email protected]/sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:124), [email protected]/sun.nio.ch.SelectorImpl.select(SelectorImpl.java:136), app//io.netty.channel.nio.NioEventLoop.select(NioEventLoop.java:756), app//io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:411), app//io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:884), [email protected]/java.lang.Thread.run(Thread.java:834)], TIMED_WAITING Spigot Watchdog Thread: [[email protected]/java.lang.Thread.sleep(Native Method), app//org.spigotmc.WatchdogThread.run(WatchdogThread.java:102)], TIMED_WAITING Common-Cleaner: [[email protected]/java.lang.Object.wait(Native Method), [email protected]/java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:155), [email protected]/jdk.internal.ref.CleanerImpl.run(CleanerImpl.java:148), [email protected]/java.lang.Thread.run(Thread.java:834), [email protected]/jdk.internal.misc.InnocuousThread.run(InnocuousThread.java:134)], TIMED_WAITING ObjectCleanerThread: [[email protected]/java.lang.Object.wait(Native Method), [email protected]/java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:155), app//io.netty.util.internal.ObjectCleaner$1.run(ObjectCleaner.java:54), app//io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30), [email protected]/java.lang.Thread.run(Thread.java:834)], RUNNABLE Attach Listener: [], WAITING Snooper Timer: [[email protected]/java.lang.Object.wait(Native Method), [email protected]/java.lang.Object.wait(Object.java:328), [email protected]/java.util.TimerThread.mainLoop(Timer.java:527), [email protected]/java.util.TimerThread.run(Timer.java:506)], TIMED_WAITING Spigot Metrics Thread: [[email protected]/java.lang.Object.wait(Native Method), [email protected]/java.util.TimerThread.mainLoop(Timer.java:553), [email protected]/java.util.TimerThread.run(Timer.java:506)], WAITING chunk IO worker: [[email protected]/jdk.internal.misc.Unsafe.park(Native Method), [email protected]/java.util.concurrent.locks.LockSupport.park(LockSupport.java:194), app//net.minecraft.server.v1_15_R1.IOWorker.c(SourceFile:124), app//net.minecraft.server.v1_15_R1.IOWorker.d(SourceFile:134), app//net.minecraft.server.v1_15_R1.IOWorker$$Lambda$2248/0x00000008008bfc40.run(Unknown Source), [email protected]/java.lang.Thread.run(Thread.java:834)], TIMED_WAITING Server-Worker-4: [[email protected]/jdk.internal.misc.Unsafe.park(Native Method), [email protected]/java.util.concurrent.locks.LockSupport.parkUntil(LockSupport.java:275), [email protected]/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1619), [email protected]/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)], WAITING TerminalConsoleWriter: [app//org.bukkit.craftbukkit.libs.jline.console.ConsoleReader.print(ConsoleReader.java:3440), app//org.bukkit.craftbukkit.libs.jline.console.ConsoleReader.print(ConsoleReader.java:3458), app//org.bukkit.craftbukkit.libs.jline.console.ConsoleReader.drawLine(ConsoleReader.java:599), app//org.bukkit.craftbukkit.v1_15_R1.util.TerminalConsoleWriterThread.run(TerminalConsoleWriterThread.java:44)], TIMED_WAITING Server Infinisleeper: [[email protected]/java.lang.Thread.sleep(Native Method), app//net.minecraft.server.v1_15_R1.DedicatedServer$1.run(DedicatedServer.java:69)], WAITING poi IO worker: [[email protected]/jdk.internal.misc.Unsafe.park(Native Method), [email protected]/java.util.concurrent.locks.LockSupport.park(LockSupport.java:194), app//net.minecraft.server.v1_15_R1.IOWorker.c(SourceFile:124), app//net.minecraft.server.v1_15_R1.IOWorker.d(SourceFile:134), app//net.minecraft.server.v1_15_R1.IOWorker$$Lambda$2248/0x00000008008bfc40.run(Unknown Source), [email protected]/java.lang.Thread.run(Thread.java:834)], RUNNABLE DestroyJavaVM: [], RUNNABLE Reference Handler: [[email protected]/java.lang.ref.Reference.waitForReferencePendingList(Native Method), [email protected]/java.lang.ref.Reference.processPendingReferences(Reference.java:241), [email protected]/java.lang.ref.Reference$ReferenceHandler.run(Reference.java:213)], WAITING Server-Worker-1: [[email protected]/jdk.internal.misc.Unsafe.park(Native Method), [email protected]/java.util.concurrent.locks.LockSupport.park(LockSupport.java:194), [email protected]/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1628), [email protected]/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)], WAITING poi IO worker: [[email protected]/jdk.internal.misc.Unsafe.park(Native Method), [email protected]/java.util.concurrent.locks.LockSupport.park(LockSupport.java:194), app//net.minecraft.server.v1_15_R1.IOWorker.c(SourceFile:124), app//net.minecraft.server.v1_15_R1.IOWorker.d(SourceFile:134), app//net.minecraft.server.v1_15_R1.IOWorker$$Lambda$2248/0x00000008008bfc40.run(Unknown Source), [email protected]/java.lang.Thread.run(Thread.java:834)], WAITING Finalizer: [[email protected]/java.lang.Object.wait(Native Method), [email protected]/java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:155), [email protected]/java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:176), [email protected]/java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:170)],}
         Recent tasks from 2812-2842{}
         Force Loaded Chunks: { world: {}, world_nether: {}, world_the_end: {},}
      	Player Count: 1 / 50; [EntityPlayer['Puremin0rez'/244, l='world', x=45.16, y=73.00, z=58.63](Puremin0rez at 45.1590988550724,73.0,58.63390112146572)]
      	Data Packs: vanilla, file/bukkit
      	Is Modded: Definitely; Server brand changed to 'Spigot'
      	Type: Dedicated Server (map_server.txt)
      

      The crash is very easy to reproduce, use the following command to summon a Villager with blank trades, and then trade with him and select the blank trade in the list:

      /summon minecraft:villager ~ ~ ~ {NoAI:1,Offers:{Recipes:[{}]}}
      

      This crash did not occur in Spigot 1.14.4 and earlier, and it does not occur in vanilla (SP/MP) 1.15.1.

      I have attached a crash report and video of it occurring.

      Will this be the last we see of TRAP? The world may never know.

            Unassigned Unassigned
            Puremin0rez Dylan Xaldin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: