Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Resolved Crash wether "reload domaing" happens

Discussion in '2022.2 Beta' started by Oniros88, Apr 27, 2022.

  1. Oniros88

    Oniros88

    Joined:
    Nov 15, 2014
    Posts:
    150
    Unity alpha always crashes when in "completing domain" stage. It will consistently crash whenever starting play mode unless "reload domain" is disabled in play mode. It also crashes if for any other reason it reloads domain.

    It's a shame because it makes work very difficult as domain reloading seems very random and it's a guaranteed crash, and this alpha solves a lot of issues I had with previous versions.

    UPDATE: SOLVED!
    I deleted the packages folder and then under safe mode I reinstalled the "core" built in packages such as HDRP, rigging, and others and it works now!
     
    Last edited: May 22, 2022
  2. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,132
    Hi @Oniros88,

    Could you please submit a bug report with a reproduction project and share the issue ID of the report here afterwards?
     
  3. Oniros88

    Oniros88

    Joined:
    Nov 15, 2014
    Posts:
    150
    I can't Its a very big project. but I can show you the crash log:


    =================================================================
    Native Crash Reporting
    =================================================================
    Got a UNKNOWN while executing native code. This usually indicates
    a fatal error in the mono runtime or one of the native libraries
    used by your application.
    =================================================================

    =================================================================
    Managed Stacktrace:
    =================================================================
    at <unknown> <0xffffffff>
    at UnityEditor.PackageManager.UI.Internal.UpmBaseOperation`1:.ctor <0x00162>
    at UnityEditor.PackageManager.UI.Internal.UpmSearchOperation:.ctor <0x0001a>
    at System.Object:runtime_invoke_void__this__ <0x00087>
    =================================================================
    Received signal SIGSEGV
    Obtained 41 stack frames
    0x00007ff85c4f7399 (mono-2.0-bdwgc) [class.c:975] mono_class_inflate_generic_type_with_mempool
    0x00007ff85c7ba34c (mono-2.0-bdwgc) [mini-generic-sharing.c:726] inflate_info
    0x00007ff85c7c06b3 (mono-2.0-bdwgc) [mini-generic-sharing.c:2127] instantiate_info
    0x00007ff85c7c2451 (mono-2.0-bdwgc) [mini-generic-sharing.c:3023] fill_runtime_generic_context
    0x00007ff85c7c25e9 (mono-2.0-bdwgc) [mini-generic-sharing.c:3089] mono_class_fill_runtime_generic_context
    0x00007ff85c7b2b27 (mono-2.0-bdwgc) [mini-trampolines.c:1020] mono_rgctx_lazy_fetch_trampoline
    0x000002b3e38908c6 ((<unknown>))
    0x000002b408ab6ba3 (Mono JIT Code) UnityEditor.PackageManager.UI.Internal.UpmBaseOperation`1<T_REF>:.ctor ()
    0x000002b408ab6a1b (Mono JIT Code) UnityEditor.PackageManager.UI.Internal.UpmSearchOperation:.ctor ()
    0x000002b41518c458 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void__this__ (object,intptr,intptr,intptr)
    0x00007ff85c6c0174 (mono-2.0-bdwgc) [mini-runtime.c:3445] mono_jit_runtime_invoke
    0x00007ff85c5feb34 (mono-2.0-bdwgc) [object.c:3066] do_runtime_invoke
    0x00007ff85c5feccc (mono-2.0-bdwgc) [object.c:3113] mono_runtime_invoke
    0x00007ff6fc7a5af6 (Unity) mono_runtime_object_init_exception
    0x00007ff6fc7a5b3c (Unity) mono_runtime_object_init_log_exception
    0x00007ff6fc858246 (Unity) GetOrCreateObjectStoredInField
    0x00007ff6fc8049ef (Unity) GeneralMonoObjectToTransferFor<ConfigSettingsRead>
    0x00007ff6fc84d00f (Unity) Transfer_ManagedObject<SafeBinaryRead,0>
    0x00007ff6fc7a5fb6 (Unity) ExecuteSerializationCommands<ConfigSettingsRead>
    0x00007ff6fc84d0f2 (Unity) Transfer_ManagedObject<SafeBinaryRead,0>
    0x00007ff6fc7a60d6 (Unity) ExecuteSerializationCommands<JSONRead>
    0x00007ff6fc7c0318 (Unity) <lambda_e0598d962c4e8f701fca190edc632a99>::eek:perator()
    0x00007ff6fc7ba3cc (Unity) TransferScriptingObject<SafeBinaryRead>
    0x00007ff6fc7bb9ec (Unity) SerializableManagedRefTransfer::TransferScriptingObjectWithSerializedRefSupport<SafeBinaryRead>
    0x00007ff6fc7a7d69 (Unity) SerializableManagedRefTransfer::RestoreBackupImpl<SerializableManagedRefBackupGenerator>
    0x00007ff6fc7a7a75 (Unity) SerializableManagedRefTransfer::RestoreBackup<SerializableManagedRefBackupGenerator>
    0x00007ff6fc86d396 (Unity) SerializableManagedRefsUtilities::RestoreBackups
    0x00007ff6fc7c5748 (Unity) MonoManager::FinalizeReload
    0x00007ff6fdb4f505 (Unity) ScriptingInitializer::FinalizeReload
    0x00007ff6fdbc27dc (Unity) ImportOutOfDateAssets
    0x00007ff6fdbcdcf1 (Unity) RefreshInternalV2
    0x00007ff6fdbd59af (Unity) StopAssetImportingV2Internal
    0x00007ff6fdbcf0cc (Unity) RefreshV2
    0x00007ff6fdb46290 (Unity) AssetDatabase::Refresh
    0x00007ff6fd3ea10f (Unity) Application::AutoRefresh
    0x00007ff6fd3fec87 (Unity) Application::TickTimer
    0x00007ff6fd85db0a (Unity) MainMessageLoop
    0x00007ff6fd86289e (Unity) WinMain
    0x00007ff6feba530e (Unity) __scrt_common_main_seh
    0x00007ff8d8957034 (KERNEL32) BaseThreadInitThunk
    0x00007ff8d9d62651 (ntdll) RtlUserThreadStart


    Looks like a package manager issue.


    It doesn't happen with a fresh created project. Now it started triggering a domain reload every Unity start, so I can't even open my project now.

    After launching it 3 times, it doesn't trigger domain reload upon startup anymore. Can open my project but can't play unlesss I disable domain reload. It also crashes each time I update any packagemanager asset. It updates the asset correctly but crashes afterwards because it triggers a domain reload. The crash is when "completing domain" stage appears. It happens too when finishing compiling scripts after saving changes.

    I have also to add that if I manage to build the project (both as dedicated server and as client) the project itself runs perfectly without any crash. Its an editor-only issue.

    I also tried deleting all package manager cache. It crashes anyway.
     
    Last edited: Apr 27, 2022
  4. TG1980

    TG1980

    Joined:
    Oct 23, 2013
    Posts:
    40
    For me the Unity 2022 alphas and betas crash every ten minutes or so even when it's just idling in the background.
    Almost every time I add or remove a source file it crashes, or most of the time when Unity refreshes the asset database.
    I can not provide a repro project as the constant random crashes seem to happen even with a totally empty project.
    I have submitted tons of bug reports but stopped clicking the report bug button on crashes as I am asked for repro steps, and I can not provide them as Unity crashes on its own even with an empty project.
     
    Last edited: May 4, 2022
  5. Oniros88

    Oniros88

    Joined:
    Nov 15, 2014
    Posts:
    150
    The thing is that I know exactly where the issue is, but only happens with my project. I never get an answerl.

    Its a package manager issue, exactly when this happens during a domain reload:
    at <unknown> <0xffffffff>
    at UnityEditor.PackageManager.UI.Internal.UpmBaseOperation`1:.ctor <0x00162>
    at UnityEditor.PackageManager.UI.Internal.UpmSearchOperation:.ctor <0x0001a>
    at System.Object:runtime_invoke_void__this__ <0x00087>
     
  6. TG1980

    TG1980

    Joined:
    Oct 23, 2013
    Posts:
    40
    That's not the same issue as mine then, for me Unity just constantly hard crashes following a 'Refreshing asset database' entry in the log with no stack trace whatsoever.

    Maybe try deleting your packages folder and recreating it from scratch (take a backup first of course!), it's probably something in the serialised JSON screwing things up. Try deleting the package lock file first, might be sufficient to just let Unity recreate it.
     
    ObiOneStenobi and Oniros88 like this.
  7. Oniros88

    Oniros88

    Joined:
    Nov 15, 2014
    Posts:
    150
    Thanks you are a lifesaver!!! I deleted the packages folder and then under safe mode I reinstalled the "core" built in packages such as HDRP, rigging, and others and it works now!

    I spent a week closing unity every time I had to save any changes in scripts.
     
  8. TG1980

    TG1980

    Joined:
    Oct 23, 2013
    Posts:
    40
    Glad it worked. And rebooting Unity every time you save your source files sounds like a nightmare (albeit only slightly slower than the current domain reload is ;)).
     
    Oniros88 likes this.
  9. TG1980

    TG1980

    Joined:
    Oct 23, 2013
    Posts:
    40
    Btw maybe you could send the faulty JSONs to Unity as a bug report so they could at least make it not crash as I'm sure other people have that problem too.
     
  10. Oniros88

    Oniros88

    Joined:
    Nov 15, 2014
    Posts:
    150
    Oh, dang! Since it worked I deleted the faulty backups. If it happens again, I will remember to keep them.
     
  11. swantonb

    swantonb

    Joined:
    Apr 10, 2018
    Posts:
    172
    Indeed, upgrading a project to 2022.2 causes some crash on play while "completing domain" (not sure what's the cause, it did work for a while and then suddenly started crashing.

    Can confirm that deleting packages folder and copying over the packages folder from a new unity project created in 2022.2 will fix the issue.
     
  12. eusebium

    eusebium

    Joined:
    Jul 23, 2016
    Posts:
    84
  13. eusebium

    eusebium

    Joined:
    Jul 23, 2016
    Posts:
    84
  14. Dinamytes

    Dinamytes

    Joined:
    Nov 3, 2016
    Posts:
    51
    I had this crash if I had Exceptions being thrown inside
    AppDomain.CurrentDomain.AssemblyLoad += (o, a) =>
    event during playmode.