Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

Crash on startup in MarkObjectAsRoot() when preloader garbage collects (2018.2, Win & Android)

Discussion in 'Editor & General Support' started by Logopolis, Aug 3, 2018.

  1. Logopolis

    Logopolis

    Joined:
    Feb 18, 2015
    Posts:
    27
    I updated from 2017.3 to 2018.2, and now both Windows and Android builds crash upon startup (immediately after splash screen). The crash is in MarkObjectAsRoot(), when the preloader calls GarbageCollectSharedAssets(). The game runs without error in the Editor.

    Here is the call stack on Windows:

    Unhandled exception at 0x104B33CF (UnityPlayer.dll) in War of Conquest.exe: 0xC0000005: Access violation reading location 0x00000004. occurred

    UnityPlayer.dll!MarkObjectAsRoot(class Object const &,struct GarbageCollectorThreadState &) Unknown
    UnityPlayer.dll!GameObject::MarkGameObjectAndComponentDependencies(struct GarbageCollectorThreadState &) Unknown
    UnityPlayer.dll!MarkDependencies(struct GarbageCollectorThreadState &,unsigned int) Unknown
    UnityPlayer.dll!GarbageCollectSharedAssets(bool,bool) Unknown
    UnityPlayer.dll!UnloadUnusedAssetsOperation::IntegrateMainThread(void) Unknown
    UnityPlayer.dll!PreloadManager::UpdatePreloadingSingleStep(enum PreloadManager::UpdatePreloadingFlags,int) Unknown
    UnityPlayer.dll!PreloadManager::WaitForAllAsyncOperationsToComplete(void) Unknown
    UnityPlayer.dll!PerformMainLoop() Unknown
    UnityPlayer.dll!MainMessageLoop() Unknown
    UnityPlayer.dll!UnityMainImpl(struct HINSTANCE__ *,struct HINSTANCE__ *,wchar_t *,int) Unknown
    UnityPlayer.dll!_UnityMain() Unknown
    War of Conquest.exe!_wWinMain@16() Unknown
    War of Conquest.exe!__scrt_common_main_seh() Unknown
    kernel32.dll!77837c04() Unknown

    Here is the call stack on Android:

    0 libunity.so 0x00000000a1bda0fc MarkObjectAsRoot(Object const&, GarbageCollectorThreadState&)
    1 libunity.so 0x00000000a1583fb8 GameObject::MarkGameObjectAndComponentDependencies(GarbageCollectorThreadState&) const
    2 libunity.so 0x00000000a1bd9498 GarbageCollectSharedAssets(bool, bool)
    3 libunity.so 0x00000000a1dcae48 UnloadUnusedAssetsOperation::IntegrateMainThread()
    4 libunity.so 0x00000000a1dc9ff0 PreloadManager::UpdatePreloadingSingleStep(PreloadManager::UpdatePreloadingFlags, int)
    5 libunity.so 0x00000000a1dca658 PreloadManager::WaitForAllAsyncOperationsToComplete()
    6 libunity.so 0x00000000a14639d0 UnityPlayerLoop()
    7 libunity.so 0x00000000a14671a4 nativeRender(_JNIEnv*, _jobject*)
    8 mnt@asec@com.IronZog.WarOfConquest-11@base.apk@classes.dex0x00000000a307866b <unknown>

    This same crash occurs whether I build using mono or il2cpp. Any ideas on how to solve this?
     
  2. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,447
    This sounds like a regression. Could you please submit a bug-report, following these guidelines:
    https://unity3d.com/unity/qa/bug-reporting

    https://forum.unity.com/threads/ins...om-originating-transform.539677/#post-3558659
     
  3. Logopolis

    Logopolis

    Joined:
    Feb 18, 2015
    Posts:
    27
    Peter77 likes this.
  4. Campi

    Campi

    Joined:
    Feb 25, 2013
    Posts:
    9
    I m facing the same problem! :(
     
  5. supreem_creator

    supreem_creator

    Joined:
    Jan 14, 2014
    Posts:
    11
    I'm having the same issue. @Logopolis did you figure it out? Also can you link me to your bug report? Not fixed in 2018.2.3
     
  6. Logopolis

    Logopolis

    Joined:
    Feb 18, 2015
    Posts:
    27
    By progressively deleting parts of (a copy of) my project, I managed to find the minimum elements needed to produce this crash for me.

    I found that the following two elements were necessary to reproduce the crash:

    1) A script component in my project contained a reference to a prefab gameobject that has components belonging to the old, deprecated, particle system.
    2) A script component in my project, in its awake() function, makes a call to the GetTranslation() function belonging to the popular asset store asset called I2 Localization Manager.

    Both of those (seemingly unrelated) elements are necessary in order to reproduce this crash in my project.
    I found that the call to LocalizationManager.GetTranslation() makes the following stack of calls, which is what is required to cause the crash:

    LocalizationManager.GetTranslation()
    LocalizationManager.InitializeIfNeeded()
    LocalizationManager.UpdateSources()
    LocalizationManager.RegisterSourceInResources()
    ResourceManager.pInstance.GetAsset<GameObject>()

    I'm not sure how these two elements are interacting to cause the crash. The crash is still occurring in 2018.2.3f1. I've submitted a bug report:

    https://fogbugz.unity3d.com/default.asp?1070526_0k4rc2sdkdmr2gt4

    I was able to fix this crash in my project by updating all objects that use the old, deprecated particle system with the new Shurikan particle system, using the updater found here:

    https://forum.unity.com/threads/release-legacy-particle-system-updater.510879/

    I had updated my project previously, but didn't realize that the updater only updates objects currently instantiated within the scene, not objects in prefabs. So this time around I instantiated the prefabs (containing old particle systems) in my scene, then ran the updater (using the option to have it delete the old particle system components), then hit "apply" for each of those objects to save their changes back to the prefabs, then deleted the objects from my scene.
     
    Peter77 likes this.
  7. supreem_creator

    supreem_creator

    Joined:
    Jan 14, 2014
    Posts:
    11
    Interesting, I'm not using that Localization package and I don't see any legacy particles in the scene.

    :(

    Any Unity devs lurking in here?