Android build with ASTC compression crashes

Hi!

We have a crash when building our project for Android with ASTC compression. Other compressions have been built successfully. Our game uses NGUI and TK2D. The build was ran from the command line, and and we can’t build the game from the editor as it crashes on attempt to allocate memory at some point. We tried many times with the same results every time. We were unable to detect the asset which could produce the crash (may be somebody know how to create some sort of validation procedure? please give some hint if so).

The build log ends with the following:

System memory in use before: 110.3 MB.
Unloading 0 Unused Serialized files
(Serialized files now loaded: 0 /
Dirty serialized files: 0) System
memory in use after: 110.5 MB.

Unloading 0 unused Assets to reduce
memory usage. Loaded Objects now:
1163. Total: 2.710556 ms (FindLiveObjects: 0.061439 ms
CreateObjectMapping: 0.031020 ms
MarkObjects: 2.174770 ms
DeleteObjects: 0.007830 ms)

!IsCompressedDXTTextureFormat(format)
&&
!IsCompressedETCTextureFormat(format)
&&
!IsCompressedATCTextureFormat(format)
&&
!IsCompressedETC2TextureFormat(format)
&&
!IsCompressedEACTextureFormat(format)
UnityEditor.BuildPipeline:BuildPlayerInternalNoCheck(String,
String, BuildTarget, BuildOptions,
Boolean, UInt32&)
UnityEditor.BuildPipeline:BuildPlayerInternal(String,
String, BuildTarget, BuildOptions,
UInt32&) (at
C:\buildslave\unity\build\artifacts\EditorGenerated\BuildPipeline.cs:164)
UnityEditor.BuildPipeline:BuildPlayer(String,
String, BuildTarget, BuildOptions) (at
C:\buildslave\unity\build\artifacts\EditorGenerated\BuildPipeline.cs:108)
SceneEditorWindow:PerformAndroidBuild()
(at
Assets\Editor\SceneEditorWindow.cs:53)

[C:/buildslave/unity/build/Runtime/Graphics/Image.cpp
line 25] (Filename:
Assets/Editor/SceneEditorWindow.cs
Line: 53)

Crash!!! SymInit: Symbol-SearchPath:
‘C:/Program
Files/Unity4/Editor/Data/MonoEmbedRuntime;.;D:\JedGames\RidersOfApocalypse\InWorkHD_Android_ASTC;C:\Program
Files\Unity4\Editor;C:\Windows;C:\Windows\system32;SRVC:\websymbolshttp://msdl.microsoft.com/download/symbols;’,
symOptions: 530, UserName: ‘Demiurge’
OS-Version: 6.1.7601 (Service Pack 1)
0x100-0x1

There is also a stack trace:

========== OUTPUTING STACK TRACE ==================

(0x011DBE81) (Unity): (filename not
available): _VEC_memcpy + 0x55
(0x006E625E)
c:\buildslave\unity\build\runtime\graphics\image.cpp
(46 + 0xe): BlitCopyCompressedImage +
0x12e (0x0070B707)
c:\buildslave\unity\build\runtime\graphics exture2d.cpp
(315 + 0x2b):
Texture2D::ExtractCompressedImageInternal

  • 0x197 (0x0070C0C4) c:\buildslave\unity\build\runtime\graphics exture2d.cpp
    (997 + 0xca):
    Texture2D::InitTextureRepresentations
  • 0x284 (0x0070D96C) c:\buildslave\unity\build\runtime\graphics exture2d.cpp
    (598 + 0x0): Texture2D::UploadTexture
  • 0xbc (0x0070A769) c:\buildslave\unity\build\runtime\graphics exture2d.cpp
    (263 + 0x0): Texture2D::AwakeFromLoad
  • 0x79 (0x008ABF69) c:\buildslave\unity\build\runtime\serialize\awakefromloadqueue.cpp
    (339 + 0x0):
    AwakeFromLoadQueue::PersistentManagerAwakeSingleObject
  • 0x69 (0x008BF30A) c:\buildslave\unity\build\runtime\serialize\persistentmanager.cpp
    (1116 + 0x1d):
    PersistentManager::ReadObject + 0x3aa
    (0x004E5399)
    c:\buildslave\unity\build\runtime\baseclasses\baseobject.cpp
    (228 + 0x0):
    ReadObjectFromPersistentManager + 0x19
    (0x0043180A)
    c:\buildslave\unity\build\runtime\baseclasses\baseobject.h
    (874 + 0x8): PPtr::operator
    Object * + 0xaa (0x008BC3D6)
    c:\buildslave\unity\build\runtime\serialize\persistentmanager.cpp
    (638 + 0x11):
    PersistentManager::WriteFileInternal +
    0x636 (0x00E699DF)
    c:\buildslave\unity\build\editor\src\buildpipeline\buildserialization.cpp
    (1772 + 0x0): WriteSharedAssetFile +
    0x11f (0x00E69B26)
    c:\buildslave\unity\build\editor\src\buildpipeline\buildserialization.cpp
    (1787 + 0x23): CompileSharedAssetsFile
  • 0x26 (0x00EFEC6E) c:\buildslave\unity\build\editor\src\utility\buildplayerutility.cpp
    (1194 + 0xf): BuildSharedAssetsFile +
    0xde (0x00F0EDB1)
    c:\buildslave\unity\build\editor\src\utility\buildplayerutility.cpp
    (2043 + 0x19): BuildPlayerData +
    0x1eb1 (0x00F10B89)
    c:\buildslave\unity\build\editor\src\utility\buildplayerutility.cpp
    (2661 + 0xa6): DoBuildPlayer + 0x1319
    (0x00F11942)
    c:\buildslave\unity\build\editor\src\utility\buildplayerutility.cpp
    (2807 + 0xe): BuildPlayer + 0x2e2
    (0x00BD44D8)
    c:\buildslave\unity\build\artifacts\editorgenerated\buildpipeline.cpp
    (73 + 0xd):
    BuildPipeline_CUSTOM_BuildPlayerInternalNoCheck
  • 0x178 (0x186EBD17) (Mono JIT code): (filename not available): (wrapper
    managed-to-native)
    UnityEditor.BuildPipeline:BuildPlayerInternalNoCheck
    (string,string,UnityEditor.BuildTarget,UnityEditor.BuildOptions,bool,uint&)
  • 0x6f (186EBCA8 186EBD57) [06876D20 - Unity Child Domain] + 0x0 (0x186EBBD7)
    (Mono JIT code): (filename not
    available):
    UnityEditor.BuildPipeline:BuildPlayerInternal
    (string,string,UnityEditor.BuildTarget,UnityEditor.BuildOptions,uint&)
  • 0xbf (186EBB18 186EBC12) [06876D20 - Unity Child Domain] + 0x0 (0x186EBA55)
    (Mono JIT code): (filename not
    available):
    UnityEditor.BuildPipeline:BuildPlayer
    (string,string,UnityEditor.BuildTarget,UnityEditor.BuildOptions)
  • 0x55 (186EBA00 186EBAFF) [06876D20 - Unity Child Domain] + 0x0 (0x186EB3BA)
    (Mono JIT code): (filename not
    available):
    SceneEditorWindow:PerformAndroidBuild
    () + 0x122 (186EB298 186EB3D1)
    [06876D20 - Unity Child Domain] + 0x0
    (0x16E40518) (Mono JIT code):
    (filename not available): (wrapper
    runtime-invoke)
    object:runtime_invoke_void
    (object,intptr,intptr,intptr) + 0x88
    (16E40490 16E405E0) [06876D20 - Unity
    Child Domain] + 0x0 (0x0AB40548)
    c:\buildslave\mono-runtime-and-classlibs\build\mono\mini\mini.c
    (4913 + 0xc): mono_jit_runtime_invoke
  • 0x214 (0x0AAAD7FA) c:\buildslave\mono-runtime-and-classlibs\build\mono\metadata\object.c
    (2623 + 0x10): mono_runtime_invoke +
    0x51 (0x006BCDF4)
    c:\buildslave\unity\build\runtime\mono\monoutility.h
    (446 + 0x0):
    mono_runtime_invoke_profiled + 0xd4
    (0x0101966C)
    c:\buildslave\unity\build\editor\src\application.cpp
    (904 + 0x10):
    Application::ParseARGVCommands + 0x66c
    (0x0101B6BD)
    c:\buildslave\unity\build\editor\src\application.cpp
    (726 + 0x0):
    Application::FinishLoadingProject +
    0x1ed (0x010BB177)
    c:\buildslave\unity\build\editor\platform\windows\wineditormain.cpp
    (808 + 0x0): WinMain + 0xd37
    (0x011D87D4)
    f:\dd\vctools\crt_bld\self_x86\crt\src\crt0.c
    (275 + 0x1c): __tmainCRTStartup +
    0x11a (0x7614EE1C) (kernel32):
    (filename not available):
    BaseThreadInitThunk + 0x12
    (0x77573A03) (ntdll): (filename not
    available):
    RtlInitializeExceptionChain + 0xef
    (0x775739D6) (ntdll): (filename not
    available):
    RtlInitializeExceptionChain + 0xc2

========== END OF STACKTRACE ===========

Have anybody seen things like that before?
I can provide a full log if it could help.

Would appreciate if somebody could help to resolve this problem.

Perhaps you can use AssetPostprocessor.OnPreprocessTexture to log out the path of the texture to be processed?

We have this same problem (invoked from a build script):

Updating Assets/path/to/our/file.png - GUID: 12b8f8c1436cc43cbba7ac9f7cadd539…
!(!IsCompressedDXTTextureFormat(format) && !IsCompressedETCTextureFormat(format) && !IsCompressedATCTextureFormat(format) && !IsCompressedETC2TextureFormat(format) && !IsCompressedEACTextureFormat(format))
UnityEditor.BuildPipeline:BuildPlayerInternalNoCheck(String, String, BuildTarget, BuildOptions, Boolean, UInt32&)
UnityEditor.BuildPipeline:BuildPlayerInternal(String, String, BuildTarget, BuildOptions, UInt32&) (at /Users/builduser/buildslave/unity/build/artifacts/generated/common/editor/BuildPipelineBindings.gen.cs:201)
UnityEditor.BuildPipeline:BuildPlayer(String, String, BuildTarget, BuildOptions) (at /Users/builduser/buildslave/unity/build/artifacts/generated/common/editor/BuildPipelineBindings.gen.cs:148)

And stack trace:
Receiving unhandled NULL exception
Launching bug reporter
Obtained 35 stack frames.
#0 0x00000102486780 in block_merge_next
#1 0x0000010248665f in tlsf_free
#2 0x00000100bc14b1 in DynamicHeapAllocator::TryDeallocate(void*)
#3 0x00000100bc33a9 in DualThreadAllocator >::TryDeallocate(void*)
#4 0x00000100bbbc1f in MemoryManager::Deallocate(void*, MemLabelId const&)
#5 0x00000100e8737b in SharedTextureData::~SharedTextureData()
#6 0x00000100dee10a in GfxDevice::ReleaseSharedTextureData(SharedTextureData*)
#7 0x00000100ea08f2 in Texture2D::UploadTexture(bool)
#8 0x00000100ea1014 in Texture2D::UpdateImageDataDontTouchMipmap()
#9 0x00000101598389 in TextureImporter::GenerateAssetData()
#10 0x00000101407966 in AssetDatabase::ImportAsset(UnityGUID, Asset&, std::string const&, std::string const&, int, UpdateAssetOptions, std::basic_string, stl_allocator > const&, bool, InstanceIDLocalIdentifierLookup&, dynamic_array&)
#11 0x0000010140a7d2 in AssetDatabase::UpdateAsset(UnityGUID const&, UnityGUID const&, Hash128 const&, UpdateAssetOptions, Hash128, AssetImportingTimerStats*)
#12 0x0000010145c3f5 in AssetInterface::ProcessAssetsImplementation(double&, AssetInterface::CancelBehaviour, UpdateAssetOptions)
#13 0x0000010145b54b in AssetInterface::StopAssetEditing(AssetInterface::CancelBehaviour, UpdateAssetOptions)
#14 0x000001014580a0 in VerifyAssetsForBuildTarget(bool, AssetInterface::CancelBehaviour)
#15 0x000001017f67a0 in DoBuildPlayer(BuildPlayerSetup&)
#16 0x000001017f4041 in BuildPlayer(BuildPlayerSetup&)
#17 0x000001022dbdaf in BuildPipeline_CUSTOM_BuildPlayerInternalNoCheck(MonoArray*, ICallString, BuildTargetPlatform, BuildPlayerOptions, unsigned char, unsigned int*)
#18 0x00000116feefaa in (wrapper managed-to-native) UnityEditor.BuildPipeline:BuildPlayerInternalNoCheck (string,string,UnityEditor.BuildTarget,UnityEditor.BuildOptions,bool,uint&) + 0xca (0x116feeee0 0x116feefd9) [0x10ef95660 - Unity Child Domain]
#19 0x000001207d8f7a in UnityEditor.BuildPipeline:BuildPlayerInternal (string,string,UnityEditor.BuildTarget,UnityEditor.BuildOptions,uint&) + 0xfa (0x1207d8e80 0x1207d8f89) [0x10ef95660 - Unity Child Domain]
#20 0x000001207d8d63 in UnityEditor.BuildPipeline:BuildPlayer (string,string,UnityEditor.BuildTarget,UnityEditor.BuildOptions) + 0x83 (0x1207d8ce0 0x1207d8e78) [0x10ef95660 - Unity Child Domain]
#21 0x000001212ff53f in Builder:DoBuild (string,UnityEditor.BuildTarget,UnityEditor.BuildOptions,string) + 0x12f (0x1212ff410 0x1212ff6b9) [0x10ef95660 - Unity Child Domain]
#22 0x0000011fa0e290 in Builder:BuildInternal (string,string,string,string,string,string,bool,bool,bool,bool,string,bool,string,string,int,string) + 0x4f30 (0x11fa09360 0x11fa0ec33) [0x10ef95660 - Unity Child Domain]
#23 0x0000011fa09222 in Builder:Build (string,string,string,string,string,string,bool,bool,bool,bool,string,bool,string,string,int,string) + 0x152 (0x11fa090d0 0x11fa092b5) [0x10ef95660 - Unity Child Domain]
#24 0x0000011fa07067 in Builder:BuildFromCommandLine () + 0x8d7 (0x11fa06790 0x11fa070b1) [0x10ef95660 - Unity Child Domain]
#25 0x0000010ae00906 in (wrapper runtime-invoke) object:runtime_invoke_void (object,intptr,intptr,intptr) + 0xf6 (0x10ae00810 0x10ae00a39) [0x10ef95660 - Unity Child Domain]
#26 0x00000109cb115c in mono_get_runtime_build_info
#27 0x00000109ddf3ea in mono_runtime_invoke
#28 0x00000100dffefe in mono_runtime_invoke_profiled(MonoMethod*, MonoObject*, void**, MonoException**, MonoClass*)
#29 0x000001019e146a in Application::ParseARGVCommands()
#30 0x000001019dfd94 in Application::FinishLoadingProject()
#31 0x00000101c2e036 in NoGraphicsMain()
#32 0x00000101c2e649 in EditorMain(int, char const**)
#33 0x00000101c2eea9 in main
#34 0x000001000029b4 in start

It seems to happen with textures that are not powers of two. Please fix the assert that’s throwing the error and let it be handled like other texture compressions settings. The ! IsCompressedDXTTextureFormat(…)… list does not contain ASTC.

Updating Build setting of unity android compression type from ETC2 to ASTC is crashing Unity 2018.2.0f Editor .Any idea why this might happen