mirror of
https://github.com/debauchee/barrier.git
synced 2026-05-15 14:16:02 -06:00
[GH-ISSUE #567] On Windows, barrierd creates zombie processes and causes System (ntoskrnl) to burn CPU #446
Labels
No labels
HiDPI
bounty
bsd/freebsd
bsd/openbsd
bug
bug
build-infra
cantfix
critical
doc
duplicate
enhancement
fix-available
from git
from release
good first issue
help wanted
installer/package
invalid
linux
macOS
meta
needs testing
pull-request
query
question
regression
regression
v2.4.0
windows
wontfix
work-in-progress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/barrier#446
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Originally created by @nyanpasu64 on GitHub (Feb 16, 2020).
Original GitHub issue: https://github.com/debauchee/barrier/issues/567
Operating Systems
Server: Windows 10 Version 1909
Client: n/a
Barrier Version
2.3.2
Steps to reproduce bug
barrierd.exe) leaksbarriers.exehandles.If you download https://github.com/randomascii/blogstuff/blob/master/FindZombieHandles/prebuilt/FindZombieHandles.exe and run it, you'll see:
The number of zombie processes increases over time. On my system that has been running for around 7 days, barrierd.exe leaked a whopping 15846 instances of barriers.exe.
This is not only a theoretical problem, but causes the Windows kernel (System, ntoskrnl.exe) to burn CPU, and audio drivers to encounter latency spikes (detected via LatencyMon).
Using Process Hacker, I noticed that the System (ntoskrnl) process thread 72 intermittently uses CPU time. By capturing a trace using WPRUI.exe and viewing in Windows Performance Analyzer, I found that MiTrimOrAgeWorkingSet is taking lots of time. Using Process Hacker to sleep thread 72 causes LatencyMon to not detect latency, but causes the Windows lock screen to hang the system instead.
Diagnostics and signs
Capturing an ETW trace: https://superuser.com/questions/527401/troubleshoot-high-cpu-usage-by-the-system-process
My symptoms: https://superuser.com/questions/1360097/how-to-control-cpu-usage-of-ntoskrnl-exemiwalkpagetablesrecursively
How I discovered that I had zombie processes: https://superuser.com/questions/1326046/windows-10-slowly-increases-ram-usage-on-2-different-pcs
Detecting that Barrier was leaking zombie processes: https://github.com/randomascii/blogstuff/blob/master/FindZombieHandles/prebuilt/FindZombieHandles.exe
@SonicZentropy commented on GitHub (Feb 23, 2020):
This also happens with base synergy, not just Barrier. I found barrier specifically trying to get around te same thing happening with synergy
@shymega commented on GitHub (Feb 23, 2020):
@jimbo1qaz Thanks for your in-depth report. I've tagged this bug as critical, due to the nature of it.
@SonicZentropy Interesting to note. Was that Synergy 2.x?
Thanks.
@SonicZentropy commented on GitHub (Mar 3, 2020):
@shymega No sir, I vastly prefer 1.x/Barrier to 2. Specifically, it was Synergy version:
1.10.3-stable-ca35737a
I wish I had more info for you, as I spent quite a while trying to figure out what was causing it. I never could reliably reproduce it or figure it out though. It happens very rarely and with no consistent pattern I can find. A couple of my friends who use Synergy have had it happen to them as well, also with no pattern or indications. I just wanted to chime in so you guys would know it comes from the synergy codebase and not barrier!
@github-actions[bot] commented on GitHub (Sep 28, 2020):
This issue has been automatically marked as stale due to inactivity. It will be closed if no further activity occurs. Thank you for your contributions.
@nyanpasu64 commented on GitHub (Sep 28, 2020):
(Crossposting with #611, a duplicate)
Just installed v2.3.3 (which includes #656). I'm seeing errors every 10 seconds:
and barrierd.exe eats 4 more handles every time an attempt occurs, but I didn't wait long enough to watch the handle count rise.
FindZombieHandles.exe reports the zombie process count incrementing by 1 at a time.
I think #656 didn't fix this bug.
@imtbl commented on GitHub (Dec 19, 2020):
This issue seems to be fixed in Synergy now:
https://github.com/symless/synergy-core/pull/6762
https://github.com/symless/synergy-core/issues/6567#issuecomment-735831518
@p12tic commented on GitHub (Jan 10, 2021):
@imtbl That's a great find, thank you!
@yutotakano commented on GitHub (Apr 14, 2021):
I'd be wary of cherry-picking that fix still, because according to that thread it's still an ongoing problem... :(
@mirh commented on GitHub (Feb 28, 2022):
Can confirm even in 2.4.0 (of course you need some of the other issue that makes service start fail, to then trigger this nuisance)
Btw you have to download all files in this folder, no just the exe.