www.LoadFromCacheOrDonwload Crash on Android!!!
I'm using Unity 5.3.5f1 Personal Edition.
I made sort of a patch system by using AssetbundleManager(https://www.assetstore.unity3d.com/kr/#!/content/45836).
And everything seems to work well.
However, some android phone ( in this case, i tested it on LG GPad 4.0) says an error on a certain assetbundle.
These are my steps.
Download ManifestFile which contains assetbundes' info.
Call www.LoadFromCashOrDownload.
And here's my code. ( I have about 50 asset bundles.)
for (int nIndex = 0; nIndex < m_lDownloadList.Count; nIndex++)
{
Debug.Log("###############1" + GetCDNBasicURL() + m_lDownloadList[nIndex] );
while (Caching.ready == false)
yield return null;
Debug.Log("###############2" + GetCDNBasicURL() + m_lDownloadList[nIndex] );
WWW www = WWW.LoadFromCacheOrDownload(GetCDNBasicURL() + m_lDownloadList[nIndex], m_cManifest.GetAssetBundleHash(m_lDownloadList[nIndex]));
while (www.isDone == false)
{
yield return null;
}
Debug.Log("###############3" + GetCDNBasicURL() + m_lDownloadList[nIndex] );
if (!string.IsNullOrEmpty(www.error))
{
Debug.Log("PcAssetBundleManager] IEDownloadManifest() - Download manifest has an error : " + www.error.ToString());
www.Dispose();
yield break;
}
Debug.Log("###############4" + GetCDNBasicURL() + m_lDownloadList[nIndex] );
AssetBundle bundle = www.assetBundle;
if ( bundle != null )
{
Debug.Log("###############5" + GetCDNBasicURL() + m_lDownloadList[nIndex] );
bundle.Unload( false );
}
Debug.Log("###############6" + GetCDNBasicURL() + m_lDownloadList[nIndex] );
www.Dispose();
}
When I download about 15 assetbundles, then it crashed right after WWW.LoadFromCacheOrDownload function. I can say it because I put the logs.
And here's crash log.
I Unity : (Filename: ./artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 37): com.phiru.speedtapper
I Unity : : com.phiru.speedtapper
D libc : getaddrinfo called from pid =19407: com.phiru.speedtapper
I Vold : [LGE][VOLD][NetlinkHandler.cpp][onEvent()] subsys:cpu, action:0: /system/bin/vold
I Vold : [LGE][VOLD][NetlinkHandler.cpp][onEvent()] subsys:cpu, action:0: /system/bin/vold
I Vold : [LGE][VOLD][NetlinkHandler.cpp][onEvent()] subsys:cpu, action:0: /system/bin/vold
F libc : invalid address or address of corrupt block 0x66e6f020 passed to try_realloc_chunk: com.phiru.speedtapper
F libc : Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1), thread 19435 (AsyncReadManage): com.phiru.speedtapper
I ThermalEngine: Sensor:pa_therm1:47000 mC: /system/bin/thermal-engine
I ThermalEngine: Sensor:pa_therm1:47000 mC: /system/bin/thermal-engine
I ThermalEngine: TM Id 'MONITOR_BATTERY' Sensor 'pa_therm1' - alarm raised 1 at 47.0 degC: /system/bin/thermal-engine
I ThermalEngine: ACTION: BATTERY - Setting battery charging mitigation to 1100: /system/bin/thermal-engine
I ThermalEngine: Mitigation:Battery:1100: /system/bin/thermal-engine
Did I do something wrong?
Please help me out :(
Answer by alejandro-unity · Nov 04, 2016 at 11:45 PM
Do you have the full log file ?
Thank you for reply. I don't have the full log file now. And I found one of my asset bundles make my game crashed. So i just removed that asset bundle and it works fine. but i really want to know why the asset bundle is abnormal. When I make the full log file, i will attach it.
Answer by keht-ns · Oct 09, 2017 at 11:15 AM
Similar problem for me on loading cached asset bundle using www.LoadFromCacheOrDownload:
10-12 13:30:43.100 ? A/libc: invalid address or address of corrupt block 0x86aba020 passed to try_realloc_chunk
10-12 13:30:43.100 ? A/libc: Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1), thread 22917 (AsyncReadManage)
10-12 13:30:43.150 ? I/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
10-12 13:30:43.160 ? I/DEBUG: Build fingerprint: 'google/occam/mako:4.4.2/KOT49H/937116:user/release-keys'
10-12 13:30:43.160 ? I/DEBUG: Revision: '11'
10-12 13:30:43.160 ? I/DEBUG: pid: 22788, tid: 22917, name: AsyncReadManage >>> com.bigfishgames.robinhoodlegendsgooglef2p <<<
10-12 13:30:43.160 ? I/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr deadbaad
10-12 13:30:43.160 ? I/DEBUG: Abort message: 'invalid address or address of corrupt block 0x86aba020 passed to try_realloc_chunk'
Reproducible only on few Android devices (Nexus 4, Redmi 3 are affected). iOS version works without any problems.
The crash was disappeared after I set Caching.compressionEnabled to FALSE