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

StackOverflowError when using /stop with player logged in


    • Icon: Bug Bug
    • Resolution: Fixed
    • 22w03a
    • Minecraft 19w03b, Minecraft 19w13b, Minecraft 1.14 Pre-Release 5, Minecraft 1.14, Minecraft 1.14.2 Pre-Release 4, 20w13b, 21w07a, 1.17.1, 1.18.1
    • None
    • Confirmed
    • Networking
    • Important
    • Platform

      When using /stop (or the server crashes) with a player logged in, there is a high chance that a stack overflow error occurs.


      This is because a move (or other packet) attempts to get queued from the network thread for processing by the server thread.

       The network thread then checks if it is the main thread.  It is not, so it queues it for processing.

      The task handler then checks if it is not the main thread. The issue lies in that these checks are not symmetrical. The not main thread check also checks if a /stop has been issued. If it has, then it attempts to execute the queued task immediately.  This causes the code to jump back to *** and eventually stack overflow.

       Unfortunately I don't have a clean stack trace, but the logic checks out...

            Unassigned Unassigned
            md_5 [Mod] md_5
            15 Vote for this issue
            12 Start watching this issue