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


Zachary Turner <divisortheory@gmail.com> writes:

> 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?

At first glance this looks like a fairly standard valgrind issue.
strlen picks up a word at a time.  That is OK because it only does it on
word-aligned addresses, and it looks for a null byte from the start of
the loaded bytes.  So although it is a read of uninitialized memory, it
is not serious.

I don't know for sure that that is what is happening here--I don't see
this warning when I run.

Ian


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