1

I have a strange problem with my Valgrind on Yosemite. Here is my simple program:

#include <stdio.h>
int main() {
    printf("Hello world %d\n", 123);
    return 0;
}

Compiling it and then running it using Valgrind I get the following:

==48900== Conditional jump or move depends on uninitialised value(s)
==48900==    at 0x1003FBC3F: _platform_memchr$VARIANT$Haswell (in /usr/lib/system/libsystem_platform.dylib)
==48900==    by 0x1001EFB96: __sfvwrite (in /usr/lib/system/libsystem_c.dylib)
==48900==    by 0x1001F9FE5: __vfprintf (in /usr/lib/system/libsystem_c.dylib)
==48900==    by 0x10021F9AE: __v2printf (in /usr/lib/system/libsystem_c.dylib)
==48900==    by 0x10021FC80: __xvprintf (in /usr/lib/system/libsystem_c.dylib)
==48900==    by 0x1001F5B71: vfprintf_l (in /usr/lib/system/libsystem_c.dylib)
==48900==    by 0x1001F39D7: printf (in /usr/lib/system/libsystem_c.dylib)
==48900==    by 0x100000F51: main (test.c:3)
==48900==
Hello world 123
==48900==
==48900== HEAP SUMMARY:
==48900==     in use at exit: 39,212 bytes in 426 blocks
==48900==   total heap usage: 506 allocs, 80 frees, 45,340 bytes allocated
==48900==
==48900== LEAK SUMMARY:
==48900==    definitely lost: 16 bytes in 1 blocks
==48900==    indirectly lost: 0 bytes in 0 blocks
==48900==      possibly lost: 13,058 bytes in 117 blocks
==48900==    still reachable: 26,138 bytes in 308 blocks
==48900==         suppressed: 0 bytes in 0 blocks
==48900== Rerun with --leak-check=full to see details of leaked memory
==48900==
==48900== For counts of detected and suppressed errors, rerun with: -v
==48900== Use --track-origins=yes to see where uninitialised values come from
==48900== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)

Any advice?

Iharob Al Asimi
  • 52,653
  • 6
  • 59
  • 97
Dave Qorashi
  • 326
  • 2
  • 11
  • This seems to be a bug in your c library or in valigrind for your platform. – Iharob Al Asimi Mar 08 '15 at 17:35
  • I didn't know Valgrind had support for Yosemite yet; last I heard the [latest release support](http://valgrind.org/downloads/current.html) for OS X was Mavericks. Did that recently change? (asks the guy with Yosemite 10.10.2 on his MBAir). – WhozCraig Mar 08 '15 at 17:36
  • @WhozCraig that's an interesting point, when I reinstall **glibc** because of security updates valgrind starts having exactly this kind of behavior. Until I recompile it if it supports the new **glibc** which is often not the case and then I have to wait for new valgrind release. – Iharob Al Asimi Mar 08 '15 at 17:37
  • Interesting. I installed it using brew. – Dave Qorashi Mar 08 '15 at 17:47
  • brew info gives this: valgrind: stable 3.10.1, HEAD – Dave Qorashi Mar 08 '15 at 17:47
  • This is useful: http://stackoverflow.com/questions/26564125/yosemite-and-valgrind Whilst it may have been the case in past OS X release cycles that Valgrind took a period of time before achieving reasonable feature support, basic OS X 10.10 support is already available in Valgrind trunk due to significant work on pre-release Yosemite – Dave Qorashi Mar 08 '15 at 17:50

1 Answers1

0

This is useful: Yosemite and Valgrind Whilst it may have been the case in past OS X release cycles that Valgrind took a period of time before achieving reasonable feature support, basic OS X 10.10 support is already available in Valgrind trunk due to significant work on pre-release Yosemite – Dave Qorashi

Community
  • 1
  • 1
Armali
  • 18,255
  • 14
  • 57
  • 171