Search Issue Tracker
Fixed in 2022.2.X
Duplicate in 2021.3.X
Votes
0
Found in
2021.2
2021.2.0f1
2022.1
Issue ID
1377375
Regression
No
The BinaryReader read data to a Span <byte> is always zero
How to reproduce:
1. Open project "ReadToSpan.zip"
2. In the top Menu bar press Test>Test BinaryReader to Span
Expected result: No error
Actual result: Error appears: ("AssertionException: Assertion failure. Values are not equal. Expected: 1 == 0")
Reproducible with: 2021.2.1f1, 2022.1.0a16
Could not test with: 2019.4.32f1 (Errors: "Library/PackageCache/com.unity.visualscripting@1.7.5/Editor/VisualScripting.Core/Reflection/TypeOptionTree.cs(55,21): error CS1525: Invalid expression term '='"), 2020.3.24f1 (Errors: "Assets/BinaryReaderSpan.cs(44,32): error CS0518: Predefined type 'System.Span`1' is not defined or imported")
Note:
- The Test BinaryReader to byte is working fine
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
- Crash on __pthread_kill when initializing Vuplex WebView while entering the Play Mode
- Crash on FindSurface when adding a custom Renderer Feature to a 2D Renderer Data Asset
- [Android] [Vulkan] [UI Toolkit] Application crashes when the device is rotated when it has UI Toolkit TextField on Vulkan devices
- Crash on DualThreadAllocator<DynamicHeapAllocator>::TryDeallocate when opening a specific project
- Crash on memset_repstos when pressing a UI button while in Play Mode
Resolution Note (fix version 2022.2):
Fixed in 2022.2.0a1
Fixed the class library code for BinaryReader that handles reading to Span.
https://github.com/Unity-Technologies/mono/pull/1532