Search Issue Tracker

Fixed in 2021.1.X

Fixed in 2020.2.X

Votes

3

Found in

2020.2.0a21

2020.2.0b8

2021.1

Issue ID

1288572

Regression

Yes

Crash on dynamic_array<SecondarySpriteTexture, 0ul>::assign() when using Sprite Atlas with secondary texture assigned

2D

-

Reproduction steps:
1. Open the user's attached "Sprite Atlas Crash Test" project
2. Create a sprite atlas asset by clicking Create->2D->Sprite Atlas in the Project Window
3. Add the "Stone Floor 1" asset in the "Object for Packing" list in the "New Sprite Atlas" asset
4. Enter the Play Mode
5. Close the project
6. Try to open the project again

Expected result: The project opens fine
Actual result: The project crashes

Reproducible with: 2020.2.0a21, 2020.2.0b11, 2021.1.0a6
Not reproducible: 2018.4.29f1, 2019.4.14f1, 2020.1.13f1, 2020.2.0a20

Few lines from the macOS stacktrace:
#0 0x0000010153a627 in core::StringStorageDefault<char>::deallocate()
#1 0x00000101b8b748 in dynamic_array<SecondarySpriteTexture, 0ul>::assign(SecondarySpriteTexture const*, SecondarySpriteTexture const*)
#2 0x00000101df2177 in Sprite::LoadAtlasRenderData(bool)
#3 0x00000101df1e9c in Sprite::AwakeFromLoad(AwakeFromLoadMode)
#4 0x00000102309678 in AwakeFromLoadQueue::InvokePersistentManagerAwake(AwakeFromLoadQueue::Item*, unsigned int, AwakeFromLoadMode, bool)
#5 0x00000102309376 in AwakeFromLoadQueue::PersistentManagerAwakeFromLoad(int, AwakeFromLoadMode, bool)

Note:
- In Editor-prev.log I noticed this message:
Invalid sprite atlas asset encountered when matching atlas for sprite Stone Floor 1. Please repack all your sprite atlases.
- Closing the project right after adding the sprite to the sprite atlas will not reproduce the crash. Entering Play Mode seems to be a crucial step
- reproducible on macOS and Windows
- Full stack trace is attached in the Edit

  1. Resolution Note (fix version 2021.1):

    A fix for this issue will be available on Unity 2021.1.0a7 and above

  2. Resolution Note (fix version 2020.2):

    A fix for this issue will be available on Unity 2020.2.0b13 and above

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.