Bug 1430813

Summary: Don't leak the name_owner and result in dbus_proxy_reload_properties_sync
Product: Red Hat Enterprise Linux 7 Reporter: Debarshi Ray <debarshir>
Component: gnome-online-accountsAssignee: Debarshi Ray <debarshir>
Status: CLOSED ERRATA QA Contact: Desktop QE <desktop-qa-list>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.4CC: mcepl, tpelka
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: gnome-online-accounts-3.22.5-1.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-01 10:00:10 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Debarshi Ray 2017-03-09 16:05:33 UTC
The string returned by g_dbus_proxy_get_name_owner needs to be freed. See the attached valgrind log from https://bugzilla.redhat.com/show_bug.cgi?id=1420678

Comment 2 Debarshi Ray 2017-03-10 20:03:47 UTC
I built gnome-online-accounts-3.22.5-1.el7:
https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=12739851

Comment 4 Matěj Cepl 2017-05-30 20:15:01 UTC
This doesn’t sound good, does it? After running the new gnome-session for some twenty minutes or so:

matej@mitmanek: ~$ ps aux|grep goa-daemon
matej     5994  0.0  0.0 112668   996 pts/1    S+   22:14   0:00 grep --color=auto goa-daemon
matej    31954  0.0  0.3 1193396 46856 ?       SLl  21:20   0:01 /usr/libexec/goa-daemon
matej@mitmanek: ~$ rpm -qf /usr/libexec/goa-daemon 
gnome-online-accounts-3.22.5-1.el7.x86_64
matej@mitmanek: ~$

Is it 1.1GB VSZ memory?

Comment 5 Debarshi Ray 2017-05-31 09:02:19 UTC
(In reply to Matěj Cepl from comment #4)
> matej@mitmanek: ~$ ps aux|grep goa-daemon
> matej     5994  0.0  0.0 112668   996 pts/1    S+   22:14   0:00 grep
> --color=auto goa-daemon
> matej    31954  0.0  0.3 1193396 46856 ?       SLl  21:20   0:01
> /usr/libexec/goa-daemon
> matej@mitmanek: ~$ rpm -qf /usr/libexec/goa-daemon 
> gnome-online-accounts-3.22.5-1.el7.x86_64
> matej@mitmanek: ~$
> 
> Is it 1.1GB VSZ memory?

I think that 1193396 kB is the VmSize, and 46856 kB is the VmRSS. You can get the same values by looking at /proc/$(pidof goa-daemon)/status. The VmRSS is the most relevant figure. eg., mine is 54112 kB. We need to ensure that the VmRSS doesn't keep growing indefinitely.

VmSize is the size of the total address space being used by the process. Apart from the amount of RAM used to hold data, it includes memory mapped files (shared libraries, data files, etc.), allocated but unused memory, etc.. Therefore it can be misleading.

The easiest way to reproduce the original leak is to setup Kerberos (through the GOA UI or kinit) on a system (eg., RHEL 7) that uses the kernel's keyring as the credential cache. ie. klist(1) should have KEYRING in the first line of its output. For example:
[rishi@kolache ~]$ klist
Ticket cache: KEYRING:persistent:1000:1000
Default principal: rishi
...
...

I am sure that if you revert these two patches and rebuild a new gnome-online-accounts RPM, then the VmRSS figure will steadily creep up:

https://git.gnome.org/browse/gnome-online-accounts/commit/?h=gnome-3-22&id=3e45d21de12e23bcc0c1cfff731b2d1d2a5c408d

https://git.gnome.org/browse/gnome-online-accounts/commit/?h=gnome-3-22&id=fc28a70135f9b535fe779c8849dfb0e2a88277cb

Comment 6 Matěj Cepl 2017-05-31 09:23:50 UTC
OK, the RSS size keep steady, so I will call this bug fixed.

Comment 7 errata-xmlrpc 2017-08-01 10:00:10 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2017:2310