Bug 347379

Summary: valgrind --leak-check=full memleak errors from system libraries in OS X 10.8
Product: [Developer tools] valgrind Reporter: Rhys Kidd <rhyskidd>
Component: memcheckAssignee: Julian Seward <jseward>
Status: RESOLVED FIXED    
Severity: normal CC: jhi, mark, rhyskidd
Priority: NOR    
Version: 3.10 SVN   
Target Milestone: ---   
Platform: MacPorts   
OS: macOS   
See Also: https://bugs.kde.org/show_bug.cgi?id=217236
Latest Commit: Version Fixed In:
Sentry Crash Report:
Bug Depends on:    
Bug Blocks: 304259    
Attachments: Proposed patch

Description Rhys Kidd 2015-05-07 11:57:49 UTC
+++ This bug was initially created as a clone of Bug #344543 +++

I'm in OS X 10.8 (Mountain Lion), uname -r shows "12.6.0" for the kernel version.

My "cc -v" says:

Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin12.6.0
Thread model: posix

My C program, "cat zero.c":

int main() { return 0; }

With "valgrind ./zero" I get no errors, but with "valgrind --leak-check=full" I get 18 memleak errors from system libraries. This includes from malloc_zone_malloc() and friends.



Reproducible: Always

Steps to Reproduce:
1. See the details.
2.
3.

Actual Results:  
Got errors from system libraries.


Expected Results:  
No errors from system libraries.  (Or if they have some, suppressed.)
Comment 1 Rhys Kidd 2015-05-07 12:23:46 UTC
Created attachment 92477 [details]
Proposed patch
Comment 2 Rhys Kidd 2015-05-07 12:24:58 UTC
Proposed patch addresses test case and the following related regression tests, which otherwise fail on OS X 10.8:

$ perl tests/vg_regtest memcheck/tests/leak-delta memcheck/tests/threadname_xml none/tests/manythreads drd/tests/unit_bitmap drd/tests/unit_vc
leak-delta:      valgrind   -q --leak-check=yes --show-reachable=yes --leak-resolution=high ./leak-delta 
threadname_xml:  valgrind   --xml=yes --xml-fd=2 --log-file=/dev/null ./threadname 
manythreads:     valgrind   ./manythreads 
unit_bitmap:     valgrind   -q --tool=memcheck --leak-check=full --show-reachable=yes ./unit_bitmap -s 93 -t 97 -q
unit_vc:         valgrind   -q --tool=memcheck --leak-check=full --show-reachable=yes ./unit_vc 

== 5 tests, 0 stderr failures, 0 stdout failures, 0 stderrB failures, 0 stdoutB failures, 0 post failures ==
Comment 3 Rhys Kidd 2015-05-07 13:20:54 UTC
Resolved in r15190.