Search Issue Tracker

Fixed in 2022.1.X

Fixed in 2021.2.X

Votes

0

Found in

2021.2.0a18

2021.2.0b11

2022.1

Issue ID

1364524

Regression

Yes

Crash on IsTypeTreePPtr when switching variable to another type that inherits from the same class

Serialization

-

Reproduction steps:
1. Open the user's attached project
2. Open the scene 'Assets\Scenes\SampleScene'
3. Select 'TestObject' in the Hierarchy
4. Tap the 'Change Type' checkbox in the Inspector

Expected result: The Editor does not crash
Actual result: The Editor crashes

Reproducible with: 2021.2.0a18, 2021.2.0b13, 2022.1.0a10
Not reproducible with: 2020.3.19f1, 2021.1.23f1, 2021.2.0a17
Couldn't test with: 2019.4.30f1

Notes:
1. The 'Change Type' checkbox may have to be pressed multiple times to reproduce the crash.
2. In the versions that do not reproduce the crash an error is thrown instead:
"Fields with [SerializeReference] cannot serialize inflated generic type in this case: TestScript.D<System.Int32>".
The same error is in the logs right before crashing in the versions that reproduce the issue.

Stacktrace:
0x00007ff7349075a3 (Unity) IsTypeTreePPtr
0x00007ff7357cd98f (Unity) CollectPropertyValuesFromSerializedObject
0x00007ff7357d383d (Unity) GeneratePropertyDiffInternal
0x00007ff7357d4035 (Unity) GeneratePropertyDiffInternal

  1. Resolution Note (fix version 2022.1):

    Fixed in 2022.1.0a13

  2. Resolution Note (fix version 2021.2):

    Fixed in 2021.2.1f1

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.