Search Issue Tracker
By Design
Votes
0
Found in
2019.1
2019.3.9f1
2019.4
2020.1
2020.2
Issue ID
1253593
Regression
Yes
Crash on GC_malloc_kind_global when entering Play Mode and using pointers in script
How to reproduce:
1. Open attached project "Case_1253593_pointers.rar"
2. Enter Play Mode
Expected result: Editor does not crash
Actual result: Editor crashes
Reproducible with - 2019.1.0f1, 2019.1.14f1, 2019.4.2f1, 2020.1.0b14, 2020.2.0a16
Not reproducible with - 2017.4.40f1, 2018.4.23f1, 2019.1.0b10
Notes:
Does not crash 100% of the times
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Fixing Message Loss in UMPE During Domain Reload
- The Editor freezes when ScheduleReadOnly of IJobParallelForTransform with dependency is used
- Text is truncated in the Inspector when the display scale is set to 150%
- CancellationTokenSource(<timeout>) has incorrect cancellation status when used in WebGL Player
- VFX property value names are cut off when properties with 'Arc' are viewed in the VFX Blackboard
Resolution Note:
The issue here is that pointers to array elements are stored and accessed outside of a `fixed` block. The memory may be moved or collected. In this case, the fix is to allocate a pinned GC handle to keep the array alive and fixed. Something like this
System.Runtime.InteropServices.GCHandle.Alloc(c, System.Runtime.InteropServices.GCHandleType.Pinned);