Borderless-Gaming
Borderless-Gaming copied to clipboard
ArgumentException: Process with ID xxxxx is not running
Borderless Gaming version: 9.5.6 OS: Windows 10 1909 x64 Steps to reproduce: Unknown
The application has crashed with an unhandled exception twice seemingly random; one time today and a few months earlier as well. This is the contents of the crash file (I translated the important stuff from Swedish):
"Process with an ID 34980 is not running.ArgumentExceptionË vid System.Diagnostics.Process.GetProcessById(Int32 processId, String machineName)
vid System.Diagnostics.Process.GetProcessById(Int32 processId)
vid BorderlessGaming.Logic.Windows.Native.QueryProcessesWithWindows(Action1 callback, List1 windowPtrSet) i E:\Downloads\Borderless-Gaming-master (3)\Borderless-Gaming-master\BorderlessGaming.Logic\Windows\Native.cs:rad 442
vid BorderlessGaming.Logic.Core.ProcessWatcher.<UpdateProcesses>d__20.MoveNext() i E:\Downloads\Borderless-Gaming-master (3)\Borderless-Gaming-master\BorderlessGaming.Logic\Core\ProcessWatcher.cs:rad 206
--- Slut på stackspårningen från föregående plats där ett undantag utlöstes ---
vid System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
vid System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
vid BorderlessGaming.Logic.Core.ProcessWatcher.<Watch>d__15.MoveNext() i E:\Downloads\Borderless-Gaming-master (3)\Borderless-Gaming-master\BorderlessGaming.Logic\Core\ProcessWatcher.cs:rad 61
--- Slut på stackspårningen från föregående plats där ett undantag utlöstes ---
vid System.Runtime.CompilerServices.AsyncMethodBuilderCore.<>c.<ThrowAsync>b__6_1(Object state)
vid System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state)
vid System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
vid System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
vid System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
vid System.Threading.ThreadPoolWorkQueue.Dispatch()
vid System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
Getting same crash. Yesterday and today.
Borderless Gaming version: 9.5.6.1328 OS: Windows 10 1909 x64
I had this problem recently. Looking at the code, it appears there's a race condition. I think if a window is closed between these two lines of code, this can happen. I don't do development on Windows, otherwise I'd try to fix it. I think we should catch and ignore an ArgumentException when calling GetProcessById.
https://github.com/Codeusa/Borderless-Gaming/blob/8ccf20b90e64f981c36c6cc85c3f2b4aad25b0c4/BorderlessGaming.Logic/Windows/Native.cs#L442-L443