Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 22 Feb 2015 05:34:02 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-bugs@FreeBSD.org
Subject:   [Bug 195128] Memory leaks in lib/libpam/modules due to memory handling with login_getcapstr, et al
Message-ID:  <bug-195128-8-XPOliqNla6@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-195128-8@https.bugs.freebsd.org/bugzilla/>
References:  <bug-195128-8@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=195128

--- Comment #8 from darius@dons.net.au ---
I fixed some bugs with my previous fix - cap_mkdb would crash processing the
termcap file.

I pushed them to a branch on github -
https://github.com/DanielO/freebsd/tree/cgetstr-leak

root@freebsdhead:~ # valgrind --leak-check=full
/usr/obj/src/FreeBSD-HEAD/usr.bin/cap_mkdb/cap_mkdb -l -f /tmp/termcap
/src/FreeBSD-HEAD/share/termcap/termcap
==95888== Memcheck, a memory error detector
==95888== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
==95888== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
==95888== Command: /usr/obj/src/FreeBSD-HEAD/usr.bin/cap_mkdb/cap_mkdb -l -f
/tmp/termcap /src/FreeBSD-HEAD/share/termcap/termcap
==95888==
==95888==
==95888== HEAP SUMMARY:
==95888==     in use at exit: 2,285 bytes in 2 blocks
==95888==   total heap usage: 5,131 allocs, 5,129 frees, 6,569,582 bytes
allocated
==95888==
==95888== 16 bytes in 1 blocks are definitely lost in loss record 1 of 2
==95888==    at 0x1007293: malloc (in
/usr/local/lib/valgrind/vgpreload_memcheck-amd64-freebsd.so)
==95888==    by 0x12A1B0F: strdup (strdup.c:47)
==95888==    by 0x400D49: main (cap_mkdb.c:120)
==95888==
==95888== LEAK SUMMARY:
==95888==    definitely lost: 16 bytes in 1 blocks
==95888==    indirectly lost: 0 bytes in 0 blocks
==95888==      possibly lost: 0 bytes in 0 blocks
==95888==    still reachable: 2,269 bytes in 1 blocks
==95888==         suppressed: 0 bytes in 0 blocks
==95888== Reachable blocks (those to which a pointer was found) are not shown.
==95888== To see them, rerun with: --leak-check=full --show-reachable=yes
==95888==
==95888== For counts of detected and suppressed errors, rerun with: -v
==95888== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)

root@freebsdhead:~ # valgrind --leak-check=full
/usr/obj/src/FreeBSD-HEAD/lib/libc/tests/gen/getcap_test cgetstr_leak
==96919== Memcheck, a memory error detector
==96919== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
==96919== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
==96919== Command: /usr/obj/src/FreeBSD-HEAD/lib/libc/tests/gen/getcap_test
cgetstr_leak
==96919==
getcap_test: WARNING: Running test cases outside of kyua(1) is unsupported
getcap_test: WARNING: No isolation nor timeout control is being applied; you
may get unexpected failures; see atf-test-case(4)
OK: leaked 0 bytes
passed
==96919==
==96919== HEAP SUMMARY:
==96919==     in use at exit: 7,267 bytes in 40 blocks
==96919==   total heap usage: 3,103 allocs, 3,063 frees, 4,208,879 bytes
allocated
==96919==
==96919== LEAK SUMMARY:
==96919==    definitely lost: 0 bytes in 0 blocks
==96919==    indirectly lost: 0 bytes in 0 blocks
==96919==      possibly lost: 0 bytes in 0 blocks
==96919==    still reachable: 7,267 bytes in 40 blocks
==96919==         suppressed: 0 bytes in 0 blocks
==96919== Reachable blocks (those to which a pointer was found) are not shown.
==96919== To see them, rerun with: --leak-check=full --show-reachable=yes
==96919==
==96919== For counts of detected and suppressed errors, rerun with: -v
==96919== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

-- 
You are receiving this mail because:
You are the assignee for the bug.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-195128-8-XPOliqNla6>