Bug 232235 - devel/valgrind doesn't find trivial leak on head anymore, works on stable/11
Summary: devel/valgrind doesn't find trivial leak on head anymore, works on stable/11
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Only Me
Assignee: Niclas Zeising
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2018-10-14 10:06 UTC by Michael Tuexen
Modified: 2019-03-31 16:25 UTC (History)
2 users (show)

See Also:


Attachments
Sample program leaking 1KB (83 bytes, text/plain)
2018-10-14 10:06 UTC, Michael Tuexen
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Tuexen freebsd_committer 2018-10-14 10:06:45 UTC
Created attachment 198117 [details]
Sample program leaking 1KB

When testing valgrind on a stable/11 amd64 system with the attached test program leak.c results in what is expected:

tuexen@stable11:~ % cc -o leak leak.c
tuexen@stable11:~ % valgrind --leak-check=full ./leak
==56478== Memcheck, a memory error detector
==56478== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==56478== Using Valgrind-3.10.1 and LibVEX; rerun with -h for copyright info
==56478== Command: ./leak
==56478== 
==56478== 
==56478== HEAP SUMMARY:
==56478==     in use at exit: 1,024 bytes in 1 blocks
==56478==   total heap usage: 1 allocs, 0 frees, 1,024 bytes allocated
==56478== 
==56478== 1,024 bytes in 1 blocks are definitely lost in loss record 1 of 1
==56478==    at 0x4C255B5: malloc (in /usr/local/lib/valgrind/vgpreload_memcheck-amd64-freebsd.so)
==56478==    by 0x4007BA: main (in /usr/home/tuexen/leak)
==56478== 
==56478== LEAK SUMMARY:
==56478==    definitely lost: 1,024 bytes in 1 blocks
==56478==    indirectly lost: 0 bytes in 0 blocks
==56478==      possibly lost: 0 bytes in 0 blocks
==56478==    still reachable: 0 bytes in 0 blocks
==56478==         suppressed: 0 bytes in 0 blocks
==56478== 
==56478== For counts of detected and suppressed errors, rerun with: -v
==56478== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)

whereas on a head system (r339354) amd64 I get:

tuexen@epyc:~ % cc -o leak leak.c
tuexen@epyc:~ % valgrind ./leak
==1760== Memcheck, a memory error detector
==1760== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==1760== Using Valgrind-3.10.1 and LibVEX; rerun with -h for copyright info
==1760== Command: ./leak
==1760== 
==1760== 
==1760== HEAP SUMMARY:
==1760==     in use at exit: 0 bytes in 0 blocks
==1760==   total heap usage: 0 allocs, 0 frees, 0 bytes allocated
==1760== 
==1760== All heap blocks were freed -- no leaks are possible
==1760== 
==1760== For counts of detected and suppressed errors, rerun with: -v
==1760== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
Comment 1 Walter Schwarzenfeld freebsd_triage 2019-03-09 08:38:51 UTC
Maintainership dropped ports r495096.
Comment 2 Walter Schwarzenfeld freebsd_triage 2019-03-10 11:45:54 UTC
Assign to new maintainer.
Comment 3 Nazim Can Bedir 2019-03-31 16:25:49 UTC
This is also the case on 12.0-RELEASE (r3416666), as shown below:

$ uname -a
FreeBSD haruko.local 12.0-RELEASE FreeBSD 12.0-RELEASE r341666 GENERIC  amd64
$ valgrind ./trivial
==12924== Memcheck, a memory error detector
==12924== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==12924== Using Valgrind-3.10.1 and LibVEX; rerun with -h for copyright info
==12924== Command: ./trivial
==12924== 
==12924== 
==12924== HEAP SUMMARY:
==12924==     in use at exit: 0 bytes in 0 blocks
==12924==   total heap usage: 0 allocs, 0 frees, 0 bytes allocated
==12924== 
==12924== All heap blocks were freed -- no leaks are possible
==12924== 
==12924== For counts of detected and suppressed errors, rerun with: -v
==12924== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)