Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 200535 - Valgrind flags lots of uninitialized locations with programs compiled with "-static"
Valgrind flags lots of uninitialized locations with programs compiled with "-...
Product: Fedora
Classification: Fedora
Component: valgrind (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Depends On:
  Show dependency treegraph
Reported: 2006-07-28 10:49 EDT by William Cohen
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-07-31 09:16:40 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description William Cohen 2006-07-28 10:49:22 EDT
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):


How reproducible:


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)

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>
Comment 1 William Cohen 2006-07-31 09:16:40 EDT
Valgrind not expected to work with statically linked programs. Programs should
not be linked statically when using valgrind.


Note You need to log in before you can comment on or make changes to this bug.