Description of problem: When a program is compiled with the "-static" option is run under valgrind lots of warnings about uninitialized values being used. Version-Release number of selected component (if applicable): valgrind-3.2.0-3.1 gcc-4.1.1-13 glibc-2.4.90-13 How reproducible: Always Steps to Reproduce: 1. Compile attached example hellow world program "gcc -o hello.s -static hello.c" #include <stdlib.h> #include <stdio.h> int main(int argc, char *argv[]) { printf("hello, world.\n"); return EXIT_SUCCESS; } 2. Run with "valgrind ./hello.s" 3. See the warnings like the following Actual results: ==29479== Conditional jump or move depends on uninitialised value(s) ==29479== at 0x8051B26: __register_atfork (in /home/wcohen/hello) ==29479== by 0x804BBFA: ptmalloc_init (in /home/wcohen/hello) ==29479== by 0x804F00D: malloc_hook_ini (in /home/wcohen/hello) ==29479== by 0x804EB24: malloc (in /home/wcohen/hello) ==29479== by 0x8069E09: _dl_init_paths (in /home/wcohen/hello) ==29479== by 0x805220A: _dl_non_dynamic_init (in /home/wcohen/hello) ==29479== by 0x805273F: __libc_init_first (in /home/wcohen/hello) ==29479== by 0x80483AC: (below main) (in /home/wcohen/hello) ==29479== Expected results: Output of Valgrind to be like the non-static compiled version of hello world. Additional info: It looks like the problem areas are like the following: 8051b1e: 65 83 3d 0c 00 00 00 cmpl $0x0,%gs:0xc 8051b25: 00 8051b26: 74 01 je 8051b29 <__register_atfork+0x15>
Valgrind not expected to work with statically linked programs. Programs should not be linked statically when using valgrind. http://valgrind.org/docs/manual/faq.html#faq.notfound