|
From: CHEN H. l. <Hon...@al...> - 2011-06-28 09:30:43
|
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, "00100000-00102000 r-xp 00000000 "..., 100000) = 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
|
|
From: CHEN H. l. <Hon...@al...> - 2011-06-29 00:49:03
|
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, "00100000-00102000 r-xp 00000000 "..., 100000) = 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
|
|
From: John R. <jr...@bi...> - 2011-06-29 02:36:31
|
> 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
--
|
|
From: CHEN H. l. <Hon...@al...> - 2011-06-30 09:19:44
|
Thanks a lot. Unfortunately the board I run valgrind on is not installed with gdb because of limited memory and stroage space. We are trying NFS though...
-----Original Message-----
From: John Reiser [mailto:jr...@bi...]
Sent: 2011年6月29日 10:37
To: val...@li...
Subject: Re: [Valgrind-users] Segmentation fault on ppc
> 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
Val...@li...
https://lists.sourceforge.net/lists/listinfo/valgrind-users
|
|
From: CHEN H. l. <Hon...@al...> - 2011-07-21 02:13:52
|
Finally the issue is resolved. It needs a patch. http://gitorious.org/~cbs/oe-lite/cbss-base/blobs/master/recipes/valgrind/valgrind-3.6.1/vg-ppc-feature.patch -----Original Message----- From: John Reiser [mailto:jr...@bi...] Sent: 2011年6月29日 10:37 To: val...@li... Subject: Re: [Valgrind-users] Segmentation fault on ppc > 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 Val...@li... https://lists.sourceforge.net/lists/listinfo/valgrind-users |
|
From: Maynard J. <may...@us...> - 2011-07-21 16:57:40
|
On 07/20/2011 9:13 PM, CHEN Hong lin wrote: > Finally the issue is resolved. It needs a patch. > http://gitorious.org/~cbs/oe-lite/cbss-base/blobs/master/recipes/valgrind/valgrind-3.6.1/vg-ppc-feature.patch On what version of valgrind were you seeing this problem? The patch you reference above was a patch I developed and attached to a bug I opened -- https://bugs.kde.org/show_bug.cgi?id=259977. But that patch was not accepted. Julian proposed an alternative solution, which I verified as acceptable, and that's what was committed upstream. You should try an upstream snapshot and make sure that works for you. -Maynard > > > -----Original Message----- > From: John Reiser [mailto:jr...@bi...] > Sent: 2011年6月29日 10:37 > To: val...@li... > Subject: Re: [Valgrind-users] Segmentation fault on ppc > >> 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 > |
|
From: CHEN H. l. <Hon...@al...> - 2011-07-22 01:52:00
|
The version of the valgrind I used is Release 3.6.1. I downloaded it from http://www.valgrind.org/downloads/current.html . I think it is the latest version published. Where can I find the upstream snapshot you mentioned? -----Original Message----- From: Maynard Johnson [mailto:may...@us...] Sent: 2011年7月22日 0:58 To: CHEN Hong lin Cc: John Reiser; val...@li... Subject: Re: [Valgrind-users] Segmentation fault on ppc On 07/20/2011 9:13 PM, CHEN Hong lin wrote: > Finally the issue is resolved. It needs a patch. > http://gitorious.org/~cbs/oe-lite/cbss-base/blobs/master/recipes/valgr > ind/valgrind-3.6.1/vg-ppc-feature.patch On what version of valgrind were you seeing this problem? The patch you reference above was a patch I developed and attached to a bug I opened -- https://bugs.kde.org/show_bug.cgi?id=259977. But that patch was not accepted. Julian proposed an alternative solution, which I verified as acceptable, and that's what was committed upstream. You should try an upstream snapshot and make sure that works for you. -Maynard > > > -----Original Message----- > From: John Reiser [mailto:jr...@bi...] > Sent: 2011年6月29日 10:37 > To: val...@li... > Subject: Re: [Valgrind-users] Segmentation fault on ppc > >> 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 > |
|
From: John R. <jr...@bi...> - 2011-07-22 02:19:29
|
On 07/21/2011 06:51 PM, CHEN Hong lin wrote: > The version of the valgrind I used is Release 3.6.1. I downloaded it from http://www.valgrind.org/downloads/current.html . I think it is the latest version published. Where can I find the upstream snapshot you mentioned? See http://valgrind.org/downloads/repository.html to use the SVN source code repository for valgrind. The "snapshot" may well have been the current version as of some particular date. -- |
|
From: Maynard J. <may...@us...> - 2011-07-22 13:53:09
|
CHEN Hong lin wrote: > The version of the valgrind I used is Release 3.6.1. I downloaded it from http://www.valgrind.org/downloads/current.html . I think it is the latest version published. Where can I find the upstream snapshot you mentioned? CHEN Hong lin, What I meant by "upstream snapshot" was that you simply do a checkout of current code from Valgrind's svn repository. See http://valgrind.org/downloads/repository.html for details how to do that. -Maynard > > -----Original Message----- > From: Maynard Johnson [mailto:may...@us...] > Sent: 2011年7月22日 0:58 > To: CHEN Hong lin > Cc: John Reiser; val...@li... > Subject: Re: [Valgrind-users] Segmentation fault on ppc > > On 07/20/2011 9:13 PM, CHEN Hong lin wrote: >> Finally the issue is resolved. It needs a patch. >> http://gitorious.org/~cbs/oe-lite/cbss-base/blobs/master/recipes/valgr >> ind/valgrind-3.6.1/vg-ppc-feature.patch > > On what version of valgrind were you seeing this problem? The patch you reference above was a patch I developed and attached to a bug I opened -- https://bugs.kde.org/show_bug.cgi?id=259977. But that patch was not accepted. > Julian proposed an alternative solution, which I verified as acceptable, and that's what was committed upstream. You should try an upstream snapshot and make sure that works for you. > > -Maynard > >> >> >> -----Original Message----- >> From: John Reiser [mailto:jr...@bi...] >> Sent: 2011年6月29日 10:37 >> To: val...@li... >> Subject: Re: [Valgrind-users] Segmentation fault on ppc >> >>> 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 >> > |
|
From: Julian S. <js...@ac...> - 2011-06-30 12:39:10
|
On Wednesday, June 29, 2011, CHEN Hong lin wrote:
> 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
Is this an CPU that supports the e500 instruction set extension?
I suspect it is. Valgrind doesn't support e500 instructions.
But what is strange about this ...
> --- {si_signo=SIGILL, si_code=ILL_ILLOPC, si_addr=0x38033634} (Illegal
.. is that it looks like Valgrind itself SIGILL'd. The address
0x38033634 is probably inside
/home/honglinc/local/valgrind/lib/valgrind/memcheck-ppc32-linux
and you should be able to find out what the failing instruction
is and which function it is in, using objdump on that file.
J
|