|
From: Dan K. <da...@ke...> - 2009-03-11 12:52:54
|
I always dread using 32 bit tools on 64 bit systems because
of all the rough edges likely to be lurking. This might be one
of them.
On Ubuntu 8.10 64 bit, given the trivial program
#include <sys/types.h>
#include <pwd.h>
#include <stdio.h>
int main(int argc, char **argv)
{
struct passwd *p = getpwnam("root");
printf("p is %p\n", p);
}
a 64 bit run produces output with good line numbers for glibc, e.g.
gcc x.c; valgrind --leak-check=full ./a.out
...
==30678== by 0x4F2462C: nss_parse_service_list (nsswitch.c:547)
whereas a 32 bit run produces output without line numbers for glibc, e.g.
gcc -m32 x.c; valgrind --leak-check=full ./a.out
...
==30698== by 0x490E4F0: nss_parse_service_list (in /lib32/libc-2.8.90.so)
I believe I've loaded debug symbols correctly, with
$ sudo apt-get install libc6-dbg
$ dpkg-query -L libc6-dbg | grep libc-2
/usr/lib/debug/lib/libc-2.8.90.so
/usr/lib/debug/lib32/libc-2.8.90.so
/usr/lib/debug/libc-2.8.90.so
Which memo did I miss?
I could probably work around this by just running a 32 bit operating
sytem, but the world is turning, and everyone around me is using
the 64 bit version; I need to support them, too.
Thanks,
Dan
|
|
From: Julian S. <js...@ac...> - 2009-03-11 13:13:31
|
Which version of Valgrind is this with? 32-bit executables on amd64-linux or ppc64-linux should work fine. It gets tested regularly. > Which memo did I miss? Can you first try with the svn trunk; Tom just fixed a bug in that which may be related (or not). svn co svn://svn.valgrind.org/valgrind/trunk If that doesn't help, post the results of valgrind -v --leak-check=full ./a.out J |
|
From: Dan K. <da...@ke...> - 2009-03-11 14:39:13
Attachments:
vlog.txt
|
On Wed, Mar 11, 2009 at 6:12 AM, Julian Seward <js...@ac...> wrote: > Which version of Valgrind is this with? Some recent svn, also valgrind-3.3.1 from ubuntu 8.10. > Can you first try with the svn trunk; Tom just fixed a bug in that which > may be related (or not). > > svn co svn://svn.valgrind.org/valgrind/trunk Doesn't build at the moment; make[2]: Entering directory `/home/dank/valgrind/tests' make[2]: *** No rule to make target `filter_test_paths', needed by `all-am'. Stop. > If that doesn't help, post the results of > > valgrind -v --leak-check=full ./a.out Attached (from the Ubuntu stock valgrind). - Dan |
|
From: Tom H. <to...@co...> - 2009-03-11 17:02:21
|
Dan Kegel wrote: >> If that doesn't help, post the results of >> >> valgrind -v --leak-check=full ./a.out > > Attached (from the Ubuntu stock valgrind). See this: --20423-- Reading syms from /lib32/ld-2.8.90.so (0x4400000) --20423-- Reading debug info from /lib32/ld-2.8.90.so... --20423-- ... CRC mismatch (computed 3080f5cf wanted 4ce5790f) --20423-- Reading debug info from /usr/lib/debug/lib32/ld-2.8.90.so... and this: --20423-- Reading syms from /lib32/libc-2.8.90.so (0x4817000) --20423-- Reading debug info from /lib32/libc-2.8.90.so... --20423-- ... CRC mismatch (computed 6d0128e6 wanted c7a7bfa4) --20423-- Reading debug info from /usr/lib/debug/lib32/libc-2.8.90.so... all of which means your 32 bit debuginfo packages are not the right ones. Probably the main packages updated and not the debug package so the info is out of date. Tom -- Tom Hughes (to...@co...) http://www.compton.nu/ |
|
From: Dan K. <da...@ke...> - 2009-03-11 21:29:25
|
On Wed, Mar 11, 2009 at 9:38 AM, Tom Hughes <to...@co...> wrote:
> --20423-- Reading syms from /lib32/libc-2.8.90.so (0x4817000)
> --20423-- Reading debug info from /lib32/libc-2.8.90.so...
> --20423-- ... CRC mismatch (computed 6d0128e6 wanted c7a7bfa4)
> --20423-- Reading debug info from /usr/lib/debug/lib32/libc-2.8.90.so...
>
> all of which means your 32 bit debuginfo packages are not the right ones.
Are you sure? V seems to like the debug symbols read from /usr/lib/debug/lib32,
else there would have been a "CRC mismatch" after each "Reading debug
info", right?
My problem building earlier was because I forgot to rerun autogen.sh.
Builds fine from source now.
I wrote a little test for the problem.
On Ubuntu 8.04, neither 32 nor 64 bit works.
On Ubuntu 8.10, 64 bit works, but 32 bit doesn't.
It's possible I've borked all my own systems somehow.
If you have an Ubuntu 8.10 64 bit x86_64 system with valgrind installed,
could you run this script and let me know what it says?
Thanks...
- Dan
--- snip ---
#!/bin/sh
set -e
set -x
case `uname -m` in
x86_64) ;;
*) echo "This test is for x86_64 machines"; exit 1;;
esac
cat > leak.c <<_EOF_
#include <stdio.h>
#include <malloc.h>
int main(int argc, char **argv)
{
struct addrinfo *ai;
int err = getaddrinfo(NULL, "http", NULL, &ai);
printf("err %d, ai %p\n", err, ai);
}
_EOF_
for size in 64 32
do
gcc -g -m$size leak.c -o leak$size
valgrind --leak-check=full ./leak$size > leak$size.log 2>&1 || true
if ! grep -q "getaddrinfo.c:" leak$size.log
then
echo "No symbolic backtrace in $size bits; do you need to
install libc6-dbg?"
exit 1
fi
done
echo "Worked! No bug found."
--- snip ---
|
|
From: Tom H. <to...@co...> - 2009-03-11 22:09:56
|
Dan Kegel wrote: > On Wed, Mar 11, 2009 at 9:38 AM, Tom Hughes <to...@co...> wrote: >> --20423-- Reading syms from /lib32/libc-2.8.90.so (0x4817000) >> --20423-- Reading debug info from /lib32/libc-2.8.90.so... >> --20423-- ... CRC mismatch (computed 6d0128e6 wanted c7a7bfa4) >> --20423-- Reading debug info from /usr/lib/debug/lib32/libc-2.8.90.so... >> >> all of which means your 32 bit debuginfo packages are not the right ones. > > Are you sure? V seems to like the debug symbols read from /usr/lib/debug/lib32, > else there would have been a "CRC mismatch" after each "Reading debug > info", right? Hmmm... Yes I think I misread that - on Fedora you don't get the first line as the debug info is removed from the base file. I assume on this system the sections have just been emptied or something so they are still there but the checksum doesn't match. Tom -- Tom Hughes (to...@co...) http://www.compton.nu/ |
|
From: Nicholas N. <n.n...@gm...> - 2009-03-11 23:22:51
|
On Thu, Mar 12, 2009 at 8:29 AM, Dan Kegel <da...@ke...> wrote: > > It's possible I've borked all my own systems somehow. > If you have an Ubuntu 8.10 64 bit x86_64 system with valgrind installed, > could you run this script and let me know what it says? I got this: + uname -m + cat + gcc -g -m64 leak.c -o leak64 + valgrind --leak-check=full ./leak64 + true + grep -q getaddrinfo.c: leak64.log + echo No symbolic backtrace in 64 bits; do you need to install libc6-dbg? No symbolic backtrace in 64 bits; do you need to install libc6-dbg? + exit 1 N |