You are not logged in.
Hi all.
I use valgrind when I'm playing around with C or C++ to make sure I haven't made any mistakes with memory.
On a simple "Hello, World" program in C, valgrind reports 13 errors. This isn't such a big problem, but it distracts from my own errors.
It doesn't occur on other distributions I've used so I'm thinking it's fixable. Any info would be great.
#include <stdio.h>
int main( void ) {
puts( "Hello, world!" );
return 0;
}
$ gcc hello.c -o hello
$ valgrind ./hello
==18712== Memcheck, a memory error detector.
==18712== Copyright (C) 2002-2007, and GNU GPL'd, by Julian Seward et al.
==18712== Using LibVEX rev 1732, a library for dynamic binary translation.
==18712== Copyright (C) 2004-2007, and GNU GPL'd, by OpenWorks LLP.
==18712== Using valgrind-3.2.3, a dynamic binary instrumentation framework.
==18712== Copyright (C) 2000-2007, and GNU GPL'd, by Julian Seward et al.
==18712== For more details, rerun with: -v
==18712==
==18712== Conditional jump or move depends on uninitialised value(s)
==18712== at 0x400A7B2: _dl_relocate_object (do-rel.h:65)
==18712== by 0x4003743: dl_main (rtld.c:2207)
==18712== by 0x401385C: _dl_sysdep_start (dl-sysdep.c:239)
==18712== by 0x40011C0: _dl_start (rtld.c:323)
==18712== by 0x4000816: (within /lib/ld-2.6.1.so)
==18712==
==18712== Conditional jump or move depends on uninitialised value(s)
==18712== at 0x400A7BA: _dl_relocate_object (do-rel.h:68)
==18712== by 0x4003743: dl_main (rtld.c:2207)
==18712== by 0x401385C: _dl_sysdep_start (dl-sysdep.c:239)
==18712== by 0x40011C0: _dl_start (rtld.c:323)
==18712== by 0x4000816: (within /lib/ld-2.6.1.so)
==18712==
==18712== Conditional jump or move depends on uninitialised value(s)
==18712== at 0x400A8D5: _dl_relocate_object (do-rel.h:104)
==18712== by 0x4003743: dl_main (rtld.c:2207)
==18712== by 0x401385C: _dl_sysdep_start (dl-sysdep.c:239)
==18712== by 0x40011C0: _dl_start (rtld.c:323)
==18712== by 0x4000816: (within /lib/ld-2.6.1.so)
==18712==
==18712== Conditional jump or move depends on uninitialised value(s)
==18712== at 0x400A910: _dl_relocate_object (do-rel.h:117)
==18712== by 0x4003743: dl_main (rtld.c:2207)
==18712== by 0x401385C: _dl_sysdep_start (dl-sysdep.c:239)
==18712== by 0x40011C0: _dl_start (rtld.c:323)
==18712== by 0x4000816: (within /lib/ld-2.6.1.so)
==18712==
==18712== Conditional jump or move depends on uninitialised value(s)
==18712== at 0x400B3AB: _dl_relocate_object (do-rel.h:127)
==18712== by 0x4003743: dl_main (rtld.c:2207)
==18712== by 0x401385C: _dl_sysdep_start (dl-sysdep.c:239)
==18712== by 0x40011C0: _dl_start (rtld.c:323)
==18712== by 0x4000816: (within /lib/ld-2.6.1.so)
==18712==
==18712== Conditional jump or move depends on uninitialised value(s)
==18712== at 0x400A7B2: _dl_relocate_object (do-rel.h:65)
==18712== by 0x40039C9: dl_main (rtld.c:2277)
==18712== by 0x401385C: _dl_sysdep_start (dl-sysdep.c:239)
==18712== by 0x40011C0: _dl_start (rtld.c:323)
==18712== by 0x4000816: (within /lib/ld-2.6.1.so)
==18712==
==18712== Conditional jump or move depends on uninitialised value(s)
==18712== at 0x400A7BA: _dl_relocate_object (do-rel.h:68)
==18712== by 0x40039C9: dl_main (rtld.c:2277)
==18712== by 0x401385C: _dl_sysdep_start (dl-sysdep.c:239)
==18712== by 0x40011C0: _dl_start (rtld.c:323)
==18712== by 0x4000816: (within /lib/ld-2.6.1.so)
==18712==
==18712== Conditional jump or move depends on uninitialised value(s)
==18712== at 0x400A910: _dl_relocate_object (do-rel.h:117)
==18712== by 0x40039C9: dl_main (rtld.c:2277)
==18712== by 0x401385C: _dl_sysdep_start (dl-sysdep.c:239)
==18712== by 0x40011C0: _dl_start (rtld.c:323)
==18712== by 0x4000816: (within /lib/ld-2.6.1.so)
Hello, world!
==18712==
==18712== ERROR SUMMARY: 13 errors from 8 contexts (suppressed: 0 from 0)
==18712== malloc/free: in use at exit: 0 bytes in 0 blocks.
==18712== malloc/free: 0 allocs, 0 frees, 0 bytes allocated.
==18712== For counts of detected errors, rerun with: -v
==18712== All heap blocks were freed -- no leaks are possible.
Last edited by Jessehk (2007-08-16 00:46:09)
Offline
Apparently those errors are common with a stripped ld.so
Other distros are probably either: a) not stripped, b) using tuned supressions.
http://valgrind.org/docs/manual/faq.html#faq.writesupp
I recommend configuring suppressions to block those specific messages, as they are all ld.so in origin.
edit:
http://svn.python.org/projects/python/t … ython.supp
search for "ld problems" and you will see some examples.
"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍
Offline
Thanks, cactus.
I fixed the errors by appending this:
{
ld error suppression
Memcheck:Cond
fun:_dl_relocate_object
fun:dl_main
fun:_dl_sysdep_start
fun:_dl_start
obj:/lib/ld-2.6.1.so
}
to the end of /usr/lib/valgrind/default.supp
Offline
Should these lines be added by default in the valgrind package. I think everyone will need them. Is there any downside?
Offline
I think with the next update of valgrind your modifications will be lost. I created a file in my homefolder and an alias for valgrind so it automatically uses this suppressions file.
alias valgrind="valgrind --suppressions=~/.myvalgrind.supp"
digiKam developer - www.digikam.org
Offline
I think with the next update of valgrind your modifications will be lost.
That file can easily be backed up or a .pacnew file created along side it at upgrade - much like other config files. I think if this a step every user needs to perform, then it should be included by default.
Offline
Should these lines be added by default in the valgrind package. I think everyone will need them. Is there any downside?
What if you are running arch without a stripped ld? Arch is all about sane defaults, and I think it's insane to suppress warnings out of the box from a debugger. I know that arch is shipping with something that puts out errors on a Hello World, but if you are using Valgrind, you should probably know that arch ships stripped binaries ( Which I still disagree with ).
Offline
What if you are running arch without a stripped ld? Arch is all about sane defaults, and I think it's insane to suppress warnings out of the box from a debugger. I know that arch is shipping with something that puts out errors on a Hello World, but if you are using Valgrind, you should probably know that arch ships stripped binaries ( Which I still disagree with ).
Fair enough. How about a post install message saying "By default Arch ships with a stripped ld, so blah..."?
Offline
Allan wrote:Should these lines be added by default in the valgrind package. I think everyone will need them. Is there any downside?
What if you are running arch without a stripped ld? Arch is all about sane defaults, and I think it's insane to suppress warnings out of the box from a debugger. I know that arch is shipping with something that puts out errors on a Hello World, but if you are using Valgrind, you should probably know that arch ships stripped binaries ( Which I still disagree with ).
I think codemac is right here, but not for the same reasons.
Adding these suppressions by default is just more hiding. To me, it's the same as replacing some binary with a script like this:
#!/bin/sh
somebinary > /dev/null 2>&1
There's nothing wrong with that but information is lost and hidden. Let's let the user decide what information the user wants to throw away, instead of enforcing it at the distro level.
I'm all for sticking some default suppressions in /usr/share or something like that, but having it "on" by default doesn't sit right.
Offline