|
From: Adam P. <ada...@ho...> - 2015-10-14 14:30:11
|
Hi, I've built Valgrind successfully using the MIPS toolchain for my hardware but it doesn't give any output to stdout and just hangs.Steps below:Cross compile Valgrind using my toolchain. Initially it was hanging during compilation. I've used information at https://bugs.kde.org/show_bug.cgi?id=327151 to change the compiler optimisation level and it successfully compilesRun valgrind using on the target device using: VALGRIND_LIB=<valgrind_lib_dir> ./valgrindI don't see any output on the console at all and can see that valgrind is nearly 100% CPU with the output from using top (hardware has 2 cores which explains the 48%): 6210 6190 root R 16004 13% 0 48% {memcheck-mips32} ./valgrind I know this is not much information to go on but can anyone provide a suggestion as to how I could proceed? Thanks, Adam |
|
From: Philippe W. <phi...@sk...> - 2015-10-14 21:41:16
|
On Wed, 2015-10-14 at 15:30 +0100, Adam Porteous wrote
> 1. I don't see any output on the console at all and can see that
> valgrind is nearly 100% CPU with the output from using top
> (hardware has 2 cores which explains the 48%):
> 6210 6190 root R 16004 13% 0 48%
> {memcheck-mips32} ./valgrind
> I know this is not much information to go on but can anyone provide a
> suggestion as to how I could proceed?
Here is what you could do:
First check if the loop happens before startup,
or in the valgrind code,
or in the guest code.
So, first thing to try is to run with more tracing, e.g. with
--trace-flags=00100000
and/or with
-v -v -v -d -d -d
If the guest code starts executing, then you should e.g.
see things such as
==== SB 0 (evchecks 0) [tid 1] 0x4000d00 UNKNOWN_FUNCTION /lib/i386-linux-gnu/ld-2.19.so+0xd00
==== SB 1 (evchecks 1) [tid 1] 0x4004330 _dl_start+16 /lib/i386-linux-gnu/ld-2.19.so+0x4330
...
After that, when no progress is visible, you can use vgdb (and/or gdb+vgdb) to
see if the loop is in the guest code.
E.g., from the shell, do (several times):
vgdb v.info scheduler
That should show where it loops
(and if it loops, you could investigate using gdb+vgdb).
If vgdb cannot connect, then probably the loop is in the valgrind 'core'.
You can then maybe see where in the valgrind code it is looping, by using
gdb and directly attaching to the executable.
Philippe
|
|
From: Adam P. <ada...@ho...> - 2015-10-17 15:31:45
|
Thanks for the suggestions. I'll try them and see how far I get.
Adam
> Subject: Re: [Valgrind-users] Valgrind on MIPS no output and 100% CPU
> From: phi...@sk...
> To: ada...@ho...
> CC: val...@li...
> Date: Wed, 14 Oct 2015 23:42:02 +0200
>
> On Wed, 2015-10-14 at 15:30 +0100, Adam Porteous wrote
>
>
> > 1. I don't see any output on the console at all and can see that
> > valgrind is nearly 100% CPU with the output from using top
> > (hardware has 2 cores which explains the 48%):
> > 6210 6190 root R 16004 13% 0 48%
> > {memcheck-mips32} ./valgrind
>
> > I know this is not much information to go on but can anyone provide a
> > suggestion as to how I could proceed?
>
> Here is what you could do:
>
> First check if the loop happens before startup,
> or in the valgrind code,
> or in the guest code.
>
> So, first thing to try is to run with more tracing, e.g. with
> --trace-flags=00100000
> and/or with
> -v -v -v -d -d -d
>
> If the guest code starts executing, then you should e.g.
> see things such as
>
> ==== SB 0 (evchecks 0) [tid 1] 0x4000d00 UNKNOWN_FUNCTION /lib/i386-linux-gnu/ld-2.19.so+0xd00
> ==== SB 1 (evchecks 1) [tid 1] 0x4004330 _dl_start+16 /lib/i386-linux-gnu/ld-2.19.so+0x4330
> ...
>
> After that, when no progress is visible, you can use vgdb (and/or gdb+vgdb) to
> see if the loop is in the guest code.
> E.g., from the shell, do (several times):
> vgdb v.info scheduler
> That should show where it loops
> (and if it loops, you could investigate using gdb+vgdb).
>
> If vgdb cannot connect, then probably the loop is in the valgrind 'core'.
> You can then maybe see where in the valgrind code it is looping, by using
> gdb and directly attaching to the executable.
>
> Philippe
>
>
|