StressLevelZero / Custom-URP

Other
27 stars 14 forks source link

Unity crashes while importing custom URP package #8

Closed valentinegb closed 1 month ago

valentinegb commented 1 year ago

I reported this issue 4 months ago and it still persists, so I'm creating an issue in this repository in addition to the issue made in the MarrowSDK repository. The following is the same as the aforementioned issue.


Upon importing the custom URP package, Unity crashes and shows this error message:

Obtained 57 stack frames.
#0  0x0000031a5009a0 in  StaticBatchingSortingPatch:TryDetourFromTo (System.Reflection.MethodInfo,System.Reflection.MethodInfo) [{0x2fde7c470} + 0xc8] [/Users/valentinebriese/Unity Projects/BONELAB project/Library/PackageCache/com.unity.render-pipelines.universal@f57d7bd6b7/Editor/UnityStaticBatchingSortingPatch/StaticBatchingSortingPatch.cs :: 136u] (0x31a5008d8 0x31a500be8) [0x17e206a80 - Unity Child Domain]
#1  0x00000319fbefe4 in  StaticBatchingSortingPatch:.cctor () [{0x2fdda7368} + 0x1a4] [/Users/valentinebriese/Unity Projects/BONELAB project/Library/PackageCache/com.unity.render-pipelines.universal@f57d7bd6b7/Editor/UnityStaticBatchingSortingPatch/StaticBatchingSortingPatch.cs :: 110u] (0x319fbee40 0x319fbf008) [0x17e206a80 - Unity Child Domain]
#2  0x00000319fbf130 in  (wrapper runtime-invoke) object:runtime_invoke_void (object,intptr,intptr,intptr) [{0x1306a92e8} + 0x68]  (0x319fbf0c8 0x319fbf1b8) [0x17e206a80 - Unity Child Domain]
#3  0x0000017e69990c in mono_jit_runtime_invoke
#4  0x0000017e81f6a8 in do_runtime_invoke
#5  0x0000017e81bae0 in mono_runtime_class_init_full
#6  0x0000017e7e0a34 in ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_RunClassConstructor_raw
#7  0x00000319fbe108 in  (wrapper managed-to-native) System.Runtime.CompilerServices.RuntimeHelpers:RunClassConstructor (intptr) [{0x132161d18} + 0x60]  (0x319fbe0a8 0x319fbe15c) [0x17e206a80 - Unity Child Domain]
#8  0x00000319fbdfdc in  System.Runtime.CompilerServices.RuntimeHelpers:RunClassConstructor (System.RuntimeTypeHandle) [{0x133d80e78} + 0x24]  (0x319fbdfb8 0x319fbe018) [0x17e206a80 - Unity Child Domain]
#9  0x00000319fbccf0 in  UnityEditor.EditorAssemblies:ProcessInitializeOnLoadAttributes (System.Type[]) [{0x131ff5330} + 0x408] [/Users/bokken/buildslave/unity/build/Editor/Mono/EditorAssemblies.cs :: 127u] (0x319fbc8e8 0x319fbce5c) [0x17e206a80 - Unity Child Domain]
#10 0x00000319ba8238 in  (wrapper runtime-invoke) <Module>:runtime_invoke_void_object (object,intptr,intptr,intptr) [{0x2b261f410} + 0x70]  (0x319ba81c8 0x319ba82c8) [0x17e206a80 - Unity Child Domain]
#11 0x0000017e69990c in mono_jit_runtime_invoke
#12 0x0000017e81f6a8 in do_runtime_invoke
#13 0x0000017e81f5c8 in mono_runtime_invoke
#14 0x00000102e3fa48 in scripting_method_invoke(ScriptingMethodPtr, ScriptingObjectPtr, ScriptingArguments&, ScriptingExceptionPtr*, bool)
#15 0x00000102e3abb8 in ScriptingInvocation::Invoke(ScriptingExceptionPtr*, bool)
#16 0x00000102f4a7d8 in Scripting::UnityEditor::EditorAssembliesProxy::ProcessInitializeOnLoadAttributes(ScriptingArrayPtr, ScriptingExceptionPtr*)
#17 0x00000102decbd8 in MonoManager::SetupLoadedEditorAssemblies(dynamic_array<int, 0ul> const&)
#18 0x00000102deeef4 in MonoManager::EndReloadAssembly(DomainReloadingData&, dynamic_bitset)
#19 0x00000102ded1bc in MonoManager::ReloadAssembly()
#20 0x00000103938ef4 in Internal_ADB_Only_ReloadAllUsedAssemblies()
#21 0x0000010411b538 in RefreshInternalV2(AssetDatabase::UpdateAssetOptions, ScanFilter const&, InternalRefreshFlagsV2)
#22 0x000001040fa510 in StopAssetImportingV2Internal(AssetDatabase::UpdateAssetOptions, InternalRefreshFlagsV2, ScanFilter const*, char const*)
#23 0x000001040fc0c8 in RefreshV2(AssetDatabase::UpdateAssetOptions)
#24 0x000001041a2ebc in AssetDatabase::Refresh(AssetDatabase::UpdateAssetOptions)
#25 0x00000102313c44 in CallbackArray::Invoke()
#26 0x00000103cd780c in ProfilerCallbackInvoke<CallbackArray, &(GlobalCallbacks::tickEditor)>::Invoke(char const*)
#27 0x00000103cd4f60 in Application::TickTimer()
#28 0x00000104a650f0 in -[EditorApplication TickTimer]
#29 0x000001b31fb44c in __NSFireTimer
#30 0x74140001b22d354c in __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__
#31 0x92088001b22d31f4 in __CFRunLoopDoTimer
#32 0xdc748001b22d2d4c in __CFRunLoopDoTimers
#33 0xc5740001b22b8734 in __CFRunLoopRun
#34 0x79308001b22b7878 in CFRunLoopRunSpecific
#35 0x2b7a8001bb997fa0 in RunCurrentEventLoopInMode
#36 0x9b1e0001bb997c58 in ReceiveNextEventCommon
#37 0xac268001bb997b2c in _BlockUntilNextEventMatchingListInModeWithFilter
#38 0xf0658001b553d84c in _DPSNextEvent
#39 0x48718001b553c9dc in -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:]
#40 0xcb6e000104a64ef0 in -[EditorApplication checkForFocusChange:]
#41 0x000001b31fb44c in __NSFireTimer
#42 0x89340001b22d354c in __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__
#43 0xea190001b22d31f4 in __CFRunLoopDoTimer
#44 0xd8538001b22d2d4c in __CFRunLoopDoTimers
#45 0x3d5e0001b22b8734 in __CFRunLoopRun
#46 0xab6c0001b22b7878 in CFRunLoopRunSpecific
#47 0xae4a0001bb997fa0 in RunCurrentEventLoopInMode
#48 0x87588001bb997de4 in ReceiveNextEventCommon
#49 0xd87c8001bb997b2c in _BlockUntilNextEventMatchingListInModeWithFilter
#50 0xa7090001b553d84c in _DPSNextEvent
#51 0x6e570001b553c9dc in -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:]
#52 0xe3190001b5530e0c in -[NSApplication run]
#53 0x325b0001b5508250 in NSApplicationMain
#54 0x7f7b800104a623c8 in EditorMain(int, char const**)
#55 0x00000104a62700 in main
#56 0x000001b1eafe50 in start

Reopening the project after this, Unity will immediately crash and show the same error.

Steps to Reproduce

  1. Create new 2021.3.5f1 3D (URP) project
  2. Import custom render pipeline core package
  3. Import custom URP package
  4. Unity crashes and shows error

Extra Info

BoxCoffee09 commented 1 year ago

I am having the same problem on Windows and idk what to do lol

amsdjk commented 1 year ago

I have the same problem on Mac, don't know what to do either, I followed the official and unofficial version of the tutorial and it has happened 14 times, with the same symptoms as the OP

valentinegb commented 1 year ago

Great news, I've found a workaround! Using old enough versions of the three packages you need seems to stop the crashing! These are the URLs I used:

https://github.com/StressLevelZero/Custom-RenderPipelineCore.git#822ffd5b225f5e8a8185e4ebbcd922df95518c70 https://github.com/StressLevelZero/Custom-URP.git#0e2e542dc58bb370803e9172c8f7fa198162c013 https://github.com/StressLevelZero/MarrowSDK.git

I have not yet confirmed that there are no in-game issues, but so far this is a good start.


This comment has been updated with the latest commits which date back before the StaticBatchingSortingPatch stuff was added. Here are the originally posted links, in case the new ones don't work for you:

https://github.com/StressLevelZero/Custom-RenderPipelineCore.git#f083e48d81eedd90da2a7c859ebbd5034be24af2 https://github.com/StressLevelZero/Custom-URP.git#bbfdcced30ed8194b8a10b4f9eb3142c65a1e7bc https://github.com/StressLevelZero/MarrowSDK.git

valentinegb commented 1 year ago

Yep, seems like a valid workaround. Just made the first Bonelab avatar I've been able to make in at least 6 months and it works perfectly :)