|
From: Stan G. <sgo...@ho...> - 2005-10-29 00:00:39
|
We compile and link on machine A running Red Hat Linux release 9, for which uname returns: Linux royal53.prod.houston.nam.slb.com 2.4.20-31.9.progeny.5smp #1 SMP Tue Aug 10 01:31:24 EDT 2004 i686 i686 i386 GNU/Linux then run the executables successfully on machine B running Red Hat Enterprise Linux WS release 3, for which uname returns: Linux hya0001.prod.houston.nam.slb.com 2.4.21-20.EL #1 SMP Wed Aug 18 20:34:58 EDT 2004 x86_64 x86_64 x86_64 GNU/Linux From previous postings, I thought that if Valgrind were built on machine A, it would run OK on machine B for 32-bit executables. However, if I build Valgrind on machine A, then build an executable on machine A for a program like: #include <stdio.h> #include <stdlib.h> main() { char *s; s = getenv("TEST"); printf ("TEST=%s\n", s); } Valgrind fails as follows when I run on machine B: valgrind -v tst ==30744== Memcheck, a memory error detector. ==30744== Copyright (C) 2002-2005, and GNU GPL'd, by Julian Seward et al. ==30744== Using LibVEX rev 1367, a library for dynamic binary translation. ==30744== Copyright (C) 2004-2005, and GNU GPL'd, by OpenWorks LLP. ==30744== Using valgrind-3.0.1, a dynamic binary instrumentation framework. ==30744== Copyright (C) 2000-2005, and GNU GPL'd, by Julian Seward et al. --30744-- Valgrind library directory: /htc4/sgoldberg/valgrind/lib/valgrind --30744-- Command line --30744-- tst --30744-- Startup, with flags: --30744-- -v --30744-- Contents of /proc/version: --30744-- Linux version 2.4.21-20.EL (bhc...@do...) (gcc version 3.2.3 20030502 (Red Hat Linux 3.2.3-42)) #1 SMP Wed Aug 18 20:34:58 EDT 2004 --30744-- Reading syms from /NFSMNTS/htc4/sgoldberg/tst (0x8048000) --30744-- Reading syms from /lib/ld-2.3.2.so (0x1B8E4000) --30744-- Reading syms from /NFSMNTS/htc4/sgoldberg/valgrind/lib/valgrind/stage2 (0xB0000000) --30744-- Reading suppressions file: /htc4/sgoldberg/valgrind/lib/valgrind/default.supp ==30744== ==30744== ==30744== Process terminating with default action of signal 11 (SIGSEGV): dumping core ==30744== at 0x1B8E8B47: _dl_map_object (in /lib/ld-2.3.2.so) ==30744== by 0x1B8E6B29: dl_main (in /lib/ld-2.3.2.so) ==30744== by 0x1B8F3947: _dl_sysdep_start (in /lib/ld-2.3.2.so) ==30744== by 0x1B8E50B4: _dl_start (in /lib/ld-2.3.2.so) ==30744== by 0x1B8E4C66: (within /lib/ld-2.3.2.so) ==30744== ==30744== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 2 from 1) --30744-- --30744-- supp: 2 Ugly strchr error in /lib/ld-2.3.2.so ==30744== malloc/free: in use at exit: 0 bytes in 0 blocks. ==30744== malloc/free: 0 allocs, 0 frees, 0 bytes allocated. ==30744== ==30744== No malloc'd blocks -- no leaks are possible. --30744-- memcheck: sanity checks: 0 cheap, 1 expensive --30744-- memcheck: auxmaps: 0 auxmap entries (0k, 0M) in use --30744-- memcheck: auxmaps: 0 searches, 0 comparisons --30744-- memcheck: secondaries: 5 issued (320k, 0M) --30744-- memcheck: secondaries: 0 accessible and distinguished (0k, 0M) --30744-- tt/tc: 708 tt lookups requiring 709 probes --30744-- tt/tc: 708 fast-cache updates, 2 flushes --30744-- translate: new 354 (7800 -> 125297; ratio 160:10) [0 scs] --30744-- translate: dumped 0 (0 -> ??) --30744-- translate: discarded 0 (0 -> ??) --30744-- scheduler: 1843 jumps (bb entries). --30744-- scheduler: 0/357 major/minor sched events. --30744-- sanity: 1 cheap, 1 expensive checks. --30744-- exectx: 4999 lists, 2 contexts (avg 0 per list) --30744-- exectx: 2 searches, 0 full compares (0 per 1000) --30744-- exectx: 0 cmp2, 1 cmp4, 0 cmpAll Segmentation fault Any suggestions as to what the problem might be and how I can get around it? Thanks, Stan Goldberg WesternGeco Houston, TX |
|
From: Tom H. <to...@co...> - 2005-10-29 10:12:50
|
In message <5.1...@po...>
Stan Goldberg <sgo...@ho...> wrote:
> We compile and link on machine A running Red Hat Linux release 9, for
> which uname returns:
>
> Linux royal53.prod.houston.nam.slb.com 2.4.20-31.9.progeny.5smp #1 SMP Tue
> Aug 10 01:31:24 EDT 2004 i686 i686 i386 GNU/Linux
>
> then run the executables successfully on machine B running Red Hat
> Enterprise Linux WS release 3, for which uname returns:
>
> Linux hya0001.prod.houston.nam.slb.com 2.4.21-20.EL #1 SMP Wed Aug 18
> 20:34:58 EDT 2004 x86_64 x86_64 x86_64 GNU/Linux
>
> From previous postings, I thought that if Valgrind were built on machine
> A, it would run OK on machine B for 32-bit executables. However, if I
> build Valgrind on machine A, then build an executable on machine A for a
> program like:
>
> #include <stdio.h>
> #include <stdlib.h>
>
> main()
> {
> char *s;
>
> s = getenv("TEST");
>
> printf ("TEST=%s\n", s);
> }
That should work fine, and it does for me although I've always used
rather newer distributions than that when doing it.
> ==30744== Process terminating with default action of signal 11 (SIGSEGV):
> dumping core
> ==30744== at 0x1B8E8B47: _dl_map_object (in /lib/ld-2.3.2.so)
> ==30744== by 0x1B8E6B29: dl_main (in /lib/ld-2.3.2.so)
> ==30744== by 0x1B8F3947: _dl_sysdep_start (in /lib/ld-2.3.2.so)
> ==30744== by 0x1B8E50B4: _dl_start (in /lib/ld-2.3.2.so)
> ==30744== by 0x1B8E4C66: (within /lib/ld-2.3.2.so)
Well something in the dynamic linker performed a dodgy memory reference
for some reason, but memcheck didn't spot it.
I assume this program runs fine on the 64 bit box without valgrind?
Tom
--
Tom Hughes (to...@co...)
http://www.compton.nu/
|