openconnect is consuming huge amount of memory

Bug #1475199 reported by Viktor Pal
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
openconnect (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

After a few days of use openconnect is starting to consume huge amounts of memory (3,7GB).

openconnect is used through network manager and this is the ps output:
USER PID %CPU %MEM SZ RSS STIME TIME COMMAND
nm-open+ 2289 1.3 48.0 - 3885440 Jul14 00:33:25 /usr/sbin/openconnect --servercert ************************************************** --syslog --cookie-on-stdin --script /usr/lib/NetworkManager/nm-openconnect-service-openconnect-helper --interface vpn0 host.name:443

It seems like a memory leak or something similar.

The error can be reproduced consistently and appears to be happening after 2-5 days.
It does not seem to be a constantly increasing leak as I have monitored the process and memory usage was normal for a few days and after that when I started working in the morning I realized the high memory usage.

I have even seen OOMs in the kernel log:
/var/log/syslog.6.gz:Jul 10 10:18:21 hostname kernel: [173651.909881] [ 4355] 0 4355 38192 2 46 208 0 nm-openconnect-
/var/log/syslog.6.gz:Jul 10 10:18:21 hostname kernel: [173651.909882] [ 4367] 122 4367 2706452 270484 5278 2410868 0 openconnect
/var/log/syslog.6.gz:Jul 10 10:18:21 hostname kernel: [173651.909978] Out of memory: Kill process 4367 (openconnect) score 586 or sacrifice child
/var/log/syslog.6.gz:Jul 10 10:18:21 hostname kernel: [173651.910001] Killed process 4367 (openconnect) total-vm:10825808kB, anon-rss:1081936kB, file-rss:0kB

The only way I could find to fix this is disconnect and reconnect.

This is a serious issue and prevents me from working.

I have been using openconnect in the last 4,5 years and I havent experienced this before, but after upgrading to 15.04.

ProblemType: Bug
DistroRelease: Ubuntu 15.04
Package: openconnect 6.00-1
ProcVersionSignature: Ubuntu 3.19.0-22.22-generic 3.19.8-ckt1
Uname: Linux 3.19.0-22-generic x86_64
ApportVersion: 2.17.2-0ubuntu1.1
Architecture: amd64
CurrentDesktop: GNOME-Flashback:Unity
Date: Thu Jul 16 10:17:02 2015
InstallationDate: Installed on 2015-06-26 (19 days ago)
InstallationMedia: Ubuntu-GNOME 15.04 "Vivid Vervet" - Release amd64 (20150422)
SourcePackage: openconnect
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Viktor Pal (deere) wrote :
description: updated
description: updated
Viktor Pal (deere)
description: updated
Revision history for this message
Viktor Pal (deere) wrote :

Additional useful info could be that I'm running rsync and downloading multiple 10 GBs through the VPN connection.
I don't know if this is related to the crashes though.

Revision history for this message
dwmw2 (dwmw2) wrote :

OpenConnect 6.00 is quite old. We've fixed a number of memory leaks and completely revamped the packet queue handling since then. Please could you try to reproduce with 7.06? If you can, it'll be more interesting.

Revision history for this message
Viktor Pal (deere) wrote :

Thanks for taking the time to pay attention to this bug.
Is there a deb package available for 15.04 from the 7.06 version or should try to build it myself for 15.04 from the wily source package here: http://packages.ubuntu.com/source/wily/openconnect?

Revision history for this message
Mike Miller (mtmiller) wrote :

You could try installing the 7.06-2 debs from https://launchpad.net/ubuntu/wily/+source/openconnect on 15.04, they may work fine without needing to rebuild from source. If not, then yes rebuild the 7.06-2 source package locally.

Revision history for this message
dwmw2 (dwmw2) wrote :

If you upgrade the package I think the library soname changed so you'd also need to upgrade network-manager-penconnect.

Might be simpler just to build and drop a new /usr/sbin/openconnect in place.

Revision history for this message
Viktor Pal (deere) wrote :

Okay I had to rebuild the wily deb to be able to test openconnect 7.
Installing it did not work as it has a lot of dependencies that are unmet in 15.04.

I did not have to build network-manager-openconnect as it does not use the lib it seems only the command line utility:
lsof | grep libopenconnect
openconne 27989 nm-openconnect mem REG 252,3 211280 13117700 /usr/lib/x86_64-linux-gnu/libopenconnect.so.5.1.0

This is what I currently have installed:
ii libopenconnect-dev:amd64 6.00-1 amd64 open client for Cisco AnyConnect VPN - development files
ii libopenconnect3:amd64 6.00-1 amd64 open client for Cisco AnyConnect VPN - shared library
ii libopenconnect5:amd64 7.06-2 amd64 open client for Cisco AnyConnect VPN - shared library
ii network-manager-openconnect 0.9.10.0-1ubuntu2 amd64 network management framework (OpenConnect plugin)
ii network-manager-openconnect-gnome 0.9.10.0-1ubuntu2 amd64 network management framework (OpenConnect plugin GNOME GUI)
ii openconnect 7.06-2 amd64 open client for Cisco AnyConnect VPN

# /usr/sbin/openconnect --version
OpenConnect version v7.06
Using GnuTLS. Features present: PKCS#11, RSA software token, HOTP software token, TOTP software token, DTLS

I will come back to this thread in 1-2 weeks with the results or sooner if I'm able to reproduce.

I will be still running the mentioned rsync commands too, so if the error is related I should be able to reproduce it.

Revision history for this message
Viktor Pal (deere) wrote :

I have not seen the memory leak or any other issue with the 7.06 version of openconnect installed.

Mike Miller (mtmiller)
Changed in openconnect (Ubuntu):
status: New → 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.