This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Problem with static linking


On Thu, Jul 16, 2009 at 2:07 AM, Ian Lance Taylor<iant@google.com> wrote:
> Zachary Turner <divisortheory@gmail.com> writes:
>
>> What happens if you run valgrind on your hello world executable?
>
> I get 32 errors about dependencies on uninitialized variables, much as
> you mentioned.
>
> I took a look at the first several. ?They were all tests of %gs:0xc,
> which is the multiple_threads field in the TCB. ?That field is in memory
> allocated by sbrk, which is guaranteed to be zero. ?So I think although
> valgrind may be correctly reporting that the program did not set the
> field, I think it is wrong in thinking that the value is not known.
>
> Ian
>

Well at least I know I'm not going crazy and that it happens
everywhere apparently.  Although I'm not sure if that's comforting or
demoralizing since it means my program's erratic behavior may not
necessarily be related to the linking issue.  I guess the appropriate
place to raise the issue about all the brk errors would be the
valgrind list.  What about errors such as this?

==5645== 1 errors in context 43 of 69:
==5645== Conditional jump or move depends on uninitialised value(s)
==5645==    at 0x80D227C: strlen (in /home/zach/test)
==5645==    by 0x8105DD4: _dl_init_paths (in /home/zach/test)
==5645==    by 0x80E389B: _dl_non_dynamic_init (in /home/zach/test)
==5645==    by 0x80E4245: __libc_init_first (in /home/zach/test)
==5645==    by 0x80B3DDD: (below main) (in /home/zach/test)
==5645==  Uninitialised value was created by a stack allocation
==5645==    at 0x8105BEB: _dl_init_paths (in /home/zach/test)

There's no mention of brk anywhere here, do you know if this case is
still safe anyway?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]