Search Issue Tracker
Fixed in 0.51-preview.32
Votes
14
Found in [Package]
0.13.0-preview.24
Issue ID
1267157
Regression
No
Trying to serialize/deserialize an Entities World a second time fails if there are blob assets
How to reproduce:
1. Open attached project "Unity Bugs.zip" and scene "SampleScene"
2. Enter Play mode
3. In Game view, click on the "Hit this 4 times" button 4 times
4. Observe Console window
Expected result: no errors are thrown
Actual result: multiple errors:
AssertionException: Assertion failure. Values are not equal. Expected: 0 == 1
ArgumentException: The entity does not exist
IndexOutOfRangeException: Index -1 is out of range of '65536' Length.
A Native Collection has not been disposed, resulting in a memory leak. Allocated from:
Reproducible with: 2020.1.1f1, 2020.2.0a20 (Entities 0.13.0-preview.24)
Not reproducible with: 2020.1.1f1 (Burst 1.3.0-preview.12, Entities 0.11.0-preview.7, Hybrid Renderer 0.5.1-preview.18)
Could not test with: 2018.4 (Entity package too old), 2019.4 (Entities 11-perview.17, NativeArray ReadOnly is not recognized errors), was not able to test with lower than Entities 0.13.0-preview.24 version reliably due to Package manager reverting Entity package to the newest version
-
JayTea173
Mar 19, 2022 17:01
I'm going to necro this, since this is still an issue in Entities 0.50. The problem I observed is that the entity header length changes when serializing the blobasset, as well as the validationptr being completely wrong, somewhere off in memory and not set to the constant value of an invalid pointer.
But I've found a workaround:
1. Copy the entities you want to serialize to another world.
2. Make sure to remove BlobAssetOwner from these copied entities.
3. Run Serialization.If you now deserialize those entities you should no longer get the error that the blob is unloaded/released/invalid.
BlobAssetOwner is internal, so you'll have to use reflection or modify the entities package source to make the BlobAssetOwner public.
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
- Search field in UI Builder's Library has no character limit
- Changing the value in UI Builder by dragging increases it by a few thousand points when reaching the borders of the screen
- ARM64 architecture DLL incorrectly copied instead of x64 when building for Windows x64
- Crash on TypeTreeIterator::GetNode when opening a specific folder
- Crash on WriteSerializedAssetsV2 when (re)entering the Play Mode in a specific project when IEnumerator Start() is used
Resolution Note (fix version 0.51-preview.32):
Cannot reproduce in 0.51 release -- likely fixed