Bug 200535 - Valgrind flags lots of uninitialized locations with programs compiled with "-static"
Summary: Valgrind flags lots of uninitialized locations with programs compiled with "-...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: valgrind
Version: 6
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-07-28 14:49 UTC by William Cohen
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2006-07-31 13:16:40 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description William Cohen 2006-07-28 14:49:22 UTC
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>

Comment 1 William Cohen 2006-07-31 13:16:40 UTC
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


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