Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Unity IAP crashes regularly on 'SerializedFile::GetHighestID() const'

Discussion in 'Unity IAP' started by _Adriaan, Oct 30, 2018.

  1. _Adriaan

    _Adriaan

    Joined:
    Nov 12, 2009
    Posts:
    481
    Using Unity's Performance reporter, I was able to identify one of my game's most common crashes caused by the Unity IAP plugin. This is what I get:

    SerializedFile::GetHighestID() const (Unknown File)

    Native StackTrace:

    Thread 0 (crashed)
    0 hiddenfolks 0x0000000100ecd7c0 SerializedFile::GetHighestID() const
    1 hiddenfolks 0x0000000100ec6dec PersistentManager::postLoadStreamNameSpace(StreamNameSpace&, int)
    2 hiddenfolks 0x0000000100ec6c18 PersistentManager::GetStreamNameSpaceInternal(int)
    3 hiddenfolks 0x0000000100ec4d14 PersistentManager::GetSerializedFileInternalIfObjectAvailable(int, long long)
    4 hiddenfolks 0x0000000100ec5cd8 PersistentManager::ReadAndActivateObjectThreaded(int, SerializedObjectIdentifier const&, SerializedFile*, bool, bool)
    5 hiddenfolks 0x0000000100ec51e8 PersistentManager::ReadObjectThreaded(int)
    6 hiddenfolks 0x0000000100ec50e0 PersistentManager::ReadObject(int, AwakeFromLoadMode)
    7 hiddenfolks 0x000000010101379c Resources_CUSTOM_Load(Il2CppString*, Il2CppObject*)
    8 hiddenfolks 0x000000010192d9e0 StandardPurchasingModule_Instance_m782616491
    9 hiddenfolks 0x00000001014e15e0 InAppPurchaseManager_InitializeUnityPurchasing_m3530760006
    10 hiddenfolks 0x0000000100b323ec RuntimeInvoker_Void_t1185182177(void (*)(), MethodInfo const*, void*, void**)
    11 hiddenfolks 0x0000000101410d54 il2cpp::vm::Runtime::Invoke(MethodInfo const*, void*, void**, Il2CppException**)
    12 hiddenfolks 0x0000000100e874cc scripting_method_invoke(ScriptingMethodPtr, ScriptingObjectPtr, ScriptingArguments&, ScriptingExceptionPtr*, bool)
    13 hiddenfolks 0x0000000100e8e660 ScriptingInvocation::Invoke(ScriptingExceptionPtr*, bool)
    14 hiddenfolks 0x0000000100e8e59c ScriptingInvocation::InvokeChecked(ScriptingExceptionPtr*)
    15 hiddenfolks 0x0000000100e928d8 MonoBehaviour::CallMethodInactive(ScriptingMethodPtr)
    16 hiddenfolks 0x0000000100e94758 MonoBehaviour::CallAwake()
    17 hiddenfolks 0x0000000100e94ad8 MonoBehaviour::AddToManager()
    18 hiddenfolks 0x0000000100e946cc MonoBehaviour::AwakeFromLoad(AwakeFromLoadMode)
    19 hiddenfolks 0x0000000100ec3224 AwakeFromLoadQueue::InvokePersistentManagerAwake(AwakeFromLoadQueue::Item*, unsigned int, AwakeFromLoadMode)
    20 hiddenfolks 0x0000000100ec3128 AwakeFromLoadQueue::persistentManagerAwakeFromLoad(int, AwakeFromLoadMode)
    21 hiddenfolks 0x0000000100ec3084 AwakeFromLoadQueue::persistentManagerAwakeFromLoad()
    22 hiddenfolks 0x0000000100e013d0 LoadSceneOperation::CompleteAwakeSequence()
    23 hiddenfolks 0x0000000100e0141c LoadSceneOperation::CompletePreloadManagerLoadScene()
    24 hiddenfolks 0x0000000100e01060 LoadSceneOperation::playerLoadSceneFromThread()
    25 hiddenfolks 0x0000000100e01144 LoadSceneOperation::CompleteLoadFirstScene()
    26 hiddenfolks 0x0000000100e00e08 LoadSceneOperation::IntegrateMainThread()
    27 hiddenfolks 0x0000000100e01c00 PreloadManager::UpdatePreloadingSingleStep(PreloadManager::UpdatePreloadingFlags, int)
    28 hiddenfolks 0x0000000100e02154 PreloadManager::WaitForAllAsyncOperationsToComplete()
    29 hiddenfolks 0x0000000100e03e20 RuntimeSceneManager::LoadScene(core::basic_string<char, core::StringStorageDefault<char> > const&, core::basic_string<char, core::StringStorageDefault<char> > const&, core::basic_string<char, core::StringStorageDefault<char> > const&, UnityGUID const&, int, RuntimeSceneManager::LoadingMode)
    30 hiddenfolks 0x0000000100dd91b8 PlayerStartFirstScene(bool)
    31 hiddenfolks 0x0000000100c151d0 UnityLoadApplication
    32 hiddenfolks 0x0000000100a7bbe4 -[UnityAppController startUnity:]
    33 Foundation 0x00000001d62ff6d0 __NSFireDelayedPerform
    34 CoreFoundation 0x00000001d57f2bf0 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__
    35 CoreFoundation 0x00000001d57f2920 __CFRunLoopDoTimer
    36 CoreFoundation 0x00000001d57f2154 __CFRunLoopDoTimers
    37 CoreFoundation 0x00000001d57ed030 __CFRunLoopRun
    38 CoreFoundation 0x00000001d57ec5b8 CFRunLoopRunSpecific
    39 GraphicsServices 0x00000001d7a60584 GSEventRunModal
    40 UIKitCore 0x00000002023e4bc8 UIApplicationMain
    41 hiddenfolks 0x0000000100a663c0 main
    42 libdyld.dylib 0x00000001d52acb94 start

    I see this crash on iPads, iPods, iPhones, on iOS 11 and 12. I'm on Unity IAP v1.20.1 and Unity 2017.4.14f. Anything I can do to fix this, or is this all on you folks?
     
  2. _Adriaan

    _Adriaan

    Joined:
    Nov 12, 2009
    Posts:
    481
    Taking an even closer look at the less common crashes, there are other crashes happening in the same function at slightly different places:

    core::basic_string<char, core::StringStorageDefault<char> >::basic_string(core::basic_string<char, core::StringStorageDefault<char> > const&)

    Native StackTrace:

    Thread 0 (crashed)
    0 hiddenfolks 0x00000001008e52bc core::basic_string<char, core::StringStorageDefault<char> >::basic_string(core::basic_string<char, core::StringStorageDefault<char> > const&)
    1 hiddenfolks 0x0000000100c1ee4c PersistentManager::postLoadStreamNameSpace(StreamNameSpace&, int)
    2 hiddenfolks 0x0000000100c1ec18 PersistentManager::GetStreamNameSpaceInternal(int)
    3 hiddenfolks 0x0000000100c1cd14 PersistentManager::GetSerializedFileInternalIfObjectAvailable(int, long long)
    4 hiddenfolks 0x0000000100c1dcd8 PersistentManager::ReadAndActivateObjectThreaded(int, SerializedObjectIdentifier const&, SerializedFile*, bool, bool)
    5 hiddenfolks 0x0000000100c1d1e8 PersistentManager::ReadObjectThreaded(int)
    6 hiddenfolks 0x0000000100c1d0e0 PersistentManager::ReadObject(int, AwakeFromLoadMode)
    7 hiddenfolks 0x0000000100d6b79c Resources_CUSTOM_Load(Il2CppString*, Il2CppObject*)
    8 hiddenfolks 0x00000001016859e0 StandardPurchasingModule_Instance_m782616491
    9 hiddenfolks 0x00000001012395e0 InAppPurchaseManager_InitializeUnityPurchasing_m3530760006
    10 hiddenfolks 0x000000010088a3ec RuntimeInvoker_Void_t1185182177(void (*)(), MethodInfo const*, void*, void**)
    11 hiddenfolks 0x0000000101168d54 il2cpp::vm::Runtime::Invoke(MethodInfo const*, void*, void**, Il2CppException**)
    12 hiddenfolks 0x0000000100bdf4cc scripting_method_invoke(ScriptingMethodPtr, ScriptingObjectPtr, ScriptingArguments&, ScriptingExceptionPtr*, bool)
    13 hiddenfolks 0x0000000100be6660 ScriptingInvocation::Invoke(ScriptingExceptionPtr*, bool)
    14 hiddenfolks 0x0000000100be659c ScriptingInvocation::InvokeChecked(ScriptingExceptionPtr*)
    15 hiddenfolks 0x0000000100bea8d8 MonoBehaviour::CallMethodInactive(ScriptingMethodPtr)
    16 hiddenfolks 0x0000000100bec758 MonoBehaviour::CallAwake()
    17 hiddenfolks 0x0000000100becad8 MonoBehaviour::AddToManager()
    18 hiddenfolks 0x0000000100bec6cc MonoBehaviour::AwakeFromLoad(AwakeFromLoadMode)
    19 hiddenfolks 0x0000000100c1b224 AwakeFromLoadQueue::InvokePersistentManagerAwake(AwakeFromLoadQueue::Item*, unsigned int, AwakeFromLoadMode)
    20 hiddenfolks 0x0000000100c1b128 AwakeFromLoadQueue::persistentManagerAwakeFromLoad(int, AwakeFromLoadMode)
    21 hiddenfolks 0x0000000100c1b084 AwakeFromLoadQueue::persistentManagerAwakeFromLoad()
    22 hiddenfolks 0x0000000100b593d0 LoadSceneOperation::CompleteAwakeSequence()
    23 hiddenfolks 0x0000000100b5941c LoadSceneOperation::CompletePreloadManagerLoadScene()
    24 hiddenfolks 0x0000000100b59060 LoadSceneOperation::playerLoadSceneFromThread()
    25 hiddenfolks 0x0000000100b59144 LoadSceneOperation::CompleteLoadFirstScene()
    26 hiddenfolks 0x0000000100b58e08 LoadSceneOperation::IntegrateMainThread()
    27 hiddenfolks 0x0000000100b59c00 PreloadManager::UpdatePreloadingSingleStep(PreloadManager::UpdatePreloadingFlags, int)
    28 hiddenfolks 0x0000000100b5a154 PreloadManager::WaitForAllAsyncOperationsToComplete()
    29 hiddenfolks 0x0000000100b5be20 RuntimeSceneManager::LoadScene(core::basic_string<char, core::StringStorageDefault<char> > const&, core::basic_string<char, core::StringStorageDefault<char> > const&, core::basic_string<char, core::StringStorageDefault<char> > const&, UnityGUID const&, int, RuntimeSceneManager::LoadingMode)
    30 hiddenfolks 0x0000000100b311b8 PlayerStartFirstScene(bool)
    31 hiddenfolks 0x000000010096d1d0 UnityLoadApplication
    32 hiddenfolks 0x00000001007d3be4 -[UnityAppController startUnity:]
    33 Foundation 0x00000001c21036d0 __NSFireDelayedPerform
    34 CoreFoundation 0x00000001c15f6bf0 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__
    35 CoreFoundation 0x00000001c15f6920 __CFRunLoopDoTimer
    36 CoreFoundation 0x00000001c15f6154 __CFRunLoopDoTimers
    37 CoreFoundation 0x00000001c15f1030 __CFRunLoopRun
    38 CoreFoundation 0x00000001c15f05b8 CFRunLoopRunSpecific
    39 GraphicsServices 0x00000001c3864584 GSEventRunModal
    40 UIKitCore 0x00000001ee46cbc8 UIApplicationMain
    41 hiddenfolks 0x00000001007be3c0 main
    42 libdyld.dylib 0x00000001c10b0b94 start
     
  3. unityjingyao

    unityjingyao

    Unity Technologies

    Joined:
    Feb 20, 2017
    Posts:
    220
    Hi,

    The only line that relevant to Unity IAP is 'StandardPurchasingModule_Instance'. And it doesn't seem to cause this crash.
    Can you reproduce it on your side?
     
  4. _Adriaan

    _Adriaan

    Joined:
    Nov 12, 2009
    Posts:
    481
    I haven't been able to reproduce this. I'm simply seeing the reported crashes in the Unity Cloud Performance Reporter, which make this bug a Real Thing that I would like to solve, but I don't know where to start?
     
  5. _Adriaan

    _Adriaan

    Joined:
    Nov 12, 2009
    Posts:
    481
    Does this mean you won't be investigating?
     
  6. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    1,519
    @_Adriaan,

    We are investigating this. We brought it up to the IAP team this afternoon. It will be a bit tricky without a repro case though.

    Do you have any sense of the scale or timeframe of the reports? Did this start recently? Is it all your users or some fraction of them?
     
  7. _Adriaan

    _Adriaan

    Joined:
    Nov 12, 2009
    Posts:
    481
    I've only had a version of my game including Unity IAP for in-app purchases on the stores for a week now, but looking at Performance Reporter, this issue has crashed the game for 50+ people over 70 times so far.

    I'm guessing 50 users make up for ± 1% of my active users for the last week on iOS alone.
     
  8. unityjingyao

    unityjingyao

    Unity Technologies

    Joined:
    Feb 20, 2017
    Posts:
    220
    We are investigating this. I couldn't reproduce this issue so far.
    Does this also happen on the Android platform? Did you delete the 'Assets\Plugins\UnityPurchasing\Resources\BillingMode.json' file when building the iOS version?
     
  9. _Adriaan

    _Adriaan

    Joined:
    Nov 12, 2009
    Posts:
    481
    It only happens on iOS, not on Android, and I did not remove that file. The contents of that file is simply
    {"androidStore":"GooglePlay"}
    .