Search Issue Tracker
Won't Fix
Votes
0
Found in [Package]
1.5.1 - Collections
2.4.0 - Collections
2.5.X -Collections
Issue ID
ECSB-1097
Regression
No
Data corruption when adding the data from one NativeList<T> to the other using NativeListUnsafeUtility.GetInternalListDataPtrUnchecked and NativeList.AddNoResize methods
How to reproduce:
1. Open the “ReproNativeList“ project
2. Open the “SampleScene”
3. Add “TestTwo.cs“ to a GameObject
4. Enter the Play Mode
5. Observe the Console window
Expected result: All of the 4 “Debug.LogError” outputs are “100“
Actual result: Only the last two “Debug.LogError” outputs are “100“
Reproducible with: 1.5.1 (2021.3.38f1), 2.1.1 (2022.3.28f1), 2.4.0 (2022.3.28f1, 6000.0.1f1)
Reproducible on: macOS 13.5.2 (Intel), Windows 10 (User’s)
Not reproducible on: No other environments tested
Note: Happens with UnsafeLits.AsParallelWriter and NativeList.AddRangeNoResize also
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
- [Quest] Pitch Shifter causes audio degradation on Quest 2 devices when sped up
- "GUI Error: Invalid GUILayout" and "NullReferenceException" are thrown when adding Scenes to "Scenes in Baking Set" in Adaptive Probe Volumes
- Inspector window not updating when switching GameObjects in Play Mode while having a VR headset connected
- “UnityException: GetInvalidFilenameChars” errors are thrown, and the Overlay Save Preset button becomes unusable when entering Play Mode with a shortcut while Overlay Save Preset window is opened
- "UnityException: GetName can only be called from the main thread." erors are thrown when the Shortcuts window is opened and entering Play Mode with a shortcut
Resolution Note:
`NativeList.GetInternalListDataPtrUnchecked` is returning `UnsafeList<T>*` not `T*` there is incorrect usage in example user submitted. Also this method is deprecated in favor of `NativeList.GetUnsafeList` which returns correct type.