|
From: Christian K. <c....@tu...> - 2006-07-19 14:36:58
|
Hi Adam, > I'm currently writing a program that uses dlopen() to play with shared > libs, and valgrind is giving me some errors, the first of which is an > "Invalid read of size 4" error. [...} > Attached is a minimal testcase that exhibits the error. It's a shell > script that writes two tiny (< 10 line) c files, compiles them and runs > the result. Note that the program appears to run fine and returns the > correct value. > > I'm running "valgrind-3.2.0-Debian" on an up-to-date Debian testing > system. (libc6 2.3.6-15, kernel 2.6.15-8, more system info is available > on request.) running this here under SUSE 10.0 and with valgrind-3.1 at least there is no problem. Can you post the output of valgrind? This could help in diagnosing what's going on Cheers, Christian -- Christian Keil /"\ Institute for Reliable Computing \ / ASCII Ribbon Campaign Hamburg University of Technology X against HTML email & vCards mail:c....@tu... / \ |
|
From: Christian K. <chr...@tu...> - 2006-07-19 14:41:34
|
Not sure if this got through as I used the wrong email address. Sorry if this appears twice. Hi Adam, > I'm currently writing a program that uses dlopen() to play with shared > libs, and valgrind is giving me some errors, the first of which is an > "Invalid read of size 4" error. [...} > Attached is a minimal testcase that exhibits the error. It's a shell > script that writes two tiny (< 10 line) c files, compiles them and runs > the result. Note that the program appears to run fine and returns the > correct value. > > I'm running "valgrind-3.2.0-Debian" on an up-to-date Debian testing > system. (libc6 2.3.6-15, kernel 2.6.15-8, more system info is available > on request.) running this here under SUSE 10.0 and with valgrind-3.1 at least there is no problem. Can you post the output of valgrind? This could help in diagnosing what's going on Cheers, Christian -- Christian Keil /"\ Institute for Reliable Computing \ / ASCII Ribbon Campaign Hamburg University of Technology X against HTML email & vCards mail:c....@tu... / \ |
|
From: Adam S. <ad...@sp...> - 2006-07-19 22:47:33
Attachments:
dlt.out
|
Christian Keil wrote:
> Hi Adam,
>
>> I'm currently writing a program that uses dlopen() to play with shared
>> libs, and valgrind is giving me some errors, the first of which is an
>> "Invalid read of size 4" error.
>>
> running this here under SUSE 10.0 and with valgrind-3.1 at least there
> is no problem. Can you post the output of valgrind? This could help in
> diagnosing what's going on
Doh! Knew I forgot something. Attached.
Adam
--
To describe religions as mind viruses is sometimes interpreted as
contemptuous or even hostile. It is both.
-- Richard Dawkins - "A Devil's Chaplain"
|
|
From: Julian S. <js...@ac...> - 2006-07-22 09:57:23
|
On Wednesday 19 July 2006 23:47, Adam Spragg wrote: > Christian Keil wrote: > > Hi Adam, > > > >> I'm currently writing a program that uses dlopen() to play with shared > >> libs, and valgrind is giving me some errors, the first of which is an > >> "Invalid read of size 4" error. > > > > running this here under SUSE 10.0 and with valgrind-3.1 at least there > > is no problem. Can you post the output of valgrind? This could help in > > diagnosing what's going on ==16833== Invalid read of size 4 ==16833== at 0x40114E7: (within /lib/ld-2.3.6.so) ==16833== by 0x4004E29: (within /lib/ld-2.3.6.so) ==16833== by 0x4006B55: (within /lib/ld-2.3.6.so) ==16833== by 0x41424AF: (within /lib/tls/i686/cmov/libc-2.3.6.so) ==16833== by 0x400BA5E: (within /lib/ld-2.3.6.so) ==16833== by 0x4142E6A: _dl_open (in /lib/tls/i686/cmov/libc-2.3.6.so) ==16833== by 0x4037D27: (within /lib/tls/i686/cmov/libdl-2.3.6.so) ==16833== by 0x400BA5E: (within /lib/ld-2.3.6.so) ==16833== by 0x4038456: (within /lib/tls/i686/cmov/libdl-2.3.6.so) ==16833== by 0x4037D80: dlopen (in /lib/tls/i686/cmov/libdl-2.3.6.so) ==16833== by 0x8048463: main (dlt-bin.c:4) ==16833== Address 0x4175034 is 12 bytes inside a block of size 15 alloc'd ==16833== at 0x401B4A1: malloc (vg_replace_malloc.c:149) ==16833== by 0x40040E5: (within /lib/ld-2.3.6.so) ==16833== by 0x4006ACE: (within /lib/ld-2.3.6.so) ==16833== by 0x41424AF: (within /lib/tls/i686/cmov/libc-2.3.6.so) ==16833== by 0x400BA5E: (within /lib/ld-2.3.6.so) ==16833== by 0x4142E6A: _dl_open (in /lib/tls/i686/cmov/libc-2.3.6.so) ==16833== by 0x4037D27: (within /lib/tls/i686/cmov/libdl-2.3.6.so) ==16833== by 0x400BA5E: (within /lib/ld-2.3.6.so) ==16833== by 0x4038456: (within /lib/tls/i686/cmov/libdl-2.3.6.so) ==16833== by 0x4037D80: dlopen (in /lib/tls/i686/cmov/libdl-2.3.6.so) ==16833== by 0x8048463: main (dlt-bin.c:4) The underlying problem is you have a /lib/ld-2.3.6.so from which all symbol information has been removed. This makes it impossible for V to find and replace the hyper-optimised strcpy, strcmp, etc functions in it which cause this error. But then I see this: --16833-- Reading debug info from /lib/ld-2.3.6.so... --16833-- ... CRC mismatch (computed 8D0DB48E wanted BF5D33FD) --16833-- object doesn't have a symbol table which, if the debug info had been read successfully, might well have solved the problem. I don't know why this fails -- perhaps your debuginfo package for ld-2.3.6.so does not match the installed version? Can you check? J |
|
From: Adam S. <ad...@sp...> - 2006-07-22 14:18:40
Attachments:
dlt.2.out
|
Julian Seward wrote:
> The underlying problem is you have a /lib/ld-2.3.6.so from which all
> symbol information has been removed. This makes it impossible for
> V to find and replace the hyper-optimised strcpy, strcmp, etc functions
> in it which cause this error.
Ah! And now I've installed libc6-dbg, all the "invalid read" errors go
away. w00t! Problem solved.
Thanks.
> But then I see this:
>
> --16833-- Reading debug info from /lib/ld-2.3.6.so...
> --16833-- ... CRC mismatch (computed 8D0DB48E wanted BF5D33FD)
> --16833-- object doesn't have a symbol table
>
> which, if the debug info had been read successfully, might well have
> solved the problem. I don't know why this fails -- perhaps your
> debuginfo package for ld-2.3.6.so does not match the installed
> version? Can you check?
Hmmmm.....I still get the CRC mismatches though. I don't have the main
problem anymore, so I'm not particularly bothered by it, but I've
included a transcript showing that I have matching libc6, libc6-dev and
libc6-dbg packages, and the remaining warnings etc... If you want to
investigate this further, I'll be happy to help, but don't worry about
it on my account.
Thanks again,
Adam
--
To describe religions as mind viruses is sometimes interpreted as
contemptuous or even hostile. It is both.
-- Richard Dawkins - "A Devil's Chaplain"
|
|
From: Adam S. <ad...@sp...> - 2006-07-22 17:42:33
Attachments:
dlt.2.out
|
Julian Seward wrote:
> The underlying problem is you have a /lib/ld-2.3.6.so from which all
> symbol information has been removed. This makes it impossible for
> V to find and replace the hyper-optimised strcpy, strcmp, etc functions
> in it which cause this error.
Ah! And now I've installed libc6-dbg, all the "invalid read" errors go
away. w00t! Problem solved.
Thanks.
> But then I see this:
>
> --16833-- Reading debug info from /lib/ld-2.3.6.so...
> --16833-- ... CRC mismatch (computed 8D0DB48E wanted BF5D33FD)
> --16833-- object doesn't have a symbol table
>
> which, if the debug info had been read successfully, might well have
> solved the problem. I don't know why this fails -- perhaps your
> debuginfo package for ld-2.3.6.so does not match the installed
> version? Can you check?
Hmmmm.....I still get the CRC mismatches though. I don't have the main
problem anymore, so I'm not particularly bothered by it, but I've
included a transcript showing that I have matching libc6, libc6-dev and
libc6-dbg packages, and the remaining warnings etc... If you want to
investigate this further, I'll be happy to help, but don't worry about
it on my account.
Thanks again,
Adam
--
To describe religions as mind viruses is sometimes interpreted as
contemptuous or even hostile. It is both.
-- Richard Dawkins - "A Devil's Chaplain"
|