fork-dev / TrackerWin

Bug and issue tracker for Fork for Windows
461 stars 10 forks source link

[Bug] Fork silently refuses to start, with FileNotFoundException in EventLog #2321

Open MiaNettro opened 1 month ago

MiaNettro commented 1 month ago

Problem Description

Fork is unable to start for one of our end users within our organization. Every attempt results in two Windows event log entries being written, nothing more. Not even a single visible error message after executing Fork.exe. Same behavior when running with administrator privileges. Attempts to launch from command line do not result in any output. Deleting settings.json does not yield any results either.

The exact same behavior occurs for the Fork installer on the same machine. It just silently quits and writes the stack trace to the event log.

Is there a workaround for this?

Ways to Reproduce

Unfortunately we didn't find a way to reproduce this behavior. It currently only occurs on that one user's machine.

Diagnostic Details

The two mentioned EventLog entries:

Anwendung: Fork.exe
Frameworkversion: v4.0.30319
Beschreibung: Der Prozess wurde aufgrund einer unbehandelten Ausnahme beendet.
Ausnahmeinformationen: System.IO.FileNotFoundException
   bei Fork.UI.SystemThemeHelper.SubscribeToSystemEvents()
   bei Fork.App.InitializeTheme()
   bei Fork.App.OnStartup(System.Windows.StartupEventArgs)
   bei System.Windows.Application.<.ctor>b__1_0(System.Object)
   bei System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
   bei System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
   bei System.Windows.Threading.DispatcherOperation.InvokeImpl()
   bei MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(System.Object)
   bei System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   bei System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   bei System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
   bei MS.Internal.CulturePreservingExecutionContext.Run(MS.Internal.CulturePreservingExecutionContext, System.Threading.ContextCallback, System.Object)
   bei System.Windows.Threading.DispatcherOperation.Invoke()
   bei System.Windows.Threading.Dispatcher.ProcessQueue()
   bei System.Windows.Threading.Dispatcher.WndProcHook(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
   bei MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
   bei MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)
   bei System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
   bei System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
   bei System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)
   bei MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)
   bei MS.Win32.UnsafeNativeMethods.DispatchMessage(System.Windows.Interop.MSG ByRef)
   bei System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame)
   bei System.Windows.Application.RunDispatcher(System.Object)
   bei System.Windows.Application.RunInternal(System.Windows.Window)
   bei Fork.App.Main()

Ausnahmeinformationen: System.Reflection.TargetInvocationException
   bei System.RuntimeMethodHandle.InvokeMethod(System.Object, System.Object[], System.Signature, Boolean)
   bei System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(System.Object, System.Object[], System.Object[])
   bei System.Reflection.RuntimeMethodInfo.Invoke(System.Object, System.Reflection.BindingFlags, System.Reflection.Binder, System.Object[], System.Globalization.CultureInfo)
   bei <Module>.Main(System.String[])
Name der fehlerhaften Anwendung: Fork.exe, Version: 1.92.0.0, Zeitstempel: 0x6569fbf7
Name des fehlerhaften Moduls: KERNELBASE.dll, Version: 10.0.22621.3880, Zeitstempel: 0xdb9989e8
Ausnahmecode: 0xe0434352
Fehleroffset: 0x000000000005fabc
ID des fehlerhaften Prozesses: 0x0x3244
Startzeit der fehlerhaften Anwendung: 0x0x1DAF9F4EBC11F50
Pfad der fehlerhaften Anwendung: C:\Users\<REDACTED>\AppData\Local\Fork\app-1.92.0\Fork.exe
Pfad des fehlerhaften Moduls: C:\WINDOWS\System32\KERNELBASE.dll
Berichtskennung: 69005113-2598-4b21-9d19-6dd693d56f66
Vollständiger Name des fehlerhaften Pakets: 
Anwendungs-ID, die relativ zum fehlerhaften Paket ist:
DanPristupov commented 1 month ago

Fork Version: 1.99.3 (Latest version available on git-fork.com at the time of writing) Name der fehlerhaften Anwendung: Fork.exe, Version: 1.92.0.0, Zeitstempel: 0x6569fbf7

It's not the latest version

DanPristupov commented 1 month ago

The code of the method is simple:

        public static void SubscribeToSystemEvents()
        {
            var uiSettings = new Windows.UI.ViewManagement.UISettings();
            uiSettings.ColorValuesChanged += UiSettings_ColorValuesChanged;
            _uiSettings = uiSettings;
        }

Not sure why it may crash on your machine.

MiaNettro commented 1 month ago

It's not the latest version

Oh yeah, the stack trace is old. We tried it with 1.99.3 today again. Same results though so I didn't bother getting the logs from the end user. Here are the same logs but from just now and with the latest version:

Name der fehlerhaften Anwendung: Fork.exe, Version: 1.99.3.0, Zeitstempel: 0x669a4796
Name des fehlerhaften Moduls: KERNELBASE.dll, Version: 10.0.22621.3880, Zeitstempel: 0xdb9989e8
Ausnahmecode: 0xe0434352
Fehleroffset: 0x000000000005fabc
ID des fehlerhaften Prozesses: 0x0x20B4
Startzeit der fehlerhaften Anwendung: 0x0x1DB051BF0D71BF3
Pfad der fehlerhaften Anwendung: C:\Users\peter.saemann\AppData\Local\Fork\app-1.99.3\Fork.exe
Pfad des fehlerhaften Moduls: C:\WINDOWS\System32\KERNELBASE.dll
Berichtskennung: 46f0007c-584b-4b87-8720-1b7c1e173bab
Vollständiger Name des fehlerhaften Pakets: 
Anwendungs-ID, die relativ zum fehlerhaften Paket ist:

Not sure why it may crash on your machine.

Maybe you can help us by handling the exception and introducing a default behavior for the colors? Like, Color Look and Feel things are of the least priority to us. We're happy if it would just work.

I suspect, Windows.UI.ViewManagement.UISettings.ColorValuesChanged is trying to do an interop call with the windows API or the KERNELBASE.dll or something to register the event. Microsoft's code being like Microsoft's code, the usual.