Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • P polkit
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 121
    • Issues 121
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 19
    • Merge requests 19
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • polkit
  • polkit
  • Issues
  • #130

Closed
Open
Created Oct 19, 2020 by Deyneko Aleksey@kostap8

g_object_unref() memory leak

OS:

  • centos 8
  • fedora 32

My test code (tpol.c):

#include <polkit/polkit.h>

int main(int argc, char *argv[])
{
  int i;
  for (i = 0; i < 60; i++)
  {
    PolkitAuthority *pa = NULL;
    pa = polkit_authority_get_sync(NULL, NULL);
    g_object_unref(pa);
    sleep(1);
  }
  return 0;
}

compile options:

gcc -g `pkg-config --cflags glib-2.0 polkit-gobject-1` -o tpolkit tpol.c `pkg-config --libs glib-2.0 polkit-gobject-1`

valgrind options: valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes --verbose --log-file=valgrind-out.txt --num-callers=30 ./tpolkit

result:

==2765== LEAK SUMMARY:
==2765==    definitely lost: 0 bytes in 0 blocks
==2765==    indirectly lost: 0 bytes in 0 blocks
==2765==      possibly lost: 2,416 bytes in 26 blocks
==2765==    still reachable: 141,686 bytes in 2,154 blocks
==2765==                       of which reachable via heuristic:
==2765==                         length64           : 832 bytes in 16 blocks
==2765==                         newarray           : 1,728 bytes in 28 blocks
==2765==         suppressed: 0 bytes in 0 blocks
==2765==
==2765== ERROR SUMMARY: 26 errors from 26 contexts (suppressed: 0 from 0)

If run in an infinite loop, memory keeps leaking. How I can un-allocate PolkitAuthority memory?

The original issue was associated with pcsc-lite daemon (pcscd): https://github.com/LudovicRousseau/PCSC/issues/87

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking