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

Copying deeply nested NBT causes StackOverflowError

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • 1.19.3 Pre-release 3
    • 1.16.3, 1.16.4 Pre-release 1, 1.16.4, 20w45a, 20w46a, 20w48a, 20w49a, 20w51a, 21w03a, 1.16.5, 21w05b, 21w08b, 21w10a, 21w11a, 21w13a, 21w15a, 21w16a, 21w19a, 1.17 Pre-release 1, 1.17, 1.17.1, 21w37a, 1.18.1, 22w03a, 22w05a, 1.18.2 Pre-release 1, 1.18.2, 22w11a, 22w12a, 1.19 Release Candidate 2, 1.19, 1.19.2
    • Confirmed
    • Crash
    • Very Important

    Description

      The bug

      Unlike NBT loading, NBT copying does not have an upper bound for depth. For this reason, copying deeply nested NBT may cause java.lang.StackOverflowError or create an unloadable NBT whose depth is more than 512.

      How to reproduce

      1. /data modify storage mc-201769: : set value {}
      2. Run the following command using a repeating command block
        data modify storage mc-201769: :.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.: set from storage mc-201769: :

        Eventually, the game crashes due to java.lang.StackOverflowError.

      Attachments

        Issue Links

          Activity

            People

              panda4994 [Mojang] Panda
              intsuc intsuc
              Votes:
              13 Vote for this issue
              Watchers:
              13 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                CHK: