Fix ProcessLoader stale PID validation against kernel process table #102
No reviewers
Labels
No labels
audio
bug
confirmed
cpu
critical
development
enhancement
gpu
graphics-backend:opengl
graphics-backend:vulkan
gui
help wanted
horizon/hle
i18n
infra
input
kernel
linux
macos
suggestion
windows
No assignees
1 participant
Notifications
Due date
No due date set.
Reference
projects/Ryubing!102
Loading…
Reference in a new issue
No description provided.
Delete branch "Babib3l/Ryubing:process-loader-stale-pid"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR adresses the following issue :
ProcessLoader.ActiveApplicationcould return invalid results when_latestPidpointed to a process that no longer existed in the kernel's process table. The original exception path was commented out and bypassed (by sh0inx?) withGetValueOrDefaultto prevent UI lockups, but this only resolved the symptoms without fixing the root cause.This was due to sevral factors :
_latestPidwas never reset or validated against the actual process state_processesByPiddictionary separate from the kernel'sKernelContext.ProcessesSolution/Fixes
_latestPidagainst the kernel process table before returningActiveApplicationClearProcess,ClearAllProcesses)ClearAllProcessesinto Switch.Dispose for proper shutdown cleanupCode Changes:
ProcessLoader.cs: Add_pidLock, updateActiveApplicationwith validation, add cleanup methodsSwitch.cs: CallProcesses.ClearAllProcesses()in Dispose()