Bug 486577 - Every PolKitContext object leaks a lot of memory
Every PolKitContext object leaks a lot of memory
Status: CLOSED WONTFIX
Product: Fedora
Classification: Fedora
Component: PolicyKit (Show other bugs)
9
All Linux
low Severity medium
: ---
: ---
Assigned To: David Zeuthen
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-02-20 07:48 EST by Daniel Berrange
Modified: 2013-03-05 22:57 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-07-14 11:13:45 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Fix memory leaks in PolkitContext object (812 bytes, patch)
2009-02-20 07:49 EST, Daniel Berrange
no flags Details | Diff

  None (edit)
Description Daniel Berrange 2009-02-20 07:48:07 EST
Description of problem:
Running libvirtd under valgrind shows that every PolkitContext instance created and then unrefed leaks alot of memory.

eg, after just 10 client connections are made, it has leaked 300 KB of data

==17312== 56 bytes in 2 blocks are possibly lost in loss record 14 of 63
==17312==    at 0x4004BA2: calloc (vg_replace_malloc.c:397)
==17312==    by 0x7BFA214: kit_malloc0 (kit-memory.c:293)
==17312==    by 0x7BF3153: _polkit_policy_file_entry_new (polkit-policy-file-entry.c:104)
==17312==    by 0x7BF45BB: _end (polkit-policy-file.c:546)
==17312==    by 0x23CC66: doContent (xmlparse.c:2449)
==17312==    by 0x23DBA0: contentProcessor (xmlparse.c:2023)
==17312==    by 0x23F58E: doProlog (xmlparse.c:3905)
==17312==    by 0x23FC76: prologProcessor (xmlparse.c:3635)
==17312==    by 0x23652B: XML_ParseBuffer (xmlparse.c:1573)
==17312==    by 0x2379E2: XML_Parse (xmlparse.c:1544)
==17312==    by 0x7BF41D2: polkit_policy_file_new (polkit-policy-file.c:705)
==17312==    by 0x7BF4DFA: _polkit_policy_cache_new (polkit-policy-cache.c:160)
==17312== 
==17312== 
==17312== 992 bytes in 28 blocks are definitely lost in loss record 42 of 63
==17312==    at 0x4006AEE: malloc (vg_replace_malloc.c:207)
==17312==    by 0xB8247F: strdup (strdup.c:43)
==17312==    by 0x7BFB28C: kit_strdup (kit-string.c:119)
==17312==    by 0x7BF07C2: polkit_context_init (polkit-context.c:154)
==17312==    by 0x8059FD6: remoteDispatchAuthPolkit (remote.c:3080)
==17312==    by 0x8060335: remoteDispatchClientRequest (remote.c:323)
==17312==    by 0x805497E: qemudWorker (qemud.c:1460)
==17312==    by 0xCB032E: start_thread (pthread_create.c:297)
==17312==    by 0xBEB20D: clone (in /lib/libc-2.8.so)
==17312== 
==17312== 
==17312== 294,861 (696 direct, 294,165 indirect) bytes in 78 blocks are definitely lost in loss record 50 of 63
==17312==    at 0x4004BA2: calloc (vg_replace_malloc.c:397)
==17312==    by 0x7BFA214: kit_malloc0 (kit-memory.c:293)
==17312==    by 0x7BF4C92: _polkit_policy_cache_new (polkit-policy-cache.c:110)
==17312==    by 0x7BEFEEC: polkit_context_get_policy_cache (polkit-context.c:582)
==17312==    by 0x7BEFFD0: polkit_context_is_caller_authorized (polkit-context.c:777)
==17312==    by 0x805A1B9: remoteDispatchAuthPolkit (remote.c:3095)
==17312==    by 0x8060335: remoteDispatchClientRequest (remote.c:323)
==17312==    by 0x805497E: qemudWorker (qemud.c:1460)
==17312==    by 0xCB032E: start_thread (pthread_create.c:297)
==17312==    by 0xBEB20D: clone (in /lib/libc-2.8.so)


It is pretty clear looking at the polkit_context_unref() method, that none of the internal objects for the PolkitContext object are being unrefed/freed.


Version-Release number of selected component (if applicable):
PolicyKit-0.8-4.fc9

How reproducible:
Always

Steps to Reproduce:
1. Run libvirtd under valgrind
2. Connect from GNOME session using virsh
3. Stop libvirtd
  
Actual results:
valgrind reports lots of lost memory

Expected results:


Additional info:
Comment 1 Daniel Berrange 2009-02-20 07:49:13 EST
Created attachment 332697 [details]
Fix memory leaks in PolkitContext object

This patch fixes the memory leaks seen in libvirt usage
Comment 2 Bug Zapper 2009-06-09 23:34:41 EDT
This message is a reminder that Fedora 9 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 9.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '9'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 9's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 9 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 3 Bug Zapper 2009-07-14 11:13:45 EDT
Fedora 9 changed to end-of-life (EOL) status on 2009-07-10. Fedora 9 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.

Note You need to log in before you can comment on or make changes to this bug.