Search Issue Tracker

Won't Fix

Votes

0

Found in

5.2.1p1

Issue ID

731020

Regression

No

Editor crashes with a very long multidimensional array

Mono

-

If there is a script that has a very long multidimensional array, Editor crashes on starting the play mode.

For example, the attached project has a long two-dimensional array, which looks like the following:

string [,] test = {
{“x”, “y”, “z”, “w”},
{“x”, “y”, “z”, “w”},
{“x”, “y”, “z”, “w”},
(repeat 4,000 times)
};

Although the system has enough amount of memory for storing the array, it crashes immediately.

Update: This code evaluates down to a large single method doing each string allocation then storing it into the array. The mono JIT generates a method using a fairly large amount of stack space, but with the IL2CPP backend it crashes on the PreLoad thread since it has a 512k stack. Just bumping the stack would likely hide the issue, but it will eventually crash when the method gets even larger.

Add comment

Log in to post comment