Search Issue Tracker
Won't Fix
Votes
4
Found in
2018.3.0b1
Issue ID
1085243
Regression
No
Crash on scripting_object_get_class because Mono does not throw correct exception
How to reproduce:
1. Open the attached project
2. Open the "SampleScene.Unity" scene
3. Press Play
Actual result: Unity crashes.
Reproducible with: 2019.1.0a5, 2018.3.0b6, 2018.2.13f1, 2018.1.9f2, 2017.4.13f1, 2017.2.4f1.
Notes:
The crash is caused by lines 29 and 30 (both have to be executed to reproduce the crash) in Crashy.cs
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
- Audio Mixer does not change volume when lowering volume on an Audio Mixer loaded from AssetBundles
- Error “Value cannot be null. Parameter name: key UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)” thrown and Addressables build fails when "Include in Build" is disabled and using Addressables For Android package
- “error CS0433: The type 'CodeBinaryOperatorType' exists in both 'System.CodeDom and 'System" compilation errors are thrown when opening a specific project
- Metal Vertex Shader warning is being thrown when creating a VR Template Project
- Asset database warning is thrown when declaring font variable in the USS text file
Resolution Note:
We should raise an exception rather than crash when reference and valuetype fields overlap. However, detecting this in mono has proven more difficult than expected. I am resolving this for now as this crash only occurs in a low likelihood event, where a user has explicitly overlapped reference and valuetype fields via Explicit layout.
// Avoid code like the following
[StructLayout(LayoutKind.Explicit)]
public struct GCCrasher
{
[FieldOffset(0)] public int valueType;
[FieldOffset(0)] public GameObject referenceType;
}