Search Issue Tracker

Fixed in 2018.3.X

Fixed in 2018.1.X



Found in


Issue ID




[IL2CPP] Null Pointer dereference crashes when deserializing Dictionary of Generic Struct type



When using a BinaryFormatter to deserialize a Dictionary that contains a generic struct type whose type parameter is a class, in an IL2CPP build, there is a null pointer dereference crash

To reproduce:

1. Download attached project "" and open in Unity
2. Open "Main" scene
3. Enter Play mode
4. Press all three buttons and notice that they show results in the TextBox and Editor.log when clicked
5. Exit Play mode
6. Run logcat
7. Build and Run the project on a Device
8. Press all three Buttons and notice that the first two Buttons (int test and list test) should show results in the TextBox as expected, but the third Button (class test) crashes the Player

- Logcats are shared in the comments section
- Everything works as expected when using a List instead of a Dictionary.
- Everything works as expected when using an int as the Generic Struct type parameter instead of a Custom Class.
- In Unity 2018.1 and 2018.2, after you press the third Button, the application freezes, but does not crash
- Freeze issue started reproducing in Unity 2018.1.0b12
- In iOS is the same issue as Unity 2018.1 and 2018.2 - the application freezes, but does not crash
- In Windows and OSX standalone everything works fine
- For some reason, the user said that to build on non-development build

- Google Pixel 2, OS: 8.1.0, CPU: arm64-v8a, GPU: Adreno (TM) 540
- iPhone 7, iOS: 11.2.6, CPU: A10

Reproduced on Unity 5.6.5p3, 2017.1.3p3, 2017.2.2p3, 2017.3.2f1, 2017.4.1f1, 2018.1.0f1 and 2018.2.0a8

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.