Reproduction steps:
1. Open the attached “ReproProj” project
2. Build the project
Expected result: The project is built
Actual result: The Editor crashes
Reproducible with: 2021.3.41f1, 2022.3.40f1, 2023.1.20f1
Not reproducible with: 2023.2.0a1, 6000.0.14f1
Reproducible on: macOS 14.6 (M1 Max)
Not reproducible on: No other environment tested
First few lines of the stack trace:
#0 0x00000191ca63c0 in _platform_memmove
#1 0x00000166420e68 in mono_string_new_utf8_len
#2 0x00000166420d88 in mono_string_new_len
#3 0x0000010516d338 in MonoStringNewLength(char const*, int)
#4 0x00000104634cac in JsonUtility_CUSTOM_ToJsonInternal(ScriptingBackendNativeObjectPtrOpaque*, unsigned char)
#5 0x0000034a6d218c in (wrapper managed-to-native) UnityEngine.JsonUtility:ToJsonInternal (object,bool) [
{0x154226f10}
+ 0x74] (0x34a6d2118 0x34a6d2204) [0x147e42a80 - Unity Child Domain]
#6 0x0000034a6d2050 in UnityEngine.JsonUtility:ToJson (object,bool) [
{0x154226df0}
+ 0x120] [/Users/bokken/build/output/unity/unity/Modules/JSONSerialize/Public/JsonUtility.bindings.cs :: 27u] (0x34a6d1f30 0x34a6d2094) [0x147e42a80 - Unity Child Domain]
#7 0x0000034a6d1ed0 in UnityEngine.JsonUtility:ToJson (object) [
{0x154226db0}
+ 0x18] [/Users/bokken/build/output/unity/unity/Modules/JSONSerialize/Public/JsonUtility.bindings.cs :: 17u] (0x34a6d1eb8 0x34a6d1edc) [0x147e42a80 - Unity Child Domain]