How to reproduce:
- Open the attached "IN-151018" project
- In the menu bar, select "BugHunt" > "Run ReleaseGCObject Repro"
- Observe the crash
Reproducible with: 6000.0.0f1, 6000.0.82f1, 6000.3.23f1, 6000.5.10f1, 6000.6.0b10, 6000.7.0a5
Reproducible on: Ubuntu 24.04 LTS, Ubuntu 26.04 LTS (by user), Windows 10 Pro
Not reproducible on: No other environments tested
Notes:
- Also reproducible in batch mode: “Unity -batchmode -nographics -projectPath <project> -executeMethod BugHunt.Packs.UnsafeutilityReleasegcobjectAttributedRepro.Run -quit” (the process dies with SIGSEGV)
- “UnsafeUtility.ReleaseGCObject(ulong)” is marked obsolete ("Use GCHandle.Free instead") but is still public
First few lines of the stack trace:
Caught fatal signal - signo:11 code:1 errno:0 addr:0xffffffffffffe028
#1 0x0071850123fccc in (Unknown)
#2 0x0063dbbef71b5c in scripting_gchandle_free(unsigned long)
#3 0x0063dbbef6854b in ScriptingGCHandle::ReleaseAndClear()
#4 0x0063dbbec0638c in UnsafeUtility_CUSTOM_ReleaseGCObject(unsigned long)
#5 0x000000420d3c7c in (wrapper managed-to-native) Unity.Collections.LowLevel.Unsafe.UnsafeUtility:ReleaseGCObject (ulong)