Valkirie / HandheldCompanion

ControllerService
Other
1.09k stars 86 forks source link

HC crashes on startup on Lenovo Yoga 14arb7 laptop (and probably other Lenovo laptop) #1046

Closed TbangIT closed 1 month ago

TbangIT commented 2 months ago

Hi, I wanted to try this program that was recommended to me by a friend of mine, however on my laptop the program crashes at startup. I searched the windows event log and found this error in the logs: laptop model: lenovo yoga 14arb7

Application: HandheldCompanion.exe
CoreCLR Version: 8.0.424.16909
.NET Version: 8.0.4
Description: The process was terminated due to an unhandled exception.
Exception Info: System.AggregateException: One or more errors occurred. (Call failed: Classe non valida . [scope=root\WMI, query=SELECT * FROM LENOVO_OTHER_METHOD, methodName=GetFeatureValue])
 ---> System.Management.ManagementException: Call failed: Classe non valida . [scope=root\WMI, query=SELECT * FROM LENOVO_OTHER_METHOD, methodName=GetFeatureValue]
 ---> System.Management.ManagementException: Classe non valida 
   at System.Management.ManagementException.ThrowWithExtendedInfo(ManagementStatus errorCode)
   at System.Management.ManagementObjectCollection.ManagementObjectEnumerator.MoveNext()
   at System.Linq.Enumerable.CastIterator[TResult](IEnumerable source)+MoveNext()
   at System.Linq.Enumerable.TryGetFirst[TSource](IEnumerable`1 source, Boolean& found)
   at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)
   at HandheldCompanion.WMI.CallAsync[T](String scope, FormattableString query, String methodName, Dictionary`2 methodParams, Func`2 converter) in D:\a\HandheldCompanion\HandheldCompanion\HandheldCompanion\WMI.cs:line 87
   --- End of inner exception stack trace ---
   at HandheldCompanion.WMI.CallAsync[T](String scope, FormattableString query, String methodName, Dictionary`2 methodParams, Func`2 converter) in D:\a\HandheldCompanion\HandheldCompanion\HandheldCompanion\WMI.cs:line 101
   at HandheldCompanion.Devices.LegionGo.<.ctor>b__12_0() in D:\a\HandheldCompanion\HandheldCompanion\HandheldCompanion\Devices\Lenovo\LegionGo.cs:line 228
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at HandheldCompanion.Devices.LegionGo..ctor() in D:\a\HandheldCompanion\HandheldCompanion\HandheldCompanion\Devices\Lenovo\LegionGo.cs:line 228
   at HandheldCompanion.Devices.IDevice.GetCurrent() in D:\a\HandheldCompanion\HandheldCompanion\HandheldCompanion\Devices\IDevice.cs:line 457
   at HandheldCompanion.Views.MainWindow..ctor(FileVersionInfo _fileVersionInfo, Assembly CurrentAssembly) in D:\a\HandheldCompanion\HandheldCompanion\HandheldCompanion\Views\Windows\MainWindow.xaml.cs:line 164
   at HandheldCompanion.App.OnStartup(StartupEventArgs args) in D:\a\HandheldCompanion\HandheldCompanion\HandheldCompanion\App.xaml.cs:line 108
   at System.Windows.Application.<.ctor>b__1_0(Object unused)
   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)
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
   at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(Object obj)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Windows.Threading.DispatcherOperation.Invoke()
   at System.Windows.Threading.Dispatcher.ProcessQueue()
   at System.Windows.Threading.Dispatcher.WndProcHook(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)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   at System.Windows.Application.RunDispatcher(Object ignore)
   at System.Windows.Application.RunInternal(Window window)
   at HandheldCompanion.App.Main()

i tried to reinstall .net 8, but the error persist.

CasperH2O commented 2 months ago

@TbangIT thanks for dropping in. Seems HC is not properly starting on your laptop, now, to be fair, it wasn't designed for that laptop, but at least it should handle it gracefully.

It would seem HC thinks it's a Legion Go and attempts to use some Legion Go specific functions calls which are not available.

TbangIT commented 2 months ago

I have some updates, I managed to find other owners of some Lenovo laptops that were similar to my laptop and I made them try installing and using the program, the same thing happens to them too.

So far I've managed to try it on my 14arb7, on the yoga pro 14arp8 and on another one for which I can't find a specific code

Valkirie commented 2 months ago

I don't really understand how a "non handled" device ended-up initializing LegionGo IDevice class. Unless all Legion devices reports LNVNB161216 as their product name... I've pushed an update to forthcoming EA to at least handle those exceptions gracefully instead of crashing the app.

CasperH2O commented 2 months ago

@TbangIT can you share a full logfile? Can you also share a screenshot of System Information (its a Windows app)?

CasperH2O commented 1 month ago

Fixed with 0.21.1.1. Closing ticket.