Search Issue Tracker
Fixed in 2022.1.X
Fixed in 2019.4.X, 2020.3.X, 2021.1.X, 2021.2.X
Votes
0
Found in
2018.4
2019.4
2020.3
2020.3.11f1
2021.1
2021.2
2022.1
Issue ID
1346805
Regression
No
Marshal.OffsetOf() returns incorrect offset when building the project with IL2CPP Scripting Backend
Reproduction steps:
1. Open the attached project ("IL2CppAlignmentBug.zip")
2. Open the "SampleScene" scene: Project window > Assets > Scenes > "SampleScene.assets"
3. Enter the Play-Mode, inspect the "offset" value printed in the Game window
4. Set the Scripting Backend as IL2CPP: Edit > Project Settings > Player > Other Settings
5. Build the project: File > Build Settings > Build And Run
Expected result: The Marshal.OffsetOf() method returns offset of 8 when project is built with IL2CPP Scripting Backend
Actual result: The Marshal.OffsetOf() method returns offset of 4 when project is built with IL2CPP Scripting Backend
Reproducible with: 2018.4.36f1, 2019.4.29f1, 2020.3.14f1, 2021.1.14f1, 2021.2.0b3, 2022.1.0a1
Note:
- Not reproducible with Mono Scripting Backend
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
- “[Worker0] Could not generate preview image“ error when opening macOS native plugin in the Inspector with Architecture to build for set to ARM 64-bit
- [iOS] Application.absoluteURL is empty on Awake/Start when opening via deep link with Splash Screen disabled
- Crash on MemoryManager::Deallocate when rapidly calling Addressables.LoadAssetAsync
- Crash on physx::shdfnd::atomicIncrement when adjusting values on a character controller component after entering Play mode in Prefab edit mode
- [Rendering Debugger] [NewInputSystem] Debug Overlays in Play mode throws InvalidOperationException when using New Input System
Resolution Note (fix version 2022.1):
Fixed in: 2022.1.0a3
Resolution Note (fix version 2021.2):
Fixed in: 2021.2.0b7
Resolution Note (fix version 2021.1):
Fixed in: 2021.1.17f1
Resolution Note (fix version 2020.3):
Fixed in: 2020.3.20f1
Resolution Note (fix version 2019.4):
Fixed in: 2019.4.31f1