barriers leaks memory when clients with duplicate names attempt to connect

Bug #1840483 reported by Dan Watkins
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
PmWiki
Fix Released
Unknown
barrier (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

When a second client with the same name as an existing client attempts to connect to barriers, it leaks memory. See #1 for supporting evidence.

[Original Report]

I have had barriers running for a few days now, and it has a RSS of 2695M. When I Stop/Start using the tray icon, this drops to a much more sensible ~10MB though has climbed up to 13MB in the past couple of minutes.

(One note: I appear to have two identically-named clients attempting to connect; this may be triggering some bad behaviour?)

ProblemType: Bug
DistroRelease: Ubuntu 19.10
Package: barrier 2.3.1+dfsg-1
ProcVersionSignature: Ubuntu 5.2.0-10.11-generic 5.2.4
Uname: Linux 5.2.0-10-generic x86_64
NonfreeKernelModules: nvidia_modeset nvidia
ApportVersion: 2.20.11-0ubuntu7
Architecture: amd64
CurrentDesktop: i3
Date: Fri Aug 16 12:08:37 2019
InstallationDate: Installed on 2019-05-07 (100 days ago)
InstallationMedia: Ubuntu 18.04.2 LTS "Bionic Beaver" - Release amd64 (20190210)
SourcePackage: barrier
UpgradeStatus: Upgraded to eoan on 2019-05-08 (99 days ago)

Revision history for this message
Dan Watkins (oddbloke) wrote :
Revision history for this message
Dan Watkins (oddbloke) wrote :
Download full text (4.0 KiB)

OK, so I've tracked memory usage using this barebones shell one-liner:

while true; do echo $(date) $(ps aux | grep bin/barriers | grep -v grep); sleep 60; done | tee -a ~/barriers.ps

The first few entries look fine; RSS doesn't change (to save you working it out without the ps headers, it's the 9228 number here):

Fri Aug 16 12:17:38 EDT 2019 daniel 15785 2.0 0.0 111528 9228 ? Sl 12:17 0:00 /usr/bin/barriers -f --no-tray --debug INFO --name surprise --enable-crypto -c /tmp/Barrier.lHYHCL --address :24800
TRAPWINCH:zle:2: widgets can only be called when ZLE is active
Fri Aug 16 12:18:38 EDT 2019 daniel 15785 0.1 0.0 111528 9228 ? Sl 12:17 0:00 /usr/bin/barriers -f --no-tray --debug INFO --name surprise --enable-crypto -c /tmp/Barrier.lHYHCL --address :24800
Fri Aug 16 12:19:38 EDT 2019 daniel 15785 0.1 0.0 111528 9228 ? Sl 12:17 0:00 /usr/bin/barriers -f --no-tray --debug INFO --name surprise --enable-crypto -c /tmp/Barrier.lHYHCL --address :24800
Fri Aug 16 12:20:38 EDT 2019 daniel 15785 0.1 0.0 111528 9228 ? Sl 12:17 0:00 /usr/bin/barriers -f --no-tray --debug INFO --name surprise --enable-crypto -c /tmp/Barrier.lHYHCL --address :24800
Fri Aug 16 12:21:38 EDT 2019 daniel 15785 0.1 0.0 111692 9228 ? Sl 12:17 0:00 /usr/bin/barriers -f --no-tray --debug INFO --name surprise --enable-crypto -c /tmp/Barrier.lHYHCL --address :24800
Fri Aug 16 12:22:38 EDT 2019 daniel 15785 0.2 0.0 111692 9228 ? Sl 12:17 0:00 /usr/bin/barriers -f --no-tray --debug INFO --name surprise --enable-crypto -c /tmp/Barrier.lHYHCL --address :24800
Fri Aug 16 12:23:38 EDT 2019 daniel 15785 0.2 0.0 111692 9228 ? Sl 12:17 0:00 /usr/bin/barriers -f --no-tray --debug INFO --name surprise --enable-crypto -c /tmp/Barrier.lHYHCL --address :24800
Fri Aug 16 12:24:38 EDT 2019 daniel 15785 0.2 0.0 111692 9228 ? Sl 12:17 0:00 /usr/bin/barriers -f --no-tray --debug INFO --name surprise --enable-crypto -c /tmp/Barrier.lHYHCL --address :24800
Fri Aug 16 12:25:38 EDT 2019 daniel 15785 0.2 0.0 111692 9228 ? Sl 12:17 0:01 /usr/bin/barriers -f --no-tray --debug INFO --name surprise --enable-crypto -c /tmp/Barrier.lHYHCL --address :24800
Fri Aug 16 12:26:38 EDT 2019 daniel 15785 0.2 0.0 111692 9228 ? Sl 12:17 0:01 /usr/bin/barriers -f --no-tray --debug INFO --name surprise --enable-crypto -c /tmp/Barrier.lHYHCL --address :24800

However, when I enable the duplicate client (I have two user sessions on my client screen, if you're wondering), things go sideways fast:

Fri Aug 16 12:27:38 EDT 2019 daniel 15785 0.2 0.0 112072 11432 ? Sl 12:17 0:01 /usr/bin/barriers -f --no-tray --debug INFO --name surprise --enable-crypto -c /tmp/Barrier.lHYHCL --address :24800
Fri Aug 16 12:28:38 EDT 2019 daniel 15785 0.3 0.0 112576 13516 ? Sl 12:17 0:02 /usr/bin/barriers -f --no-tray --debug INFO --name surprise --enable-crypto -c /tmp/Barrier.lHYHCL --address :24800
Fri Aug 16 12:29:38 EDT 2019 daniel 15785 0.3 0.0 113200 15728 ? Sl 12:17 0:02 /usr/bin/barriers -f --no-tray --debug INFO --name surprise --enable-crypto -c /tmp/Barrier.lHYHCL --address :24800

That's an extra 6MB of memory used over 3 minutes. When I turn the duplicate client back off, we see some growth in the first line (as the duplicate cli...

Read more...

summary: - Extremely high memory usage by barriers (possible leak?)
+ barriers leaks memory when clients with duplicate names attempt to
+ connect
description: updated
Revision history for this message
Dan Watkins (oddbloke) wrote :

(Uh, did not really mean to add PmWiki as the upstream project, but as no-one will get notified by that, this is sufficient to point to the upstream issue at https://github.com/debauchee/barrier/issues/396, I think.)

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package barrier - 2.3.1+dfsg-1ubuntu1

---------------
barrier (2.3.1+dfsg-1ubuntu1) devel; urgency=medium

  * Add the following upstream commits to fix various memleaks and bugs.
  * d/p/0001-Fix-retry-timer-not-being-unregistered-properly.patch:
    - Fix retry timer not being unregistered properly
  * d/p/0002-Fix-memory-leak-during-socket-shutdown.patch:
    - Fix memory leak during socket shutdown (LP: #1840483)
  * d/p/0003-Merged-mouse-drift-fix-from-synergy-core.patch:
    - Merged mouse drift fix from synergy-core

 -- Unit 193 <email address hidden> Wed, 11 Sep 2019 19:49:28 -0400

Changed in barrier (Ubuntu):
status: New → Fix Released
Changed in pmwiki:
status: Unknown → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.