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]