A crash occurs when a command that contains selectors or message arguments is executed within a function that is currently in a deep recursion stack (about 100000+ calls). While these two argument types are what I've found so far, I haven't checked every command, so I'm not certain if they are the only ones.
In my case, I encountered this bug in a function that recursively checks the stopwatch value to wait for a certain amount of time. I included a single line of a tellraw command to execute upon exiting the recursion for debugging purposes, and that's what caused the game to crash.
Steps to reproduce the issue:
Create a function that recursively calls itself about 100000 times and executes a specific command (
say end) at the end of the function itself, as shown in the example below. (Alternatively, use the attached datapacktest.zip.)# test:recursion scoreboard objectives add test dummy scoreboard players set #t test 100000 function test:recursion-1# test:recursion-1 scoreboard players remove #t test 1 execute if score #t test matches 0 run say END? execute if score #t test matches 1.. run function test:recursion-1To prevent the function from being blocked by the command execution limit, run
/gamerule maxCommandChainLength 2147483647in the chat.Run the function (
/function test:recursion). A crash should occur. If it doesn't, the number of recursive calls needed to trigger the bug might vary depending on your environment, so try increasing the recursion count.To see if it can also be reproduced with a selector, try replacing the command
say END?with any command that includes a selector, likedata get entity @s
Attachments
Comments 0
No comments.