Created attachment 838160 [details] valgrind full log Description of problem: Found some memory leak when using sandbox Version-Release number of selected component (if applicable): libvirt-sandbox-0.5.0-7.el7.x86_64 How reproducible: 100% Steps to Reproduce: 1:# valgrind -v --leak-check=full virt-sandbox-service -c lxc:/// create -C -u httpd.service mytest2 ==4585== LEAK SUMMARY: ==4585== definitely lost: 232 bytes in 4 blocks ==4585== indirectly lost: 0 bytes in 0 blocks ==4585== possibly lost: 1,233,820 bytes in 4,736 blocks ==4585== still reachable: 3,148,154 bytes in 20,956 blocks ==4585== suppressed: 0 bytes in 0 blocks ==4585== Reachable blocks (those to which a pointer was found) are not shown. ==4585== To see them, rerun with: --leak-check=full --show-leak-kinds=all ==4585== ==4585== ERROR SUMMARY: 850 errors from 850 contexts (suppressed: 3 from 3) 2:# valgrind -v --leak-check=full virt-sandbox -c lxc:/// /bin/sh -n test ==4686== LEAK SUMMARY: ==4686== definitely lost: 29 bytes in 3 blocks ==4686== indirectly lost: 8 bytes in 1 blocks ==4686== possibly lost: 29,647 bytes in 155 blocks ==4686== still reachable: 671,641 bytes in 3,277 blocks ==4686== suppressed: 0 bytes in 0 blocks ==4686== Reachable blocks (those to which a pointer was found) are not shown. Actual results: Expected results: no memory leak Additional info:
(In reply to zhe peng from comment #0) > Steps to Reproduce: > 1:# valgrind -v --leak-check=full virt-sandbox-service -c lxc:/// create -C > -u httpd.service mytest2 > ==4585== LEAK SUMMARY: > ==4585== definitely lost: 232 bytes in 4 blocks I think these leaks are not introduced by libvirt-sandbox. > 2:# valgrind -v --leak-check=full virt-sandbox -c lxc:/// /bin/sh -n test > ==4686== LEAK SUMMARY: > ==4686== definitely lost: 29 bytes in 3 blocks These leaks are introduced by g_option_context_free(context) in bin/virt-sandbox.c or in glib library. ==11796== 15 bytes in 2 blocks are definitely lost in loss record 204 of 1,293 ==11796== at 0x4A06409: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==11796== by 0x3E8784D89E: g_malloc (gmem.c:159) ==11796== by 0x3E87864C37: g_strndup (gstrfuncs.c:428) ==11796== by 0x3E8782CBD3: g_locale_to_utf8 (gconvert.c:1214) ==11796== by 0x3E878515C5: parse_arg.isra.12 (goption.c:1160) ==11796== by 0x3E87851E43: parse_short_option (goption.c:1425) ==11796== by 0x3E87853246: g_option_context_parse (goption.c:1926) ==11796== by 0x401DC2: main (virt-sandbox.c:121) ==11796== 24 (16 direct, 8 indirect) bytes in 1 blocks are definitely lost in loss record 523 of 1,293 ==11796== at 0x4A06409: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==11796== by 0x3E8784D89E: g_malloc (gmem.c:159) ==11796== by 0x3E87851944: parse_arg.isra.12 (goption.c:1190) ==11796== by 0x3E878530F4: g_option_context_parse (goption.c:1578) ==11796== by 0x401DC2: main (virt-sandbox.c:121)
Closing old bug, virt-sandbox-service feature has been deleted.