Search Issue Tracker

Fixed

Fixed in 2022.3.22f1, 2023.3.0b10

Votes

0

Found in

2022.3.19f1

2023.3.0b5

Issue ID

UUM-62272

Regression

Yes

Crash on SpriteAtlas::GroupSprites(bool) when attempting to generate a Sprite Atlas without calling AssetDatabase.CreateAsset first

--

-

Reproduction steps:
1. Open the attached user's project ("BugTest.zip")
2. Select "Tools -> GenAtlas"

Expected result: The Sprite Atlas is generated
Actual result: The Editor crashes

Reproducible with: 2022.2.0a16, 2022.3.19f1, 2023.3.0b6
Not reproducible with: 2021.3.34f1, 2022.2.0a15

Reproducible on: macOS 14.2.1 (Intel), Windows 11 (User)
Not reproducible on: No other environment tested

Stacktrace:
#0 0x00000109038301 in SpriteAtlas::GroupSprites(bool)
#1 0x00000109031b42 in PackAtlases(BuildTargetPlatform const&, dynamic_array<SpriteAtlas*, 0ul>&, dynamic_array<dynamic_array<PPtr<Texture2D>, 0ul>, 0ul>&, dynamic_array<dynamic_array<PPtr<Texture2D>, 0ul>, 0ul>&, dynamic_array<core::hash_map<std::_{_}1::pair<UnityGUID, long long>, SpriteRenderData, SpriteRenderDataKeyHash, std::{_}{_}1::equal_to<std::{_}_1::pair<UnityGUID, long long>>>, 0ul>&, bool)
#2 0x000001090396bd in PackSpriteAtlases(dynamic_array<PPtr<SpriteAtlas>, 0ul> const&, BuildTargetPlatform, bool, bool, bool)
#3 0x00000107bbeac0 in SpriteAtlasUtility_CUSTOM_PackAtlasesInternal(ScriptingBackendNativeArrayPtrOpaque*, BuildTargetPlatform, unsigned char, unsigned char, unsigned char)
#4 0x0000018bbc0f16 in (wrapper managed-to-native) UnityEditor.U2D.SpriteAtlasUtility:PackAtlasesInternal (UnityEngine.U2D.SpriteAtlas[],UnityEditor.BuildTarget,bool,bool,bool) [

{0x7f941b845d88}

+ 0x126] (0x18bbc0df0 0x18bbc0ffa) [0x150782a80 - Unity Child Domain]

  1. Resolution Note (fix version 2023.3.0b10):

    Fix crash on SpriteAtlas::GroupSprites when attempting to generate a Sprite Atlas without calling AssetDatabase.CreateAsset first. Added warning on packing non-persistent atlas appears in console

  2. Resolution Note (fix version 2022.3.22f1):

    Fix crash on SpriteAtlas::GroupSprites(bool) when attempting to generate a Sprite Atlas without calling AssetDatabase.CreateAsset first. New warning message added when packing non-persistent atlas.

    This fix is available on Unity 2022.3.22f1 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.