Created attachment 1205662[details]
polkit-valgrind-debug.log
User problem description:
"""
polkitd process starts with 27Mb of memory footprint and grows to over 1G within a day or two
RHEL 7.2 with Gnome, all latest patches applied
always, while the box is up, reproducible
"""
When installing debug packages and run polkit under
valgrind, a sample of the leaks is attached.
On another valgrind run, but before installing debuginfo
packages, and run for a longer time a larger leak was detected:
==8970== 6,785,263 bytes in 344,167 blocks are definitely lost in loss record 2,375 of 2,375
==8970== at 0x4C29BFD: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==8970== by 0x5CD11E6: ??? (in /usr/lib64/libmozjs-17.0.so)
==8970== by 0x115B49: ??? (in /usr/lib/polkit-1/polkitd)
==8970== by 0x5C57868: ??? (in /usr/lib64/libmozjs-17.0.so)
==8970== by 0x5C50E28: ??? (in /usr/lib64/libmozjs-17.0.so)
==8970== by 0x5C5774C: ??? (in /usr/lib64/libmozjs-17.0.so)
==8970== by 0x5C579C8: ??? (in /usr/lib64/libmozjs-17.0.so)
==8970== by 0x5C57D14: ??? (in /usr/lib64/libmozjs-17.0.so)
==8970== by 0x5BC3559: JS_CallFunctionName (in /usr/lib64/libmozjs-17.0.so)
==8970== by 0x114884: ??? (in /usr/lib/polkit-1/polkitd)
==8970== by 0x118AFC: ??? (in /usr/lib/polkit-1/polkitd)
==8970== by 0x1194DF: ??? (in /usr/lib/polkit-1/polkitd)
Created attachment 1206930[details]
polkit-valgrind-debug--test_package.log
User run a test package under valgrind over the
weekend with this patch:
diff -up polkit-0.112/src/polkitbackend/polkitbackendjsauthority.c.orig polkit-0.112/src/polkitbackend/polkitbackendjsauthority.c
--- polkit-0.112/src/polkitbackend/polkitbackendjsauthority.c.orig 2016-09-30 16:05:49.011691879 -0300
+++ polkit-0.112/src/polkitbackend/polkitbackendjsauthority.c 2016-09-30 16:06:07.547670140 -0300
@@ -1420,7 +1420,6 @@ js_polkit_spawn (JSContext *cx,
goto out;
}
s = JS_EncodeString (cx, JSVAL_TO_STRING (elem_val));
- s = JS_EncodeString (cx, JSVAL_TO_STRING (elem_val));
argv[n] = g_strdup (s);
JS_free (cx, s);
}
and it appears to not have leaks, just not released
resources at exit.
Created attachment 1205662 [details] polkit-valgrind-debug.log User problem description: """ polkitd process starts with 27Mb of memory footprint and grows to over 1G within a day or two RHEL 7.2 with Gnome, all latest patches applied always, while the box is up, reproducible """ When installing debug packages and run polkit under valgrind, a sample of the leaks is attached. On another valgrind run, but before installing debuginfo packages, and run for a longer time a larger leak was detected: ==8970== 6,785,263 bytes in 344,167 blocks are definitely lost in loss record 2,375 of 2,375 ==8970== at 0x4C29BFD: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==8970== by 0x5CD11E6: ??? (in /usr/lib64/libmozjs-17.0.so) ==8970== by 0x115B49: ??? (in /usr/lib/polkit-1/polkitd) ==8970== by 0x5C57868: ??? (in /usr/lib64/libmozjs-17.0.so) ==8970== by 0x5C50E28: ??? (in /usr/lib64/libmozjs-17.0.so) ==8970== by 0x5C5774C: ??? (in /usr/lib64/libmozjs-17.0.so) ==8970== by 0x5C579C8: ??? (in /usr/lib64/libmozjs-17.0.so) ==8970== by 0x5C57D14: ??? (in /usr/lib64/libmozjs-17.0.so) ==8970== by 0x5BC3559: JS_CallFunctionName (in /usr/lib64/libmozjs-17.0.so) ==8970== by 0x114884: ??? (in /usr/lib/polkit-1/polkitd) ==8970== by 0x118AFC: ??? (in /usr/lib/polkit-1/polkitd) ==8970== by 0x1194DF: ??? (in /usr/lib/polkit-1/polkitd)