Re: [Valgrind-users] Welcome to the Valgrind-users mailing list

2011-06-28 Thread CHEN Hong lin

 Hi,
 I managed to cross-compile valgrind for linux on ppc (MPC8313), but
failed to run it. Below is the err info caught by strace.
  What's wrong with it?  Thanks in advance.
 BTW, the configure options are like: 
configure  --host=powerpc-unknown-linux --target=powerpc-unknown-linux
--prefix=/tmp/valgrind-install --build=i486-cross-linux-gnu

strace ./valgrind
execve(./valgrind, [./valgrind], [/* 9 vars */]) = 0
brk(0)  = 0x10015000
access(/etc/ld.so.preload, R_OK)  = -1 ENOENT (No such file or
directory)
open(/etc/ld.so.cache, O_RDONLY)  = -1 ENOENT (No such file or
directory)
open(/lib/tls/ppc603/libc.so.6, O_RDONLY) = -1 ENOENT (No such file or
directory)
stat64(/lib/tls/ppc603, 0xbfa07f38)   = -1 ENOENT (No such file or
directory)
open(/lib/tls/libc.so.6, O_RDONLY)= -1 ENOENT (No such file or
directory)
stat64(/lib/tls, 0xbfa07f38)  = -1 ENOENT (No such file or
directory)
open(/lib/ppc603/libc.so.6, O_RDONLY) = -1 ENOENT (No such file or
directory)
stat64(/lib/ppc603, 0xbfa07f38)   = -1 ENOENT (No such file or
directory)
open(/lib/libc.so.6, O_RDONLY)= 3
read(3,
\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0\3\0\24\0\0\0\1\0\1\273\310\0\0\0004.
.., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=1242872, ...}) = 0
mmap(0xfeae000, 1314840, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE,
3, 0) = 0xfeae000
mprotect(0xffd9000, 61440, PROT_NONE)   = 0
mmap(0xffe8000, 20480, PROT_READ|PROT_WRITE|PROT_EXEC,
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x12a000) = 0xffe8000
mmap(0xffed000, 8216, PROT_READ|PROT_WRITE|PROT_EXEC,
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xffed000
close(3)= 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0)
= 0x4801e000
mprotect(0xffe8000, 8192, PROT_READ)= 0
mprotect(0x4802e000, 4096, PROT_READ)   = 0
readlink(/proc/self/exe, /tmp/valgrind/bin/valgrind, 4096) = 26
brk(0)  = 0x10015000
brk(0x10036000) = 0x10036000
execve(/home/honglinc/local/valgrind/lib/valgrind/memcheck-ppc32-linux
, [./valgrind], [/* 10 vars */]) = 0
open(/proc/self/maps, O_RDONLY)   = 3
read(3, 0010-00102000 r-xp  ..., 10) = 363
read(3, , 99637)  = 0
close(3)= 0
mmap2(0x61d4a000, 4194304, PROT_READ|PROT_WRITE|PROT_EXEC,
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, 0, 0) = 0x61d4a000
getrlimit(RLIMIT_DATA, {rlim_cur=RLIM_INFINITY, rlim_max=RLIM_INFINITY})
= 0
setrlimit(RLIMIT_DATA, {rlim_cur=0, rlim_max=RLIM_INFINITY}) = 0
getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM_INFINITY}) =
0
rt_sigprocmask(SIG_UNBLOCK, [ILL FPE], [], 8) = 0
rt_sigaction(SIGILL, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGFPE, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGILL, {0x38032830, [], SA_NODEFER}, NULL, 8) = 0
rt_sigaction(SIGFPE, {0x38032830, [], SA_NODEFER}, NULL, 8) = 0
--- {si_signo=SIGILL, si_code=ILL_ILLOPC, si_addr=0x38033634} (Illegal
instruction) ---
--- {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0} (Segmentation
fault) ---
+++ killed by SIGSEGV +++
Segmentation fault


--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
___
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users


[Valgrind-users] Valgrind MPI fails to build libmpiwrapers

2011-06-28 Thread janjust

Hi,
I'm trying to build valgrind for testing some simple MPI programs;
however,  when building valgrind everything but the libmpiwrap_platform.so
builds. The error that I'm getting is:

-
mpicc-I../include  -g -O -fno-omit-frame-pointer -Wall -fpic -m64  -MT
libmpiwrap_amd64_linux_so-libmpiwrap.o -MD -MP -MF
.deps/libmpiwrap_amd64_linux_so-libmpiwrap.Tpo -c -o
libmpiwrap_amd64_linux_so-libmpiwrap.o `test -f 'libmpiwrap.c' || echo
'./'`libmpiwrap.c
pgcc-Error-Unknown switch: -fno-omit-frame-pointer
pgcc-Error-Unknown switch: -Wall
pgcc-Error-Unknown switch: -MT
pgcc-Error-Unknown switch: -MP
pgcc-Error-Unknown switch: -MF
make[2]: *** [libmpiwrap_amd64_linux_so-libmpiwrap.o] Error 1
make[2]: Leaving directory
`/autofs/na1_home/janjust/valgrind/valgrind_sources/valgrind_clean_src/mpi'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory
`/autofs/na1_home/janjust/valgrind/valgrind_sources/valgrind_clean_src'
make: *** [all] Error 2
-bash-3.2$ 
---

Also when I ran ./configure --prefix=
I get this when it's testing for compliant C compilers:

--
checking primary target for usable MPI2-compliant C compiler and mpi.h...
yes, mpicc
checking secondary target for usable MPI2-compliant C compiler and mpi.h...
no
--

I've searched forums with similar discussion topics with no luck.
Any suggestions on how to tackle this? Any pointers would be greatly
appreciated.

Thanks!





-- 
View this message in context: 
http://old.nabble.com/Valgrind-MPI-fails-to-build-libmpiwrapers-tp31948567p31948567.html
Sent from the Valgrind - Users mailing list archive at Nabble.com.


--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
___
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users


Re: [Valgrind-users] Valgrind MPI fails to build libmpiwrapers

2011-06-28 Thread Dave Goodell
On Jun 28, 2011, at 12:45 PM CDT, janjust wrote:

I'm trying to build valgrind for testing some simple MPI programs;
 however,  when building valgrind everything but the libmpiwrap_platform.so
 builds. The error that I'm getting is:
 
 -
 mpicc-I../include  -g -O -fno-omit-frame-pointer -Wall -fpic -m64  -MT
 libmpiwrap_amd64_linux_so-libmpiwrap.o -MD -MP -MF
 .deps/libmpiwrap_amd64_linux_so-libmpiwrap.Tpo -c -o
 libmpiwrap_amd64_linux_so-libmpiwrap.o `test -f 'libmpiwrap.c' || echo
 './'`libmpiwrap.c
 pgcc-Error-Unknown switch: -fno-omit-frame-pointer
 pgcc-Error-Unknown switch: -Wall
 pgcc-Error-Unknown switch: -MT
 pgcc-Error-Unknown switch: -MP
 pgcc-Error-Unknown switch: -MF
 make[2]: *** [libmpiwrap_amd64_linux_so-libmpiwrap.o] Error 1
 make[2]: Leaving directory
 `/autofs/na1_home/janjust/valgrind/valgrind_sources/valgrind_clean_src/mpi'
 make[1]: *** [all-recursive] Error 1
 make[1]: Leaving directory
 `/autofs/na1_home/janjust/valgrind/valgrind_sources/valgrind_clean_src'
 make: *** [all] Error 2
 -bash-3.2$ 
 ---

Unfortunately, valgrind's build process for the MPI wrappers is a bit narrow 
minded about what it expects from the MPI installation.  Also, the configure 
test for a working mpicc is too weak compared to the way that mpicc is used.  
I wrote a patch to improve the logic a little while back, but it hasn't been 
applied yet: https://bugs.kde.org/show_bug.cgi?id=274078

But even if that patch was applied I think that would have just disabled the 
Valgrind MPI wrappers for you by default instead.

In your case, you have an mpicc compiler wrapper around a PGI compiler.  The 
PGI compiler doesn't understand the same set of options as GCC or ICC, so it's 
erroring out during the MPI wrapper build step.  To get un-stuck right away, 
you might be able to reconfigure with MPI_CC=mpicc -noswitcherror, although I 
can't predict with any certainty whether the built wrappers will work correctly 
even if they do finish compiling.

Other options include using a version of MPI that is built with GCC instead of 
PGI, or disabling the Valgrind MPI wrappers altogether if you don't need that 
additional level of functionality.

-Dave


--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
___
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users


Re: [Valgrind-users] Valgrind MPI fails to build libmpiwrapers

2011-06-28 Thread Dave Goodell
On Jun 28, 2011, at 3:45 PM CDT, Dave Goodell wrote:

 On Jun 28, 2011, at 2:56 PM CDT, janjust wrote:
 
   Thanks for the reply. ; Setting $MPI_CC=mpicc -noswitcherror moved the
 build a bit further but it exited with a different error, this time:
 
 ---
...
 pgcc-Warning-Unknown switch: -fno-omit-frame-pointer
 pgcc-Warning-Unknown switch: -Wall
 pgcc-Warning-Unknown switch: -MT
 pgcc-Warning-Unknown switch: -MP
 pgcc-Warning-Unknown switch: -MF
 pgcc-Error-Output would overwrite input file:
 libmpiwrap_amd64_linux_so-libmpiwrap.o
 make[2]: *** [libmpiwrap_amd64_linux_so-libmpiwrap.o] Error 1
...
 --
 
 Hmm... not sure why that's happening.  It looks like a bad makefile recipe is 
 getting generated somehow.  I'll poke at it when I get a little more time.

Ahh, if I had just thought for a moment before firing off that last email I 
would have realized what happened in time.  Autoconf is probably detecting that 
your main compiler is gcc and using that.  So it sets some combination of 
automake conditionals to use gcc-style dependency tracking rules that are 
emitted inline into the Makefile.  However your mpicc is using a different 
compiler under the hood and pgcc doesn't understand the -MT target format, 
among other things.  So the dependency tracking rules that are used here are 
incorrect when compiling the MPI wrappers.

I suspect you can get past this particular error while still using the wrappers 
for pgcc by passing --disable-dependency-tracking to Valgrind's configure.  
You may still want to pursue the GCC-based-MPI strategy for other reasons.

-Dave


--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
___
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users


Re: [Valgrind-users] Segmentation fault on ppc

2011-06-28 Thread John Reiser
  I managed to cross-compile valgrind for linux on ppc (MPC8313), but
 failed to run it. Below is the err info caught by strace.
   What's wrong with it?  Thanks in advance.
  BTW, the configure options are like: 
 configure  --host=powerpc-unknown-linux --target=powerpc-unknown-linux
 --prefix=/tmp/valgrind-install --build=i486-cross-linux-gnu

 --- {si_signo=SIGILL, si_code=ILL_ILLOPC, si_addr=0x38033634} (Illegal
 instruction) ---
 --- {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0} (Segmentation
 fault) ---
 +++ killed by SIGSEGV +++

strace says that the instruction at address 0x38033634 is not legal
on this particular CPU model, which you say is MPC8313.
What does /proc/cpuinfo say?

Because the culprit is known to be an illegal instruction,
then run under a debugger such as gdb, and find out exactly
what instruction that is.

$ gdb valgrind
(gdb) run
 SIGSEGV
(gdb) bt
(gdb) x/x $pc
(gdb) x/i $pc
(gdb) x/8i $pc-4*4
(gdb) info reg
(gdb) x/16x $sp

-- 

--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
___
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users