I’ve already filed a bug report (case 1264111)
What happened
Editor/game crashes on recursive function call.
Project emulates a script interpreter.
How we can reproduce it using the example you attached
Simply play the test scene and click the button, with following circumstances:
(To switch between using NativeArray and using managed C# array, simply uncomment/comment code in TestScript.cs and ScriptExecutor.cs)
(To increase/decrease recursive level, simply edit script.json and follow the format to add more elements into nodes array)
Case 1: Editor play mode, NativeArray, 10 recursive levels
Result: Crashes editor
Case 2: Editor play mode, managed array, 10 recursive levels
Result: Computes normally
Case 3: Android build, NativeArray, 10 recursive levels
Result: Computes normally
Case 4: Editor play mode, NativeArray, 5 recursive levels
Result: Computes normally
Case 5: Editor play mode, NativeArray, 20 recursive levels
Result: Crashes editor
Case 6: Editor play mode, managed array, 20 recursive levels
Result: Crashes editor
Case 7: Android build, NativeArray, 20 recursive levels
Result: Computes normally
Case 8: (unconfirmed but I’m fairly confident it happens) iOS build, NativeArray, 10 recursive levels
Result: Crashes build
I’m not sure if anyone has encountered such issue before, but it is clear to me that there is some weirdness going on.
With this issue, I’m also unable to use Job System and Burst to improve performance (IL2Cpp overhead really hurts for this type of script interpreter)