osx - Conditional jump or move depends on uninitialised value(s) on a simple C program -


this question has answer here:

i c newbie , learning valgrind.

the following program. compiles fine, when run valgrind, see "conditional jump or move depends on uninitialised value(s)" stack trace.

i trying find uninitialised value in program. seeing similar output when use "--track-origins=yes" well.

i tried looking @ other questions on stack overflow, not find definitive answer on this.

where uninitialised value?

code:

  1 #include <stdio.h>   2    3 int main()   4 {   5    int x = 5;   6    x = 6;   7    printf ("hello world %d\n", x);   8    9    return 0;  10 } 

valgrind output below.

==10154== conditional jump or move depends on uninitialised value(s) ==10154==    @ 0x1003fac3f: _platform_memchr$variant$haswell (in /usr/lib/system/libsystem_platform.dylib) ==10154==    0x1001eeb96: __sfvwrite (in /usr/lib/system/libsystem_c.dylib) ==10154==    0x1001f8fe5: __vfprintf (in /usr/lib/system/libsystem_c.dylib) ==10154==    0x10021e9ae: __v2printf (in /usr/lib/system/libsystem_c.dylib) ==10154==    0x10021ec80: __xvprintf (in /usr/lib/system/libsystem_c.dylib) ==10154==    0x1001f4b71: vfprintf_l (in /usr/lib/system/libsystem_c.dylib) ==10154==    0x1001f29d7: printf (in /usr/lib/system/libsystem_c.dylib) ==10154==    0x100000f5d: main (ex1.c:7) ==10154==  hello world 6 

valgrind might indicating uninitialised value used within system library beyond scope of program, evidenced number of times "(in /usr/lib/system/libsystem_c.dylib)" appears in trace you've quoted

it might or might not valgrind error. valgrind has historically had serious problems when running on os x. there other stable options! i've heard quite bit of commotion xcode instruments, /usr/bin/leaks , /usr/bin/malloc_history, example...


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -