How to reproduce:
1. Open the attached “CrashRepro“ project
2. Enter Play Mode
3. Leave Play Mode
Reproducible with: 1.4.0-pre.4 (6000.0.61f1), 1.4.2 (6000.0.61f1, 6000.2.10f1, 6000.3.0b8, 6000.4.0a3)
Reproducible on: macOS 15.6.1 Sequoia (Intel), Windows 10 (by user)
Not reproducible on: No other environment tested
Note: In the “TstCrash” Script, changing the size variable from “64 * 64 * 16“ to “128 * 128 * 16”, will cause Unity to crash when calling “OnCreate“ instead of “OnDestroy“
First few lines of the stack trace:
#0 0x00000107322018 in DomainUnloadAutoFree::Forget(void*)
#1 0x00000107cf644e in UnsafeUtility::Free(void*, NativeCollection::Allocator, ScriptingExceptionPtr*)
#2 0x00000107cf52b3 in UnsafeUtility_CUSTOM_FreeTracked(void*, NativeCollection::Allocator)
#3 0x000001ef407220 in Unity.Collections.AllocatorManager, Unity.Collections, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null.FreeBlock<Unity.Collections.AllocatorManager+AllocatorHandle, Unity.Collections, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null>(Unity.Collections.AllocatorManager+AllocatorHandle&, Unity.Collections, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null t, Unity.Collections.AllocatorManager+Block&, Unity.Collections, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null block) -> System.Void, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089_d8a28626764aa8c00b5c3f7ed60e2592 from Unity.Collections, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
#4 0x000001ef406772 in TstCrash._codegen_OnDestroy(System.IntPtr self, System.IntPtr state) -> void_7240d4da432ce60841c1e72afc88f407 from Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null