Created attachment 95150 [details] Is just a print hello world and at the end valgrind report definitely lost: 4,416 bytes in 4 blocks Valgrind report memory leak in OS X 10.11 (El Capitan) when there is not apparently because is not reported in OS X 10.10.3 (Yosemite) and my code not appear to have memory leak like reports in Yosemite. The output of uname -a Darwin MacBook-Pro-de-Jose.local 15.0.0 Darwin Kernel Version 15.0.0: Sat Sep 19 15:53:46 PDT 2015; root:xnu-3247.10.11~1/RELEASE_X86_64 x86_64 The output of valgrind -v ==27179== Memcheck, a memory error detector ==27179== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al. ==27179== Using Valgrind-3.11.0.SVN and LibVEX; rerun with -h for copyright info ==27179== Command: ./bug_test ==27179== --27179-- Valgrind options: --27179-- -v --27179-- Contents of /proc/version: --27179-- can't open /proc/version --27179-- Arch and hwcaps: AMD64, LittleEndian, amd64-cx16-lzcnt-rdtscp-sse3-avx-avx2-bmi --27179-- Page sizes: currently 4096, max supported 4096 --27179-- Valgrind library directory: /usr/local/Cellar/valgrind/HEAD/lib/valgrind --27179-- ./bug_test (rx at 0x100000000, rw at 0x100001000) --27179-- reading syms from primary file (2 0) --27179-- dSYM= ./bug_test.dSYM/Contents/Resources/DWARF/bug_test --27179-- dSYM does not have correct UUID (out of date?) --27179-- dSYM directory has wrong UUID; consider using --dsymutil=yes --27179-- /usr/lib/dyld (rx at 0x7fff5fc00000, rw at 0x7fff5fc37000) --27179-- reading syms from primary file (6 1226) --27179-- Scheduler: using generic scheduler lock implementation. --27179-- Reading suppressions file: /usr/local/Cellar/valgrind/HEAD/lib/valgrind/default.supp ==27179== embedded gdbserver: reading from /var/folders/z2/9nqw66c57z537xlsbl00814w0000gn/T//vgdb-pipe-from-vgdb-to-27179-by-yosef-on-??? ==27179== embedded gdbserver: writing to /var/folders/z2/9nqw66c57z537xlsbl00814w0000gn/T//vgdb-pipe-to-vgdb-from-27179-by-yosef-on-??? ==27179== embedded gdbserver: shared mem /var/folders/z2/9nqw66c57z537xlsbl00814w0000gn/T//vgdb-pipe-shared-mem-vgdb-27179-by-yosef-on-??? ==27179== ==27179== TO CONTROL THIS PROCESS USING vgdb (which you probably ==27179== don't want to do, unless you know exactly what you're doing, ==27179== or are doing some strange experiment): ==27179== /usr/local/Cellar/valgrind/HEAD/lib/valgrind/../../bin/vgdb --pid=27179 ...command... ==27179== ==27179== TO DEBUG THIS PROCESS USING GDB: start GDB like this ==27179== /path/to/gdb ./bug_test ==27179== and then give GDB the following command ==27179== target remote | /usr/local/Cellar/valgrind/HEAD/lib/valgrind/../../bin/vgdb --pid=27179 ==27179== --pid is optional if only one valgrind process is running ==27179== --27179-- REDIR: 0x7fff5fc1e5b9 (dyld:arc4random) redirected to 0x23805c069 (???) --27179-- REDIR: 0x7fff5fc24780 (dyld:strcmp) redirected to 0x23805bfcb (???) --27179-- REDIR: 0x7fff5fc1e380 (dyld:strlen) redirected to 0x23805bf9a (???) --27179-- REDIR: 0x7fff5fc1e2e0 (dyld:strcpy) redirected to 0x23805bfe7 (???) --27179-- REDIR: 0x7fff5fc21cdf (dyld:strcat) redirected to 0x23805bfab (???) --27179-- REDIR: 0x7fff5fc21d1f (dyld:strlcat) redirected to 0x23805c004 (???) --27179-- /usr/local/Cellar/valgrind/HEAD/lib/valgrind/vgpreload_core-amd64-darwin.so (rx at 0x100003000, rw at 0x100005000) --27179-- reading syms from primary file (3 10) --27179-- dSYM= /usr/local/Cellar/valgrind/HEAD/lib/valgrind/vgpreload_core-amd64-darwin.so.dSYM/Contents/Resources/DWARF/vgpreload_core-amd64-darwin.so --27179-- /usr/local/Cellar/valgrind/HEAD/lib/valgrind/vgpreload_memcheck-amd64-darwin.so (rx at 0x100007000, rw at 0x10000c000) --27179-- reading syms from primary file (68 18) --27179-- dSYM= /usr/local/Cellar/valgrind/HEAD/lib/valgrind/vgpreload_memcheck-amd64-darwin.so.dSYM/Contents/Resources/DWARF/vgpreload_memcheck-amd64-darwin.so --27179-- UNKNOWN fcntl 97! --27179-- /usr/lib/libc++.1.dylib (rx at 0x10000f000, rw at 0x100063000) --27179-- reading syms from primary file (1960 1590) --27179-- UNKNOWN fcntl 97! (repeated 2 times) --27179-- /usr/lib/libSystem.B.dylib (rx at 0x1000bf000, rw at 0x1000c1000) --27179-- reading syms from primary file (31 5) --27179-- /usr/lib/libc++abi.dylib (rx at 0x1000c6000, rw at 0x1000f0000) --27179-- reading syms from primary file (337 181) --27179-- UNKNOWN fcntl 97! (repeated 4 times) --27179-- /usr/lib/system/libcache.dylib (rx at 0x1000fe000, rw at 0x100103000) --27179-- reading syms from primary file (32 30) --27179-- /usr/lib/system/libcommonCrypto.dylib (rx at 0x100108000, rw at 0x100114000) --27179-- reading syms from primary file (214 188) --27179-- /usr/lib/system/libcompiler_rt.dylib (rx at 0x100121000, rw at 0x100129000) --27179-- reading syms from primary file (510 8) --27179-- /usr/lib/system/libcopyfile.dylib (rx at 0x100136000, rw at 0x10013f000) --27179-- reading syms from primary file (13 35) --27179-- UNKNOWN fcntl 97! (repeated 8 times) --27179-- /usr/lib/system/libcorecrypto.dylib (rx at 0x100145000, rw at 0x1001bd000) --27179-- reading syms from primary file (428 602) --27179-- /usr/lib/system/libdispatch.dylib (rx at 0x1001d5000, rw at 0x100203000) --27179-- reading syms from primary file (215 832) --27179-- /usr/lib/system/libdyld.dylib (rx at 0x10022c000, rw at 0x100230000) --27179-- reading syms from primary file (80 109) --27179-- /usr/lib/system/libkeymgr.dylib (rx at 0x100237000, rw at 0x100238000) --27179-- reading syms from primary file (12 3) --27179-- /usr/lib/system/libmacho.dylib (rx at 0x100243000, rw at 0x100249000) --27179-- reading syms from primary file (97 1) --27179-- /usr/lib/system/libquarantine.dylib (rx at 0x10024f000, rw at 0x100252000) --27179-- reading syms from primary file (67 32) --27179-- /usr/lib/system/libremovefile.dylib (rx at 0x100258000, rw at 0x10025a000) --27179-- reading syms from primary file (15 4) --27179-- UNKNOWN fcntl 97! (repeated 16 times) --27179-- /usr/lib/system/libsystem_asl.dylib (rx at 0x10025f000, rw at 0x100277000) --27179-- reading syms from primary file (222 225) --27179-- /usr/lib/system/libsystem_blocks.dylib (rx at 0x100284000, rw at 0x100286000) --27179-- reading syms from primary file (25 22) --27179-- /usr/lib/system/libsystem_c.dylib (rx at 0x10028a000, rw at 0x100318000) --27179-- reading syms from primary file (1308 746) --27179-- /usr/lib/system/libsystem_configuration.dylib (rx at 0x100343000, rw at 0x100346000) --27179-- reading syms from primary file (28 57) --27179-- /usr/lib/system/libsystem_coreservices.dylib (rx at 0x10034c000, rw at 0x10034f000) --27179-- reading syms from primary file (13 30) --27179-- /usr/lib/system/libsystem_coretls.dylib (rx at 0x100354000, rw at 0x100369000) --27179-- reading syms from primary file (115 241) --27179-- /usr/lib/system/libsystem_dnssd.dylib (rx at 0x100372000, rw at 0x10037b000) --27179-- reading syms from primary file (68 33) --27179-- /usr/lib/system/libsystem_info.dylib (rx at 0x100381000, rw at 0x1003ab000) --27179-- reading syms from primary file (526 527) --27179-- /usr/lib/system/libsystem_kernel.dylib (rx at 0x1003c0000, rw at 0x1003df000) --27179-- reading syms from primary file (1046 83) --27179-- /usr/lib/system/libsystem_m.dylib (rx at 0x1003f4000, rw at 0x100424000) --27179-- reading syms from primary file (593 1) --27179-- /usr/lib/system/libsystem_malloc.dylib (rx at 0x100430000, rw at 0x10044d000) --27179-- reading syms from primary file (102 201) --27179-- /usr/lib/system/libsystem_network.dylib (rx at 0x100456000, rw at 0x1004b5000) --27179-- reading syms from primary file (664 1939) --27179-- /usr/lib/system/libsystem_networkextension.dylib (rx at 0x1004ea000, rw at 0x1004f3000) --27179-- reading syms from primary file (82 235) --27179-- /usr/lib/system/libsystem_notify.dylib (rx at 0x1004fe000, rw at 0x100508000) --27179-- reading syms from primary file (136 53) --27179-- /usr/lib/system/libsystem_platform.dylib (rx at 0x100510000, rw at 0x100519000) --27179-- reading syms from primary file (142 158) --27179-- /usr/lib/system/libsystem_pthread.dylib (rx at 0x100521000, rw at 0x10052b000) --27179-- reading syms from primary file (163 70) --27179-- UNKNOWN fcntl 97! (repeated 32 times) --27179-- /usr/lib/system/libsystem_sandbox.dylib (rx at 0x100538000, rw at 0x10053c000) --27179-- reading syms from primary file (79 7) --27179-- /usr/lib/system/libsystem_secinit.dylib (rx at 0x100542000, rw at 0x100544000) --27179-- reading syms from primary file (3 6) --27179-- /usr/lib/system/libsystem_trace.dylib (rx at 0x100549000, rw at 0x10055b000) --27179-- reading syms from primary file (94 351) --27179-- /usr/lib/system/libunwind.dylib (rx at 0x10056d000, rw at 0x100573000) --27179-- reading syms from primary file (102 52) --27179-- /usr/lib/system/libxpc.dylib (rx at 0x10057a000, rw at 0x1005a4000) --27179-- reading syms from primary file (503 833) --27179-- /usr/lib/libobjc.A.dylib (rx at 0x1005c2000, rw at 0x100926000) --27179-- reading syms from primary file (347 935) --27179-- /usr/lib/libauto.dylib (rx at 0x100a02000, rw at 0x100a49000) --27179-- reading syms from primary file (68 658) --27179-- /usr/lib/libDiagnosticMessagesClient.dylib (rx at 0x100a5e000, rw at 0x100a60000) --27179-- reading syms from primary file (21 14) --27179-- REDIR: 0x100510c80 (libsystem_platform.dylib:_platform_memcmp) redirected to 0x10000a6e3 (_platform_memcmp) --27179-- REDIR: 0x100511220 (libsystem_platform.dylib:_platform_strncmp) redirected to 0x10000a08f (_platform_strncmp) --27179-- REDIR: 0x1004310b2 (libsystem_malloc.dylib:malloc) redirected to 0x10000851a (malloc) --27179-- REDIR: 0x10028ad20 (libsystem_c.dylib:strlen) redirected to 0x100009d1e (strlen) --27179-- REDIR: 0x100511800 (libsystem_platform.dylib:_platform_strcmp) redirected to 0x10000a121 (_platform_strcmp) --27179-- REDIR: 0x100433ea8 (libsystem_malloc.dylib:free) redirected to 0x100008962 (free) --27179-- REDIR: 0x100436441 (libsystem_malloc.dylib:calloc) redirected to 0x100008bda (calloc) --27179-- REDIR: 0x100435949 (libsystem_malloc.dylib:malloc_default_zone) redirected to 0x10000997c (malloc_default_zone) --27179-- REDIR: 0x10043256a (libsystem_malloc.dylib:malloc_zone_malloc) redirected to 0x1000087d6 (malloc_zone_malloc) --27179-- REDIR: 0x100435968 (libsystem_malloc.dylib:malloc_zone_calloc) redirected to 0x100008ddc (malloc_zone_calloc) --27179-- REDIR: 0x100435a22 (libsystem_malloc.dylib:malloc_zone_from_ptr) redirected to 0x1000099bd (malloc_zone_from_ptr) --27179-- UNKNOWN task message [id 3406, to mach_task_self(), reply 0x60f] --27179-- UNKNOWN host message [id 412, to mach_host_self(), reply 0x60f] --27179-- UNKNOWN host message [id 222, to mach_host_self(), reply 0x60f] --27179-- UNKNOWN task message [id 3410, to mach_task_self(), reply 0x60f] --27179-- REDIR: 0x100436644 (libsystem_malloc.dylib:realloc) redirected to 0x100008f7e (realloc) --27179-- REDIR: 0x1004389f0 (libsystem_malloc.dylib:malloc_zone_memalign) redirected to 0x100009514 (malloc_zone_memalign) Hola mundo ==27179== ==27179== HEAP SUMMARY: ==27179== in use at exit: 26,267 bytes in 193 blocks ==27179== total heap usage: 257 allocs, 64 frees, 31,979 bytes allocated ==27179== ==27179== Searching for pointers to 193 not-freed blocks ==27179== Checked 9,806,648 bytes ==27179== ==27179== LEAK SUMMARY: ==27179== definitely lost: 4,416 bytes in 4 blocks ==27179== indirectly lost: 2,288 bytes in 6 blocks ==27179== possibly lost: 4,880 bytes in 45 blocks ==27179== still reachable: 6,440 bytes in 13 blocks ==27179== suppressed: 8,243 bytes in 125 blocks ==27179== Rerun with --leak-check=full to see details of leaked memory ==27179== ==27179== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) --27179-- --27179-- used_suppression: 10 OSX1010:5-Leak /usr/local/Cellar/valgrind/HEAD/lib/valgrind/default.supp:788 suppressed: 3,392 bytes in 55 blocks --27179-- used_suppression: 9 OSX1010:1-Leak /usr/local/Cellar/valgrind/HEAD/lib/valgrind/default.supp:747 suppressed: 2,256 bytes in 29 blocks --27179-- used_suppression: 19 OSX1010:10-Leak /usr/local/Cellar/valgrind/HEAD/lib/valgrind/default.supp:840 suppressed: 2,595 bytes in 41 blocks ==27179== ==27179== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
Hello, Thanks for the bug report. We are aware of a general OS X issue where memory leaks are being reported in system libraries linked to your own code (i.e. in code that you cannot fix). This is not OS X 10.11 El Capitan specific, and will require some further work and refactoring to fix. It is being tracked in bz#258140. *** This bug has been marked as a duplicate of bug 258140 ***