Artemis-RGB / Artemis

Provides advanced unified lighting across many different brands RGB peripherals
https://artemis-rgb.com
Other
947 stars 67 forks source link

Crash on shutdown (Razer plugin config corruption) #683

Open sesquipedality opened 2 years ago

sesquipedality commented 2 years ago

Artemis crashes on shut down. Trace as below.

Version 2.0-c7d91f build 20220107.1

System.IO.FileNotFoundException: Could not load file or assembly 'System.IO.FileSystem.Watcher, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
File name: 'System.IO.FileSystem.Watcher, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
   at McMaster.NETCore.Plugins.PluginLoader.Dispose()
   at Artemis.Core.Plugin.Dispose(Boolean disposing)
   at Artemis.Core.Plugin.Dispose()
   at Artemis.Core.Services.PluginManagementService.UnloadPlugin(Plugin plugin)
   at Artemis.Core.Services.PluginManagementService.UnloadPlugins()
   at Artemis.Core.Services.PluginManagementService.Dispose()
   at Artemis.Core.Services.CoreService.Dispose()
   at Ninject.Activation.Strategies.DisposableStrategy.<>c.<Deactivate>b__0_0(IDisposable x)
   at Ninject.Activation.Strategies.DisposableStrategy.Deactivate(IContext context, InstanceReference reference)
   at Ninject.Activation.Pipeline.<>c__DisplayClass7_0.<Deactivate>b__0(IActivationStrategy s)
   at Ninject.Infrastructure.Language.ExtensionsForIEnumerableOfT.Map[T](IEnumerable`1 series, Action`1 action)
   at Ninject.Activation.Pipeline.Deactivate(IContext context, InstanceReference reference)
   at Ninject.Activation.Caching.Cache.Forget(CacheEntry entry)
   at Ninject.Activation.Caching.Cache.Forget(IEnumerable`1 cacheEntries)
   at Ninject.Activation.Caching.Cache.Clear()
   at Ninject.KernelBase.Dispose(Boolean disposing)
   at Artemis.UI.ApplicationStateManager.<>c__DisplayClass1_0.<.ctor>b__0(Object _, SessionEndingCancelEventArgs _)
   at System.Windows.Application.OnSessionEnding(SessionEndingCancelEventArgs e)
   at System.Windows.Application.WmQueryEndSession(IntPtr lParam, IntPtr& refInt)
   at System.Windows.Application.AppFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
sesquipedality commented 2 years ago

This looks to be some sort of corruption in the Razer config. I now cannot enable the Razer plugin, as it looks like a spurious "%systemroot%\system32" has crept its way into the directory prefix. I have tried to find the configuration that might be causing this, but thus far without success.

Artemis is no longer crashing on shutdown, but cannot load the Razer plugin, failing as below. Uninstalling and re-installing does not seem to help.

2022-01-25 11:46:50.896 [VRB] [Artemis.Core.Services.PluginManagementService] Enabling plugin feature Artemis.Plugins.Devices.Razer.RazerDeviceProvider - Razer Devices v1.0.1.716 - 58a3d80e-d5cb-4a40-9465-c0a5d54825d6
2022-01-25 11:46:50.915 [ERR] [Artemis.Core.Services.RgbService] Exception during device loading for device provider RazerDeviceProvider
Artemis.Core.ArtemisPluginException: RGB.NET threw exception: Can't find the Razer-SDK at one of the expected locations:
 'C:\Program Files\Artemis\%systemroot%\System32\RzChromaSDK.dll
C:\Program Files\Artemis\%systemroot%\System32\RzChromaSDK64.dll'
 ---> RGB.NET.Core.RGBDeviceException: Can't find the Razer-SDK at one of the expected locations:
 'C:\Program Files\Artemis\%systemroot%\System32\RzChromaSDK.dll
C:\Program Files\Artemis\%systemroot%\System32\RzChromaSDK64.dll'
   at RGB.NET.Devices.Razer.Native._RazerSDK.LoadRazerSDK()
   at RGB.NET.Devices.Razer.RazerDeviceProvider.InitializeSDK()
   at RGB.NET.Core.AbstractRGBDeviceProvider.Initialize(RGBDeviceType loadFilter, Boolean throwExceptions)
   --- End of inner exception stack trace ---
   at Artemis.Core.Services.RgbService.AddDeviceProvider(IRGBDeviceProvider deviceProvider) in D:\a\1\s\Artemis\src\Artemis.Core\Services\RgbService.cs:line 182
2022-01-25 11:46:50.919 [DBG] [Artemis.Core.Services.RgbService] Creating SKTexture with graphics context VulkanContext
2022-01-25 11:46:50.922 [WRN] [Artemis.Core.Services.PluginManagementService] Plugin feature 'Artemis.Plugins.Devices.Razer.RazerDeviceProvider - Razer Devices v1.0.1.716 - 58a3d80e-d5cb-4a40-9465-c0a5d54825d6' failed to enable.
System.AggregateException: One or more errors occurred. (RGB.NET threw exception: Can't find the Razer-SDK at one of the expected locations:
 'C:\Program Files\Artemis\%systemroot%\System32\RzChromaSDK.dll
C:\Program Files\Artemis\%systemroot%\System32\RzChromaSDK64.dll')
 ---> Artemis.Core.ArtemisPluginException: RGB.NET threw exception: Can't find the Razer-SDK at one of the expected locations:
 'C:\Program Files\Artemis\%systemroot%\System32\RzChromaSDK.dll
C:\Program Files\Artemis\%systemroot%\System32\RzChromaSDK64.dll'
 ---> RGB.NET.Core.RGBDeviceException: Can't find the Razer-SDK at one of the expected locations:
 'C:\Program Files\Artemis\%systemroot%\System32\RzChromaSDK.dll
C:\Program Files\Artemis\%systemroot%\System32\RzChromaSDK64.dll'
   at RGB.NET.Devices.Razer.Native._RazerSDK.LoadRazerSDK()
   at RGB.NET.Devices.Razer.RazerDeviceProvider.InitializeSDK()
   at RGB.NET.Core.AbstractRGBDeviceProvider.Initialize(RGBDeviceType loadFilter, Boolean throwExceptions)
   --- End of inner exception stack trace ---
   at Artemis.Core.Services.RgbService.AddDeviceProvider(IRGBDeviceProvider deviceProvider) in D:\a\1\s\Artemis\src\Artemis.Core\Services\RgbService.cs:line 182
   at Artemis.Plugins.Devices.Razer.RazerDeviceProvider.Enable() in D:\a\1\s\Artemis.Plugins\src\Devices\Artemis.Plugins.Devices.Razer\RazerDeviceProvider.cs:line 42
   at Artemis.Core.PluginFeature.InternalEnable() in D:\a\1\s\Artemis\src\Artemis.Core\Plugins\PluginFeature.cs:line 178
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at System.Threading.Tasks.Task.Wait(TimeSpan timeout)
   at Artemis.Core.PluginFeature.SetEnabled(Boolean enable, Boolean isAutoEnable) in D:\a\1\s\Artemis\src\Artemis.Core\Plugins\PluginFeature.cs:line 151
   at Artemis.Core.Services.PluginManagementService.EnablePluginFeature(PluginFeature pluginFeature, Boolean saveState, Boolean isAutoEnable) in D:\a\1\s\Artemis\src\Artemis.Core\Services\PluginManagementService.cs:line 621