|
From: Pramod <akp...@gm...> - 2010-06-18 11:25:20
|
I have cross-compiled valgrind 3.5.0 to work on MontaVista Linux.
After installing (copied bin, lib, include directories to montavista machine),
and running valgrind with no arguments, I get a core file from memcheck.
Using GDB, I see that the core occurs at line 251 in mc_leakcheck.c.
---
Program terminated with signal 11, Segmentation fault.
#0 0x000000000000000c in compare_MC_Chunks (n1=0x0, n2=0x0)
at mc_leakcheck.c:251
251 mc_leakcheck.c: No such file or directory.
in mc_leakcheck.c
---
---
246: // Compare the MC_Chunks by 'data' (i.e. the address of the block).
247: static Int compare_MC_Chunks(void* n1, void* n2)
248: {
249: MC_Chunk* mc1 = *(MC_Chunk**)n1;
250: MC_Chunk* mc2 = *(MC_Chunk**)n2;
251: if (mc1->data < mc2->data) return -1;
252: if (mc1->data > mc2->data) return 1;
253: return 0;
254: }
---
How do I overcome this issue and make valgrind work.
Please let me know if further information is needed.
|
|
From: Bart V. A. <bva...@ac...> - 2010-06-19 14:59:41
|
On Fri, Jun 18, 2010 at 1:18 PM, Pramod <akp...@gm...> wrote:
>
> I have cross-compiled valgrind 3.5.0 to work on MontaVista Linux.
>
> After installing (copied bin, lib, include directories to montavista machine),
> and running valgrind with no arguments, I get a core file from memcheck.
>
> Using GDB, I see that the core occurs at line 251 in mc_leakcheck.c.
>
> ---
> Program terminated with signal 11, Segmentation fault.
>
> #0 0x000000000000000c in compare_MC_Chunks (n1=0x0, n2=0x0)
> at mc_leakcheck.c:251
> 251 mc_leakcheck.c: No such file or directory.
> in mc_leakcheck.c
> ---
>
> ---
> 246: // Compare the MC_Chunks by 'data' (i.e. the address of the block).
> 247: static Int compare_MC_Chunks(void* n1, void* n2)
> 248: {
> 249: MC_Chunk* mc1 = *(MC_Chunk**)n1;
> 250: MC_Chunk* mc2 = *(MC_Chunk**)n2;
> 251: if (mc1->data < mc2->data) return -1;
> 252: if (mc1->data > mc2->data) return 1;
> 253: return 0;
> 254: }
> ---
>
> How do I overcome this issue and make valgrind work.
> Please let me know if further information is needed.
Valgrind itself and the client program run in the same memory space.
So it is possible that a client program overwrites data structures
managed by Valgrind. You should start with fixing all errors in the
analyzed program and that were reported by memcheck before it crashed.
Bart.
|
|
From: Pramod <akp...@gm...> - 2010-06-21 06:03:55
|
> > On Fri, Jun 18, 2010 at 1:18 PM, Pramod <akpramod <at> gmail.com> wrote: > > > > I have cross-compiled valgrind 3.5.0 to work on MontaVista Linux. > > > > After installing (copied bin, lib, include directories to montavista machine), > > and running valgrind with no arguments, I get a core file from memcheck. > > > > Using GDB, I see that the core occurs at line 251 in mc_leakcheck.c. > > Thanks Bart for the reply. As mentioned in my original post: I have not provided any input arguments to valgrind when it dumped core. Also, I cross-compiled valgrind on host Solaris for MontaVista Linux target. |
|
From: Bart V. A. <bva...@ac...> - 2010-06-21 10:16:16
|
On Mon, Jun 21, 2010 at 8:03 AM, Pramod <akp...@gm...> wrote: >> >> On Fri, Jun 18, 2010 at 1:18 PM, Pramod <akpramod <at> gmail.com> wrote: >> > >> > I have cross-compiled valgrind 3.5.0 to work on MontaVista Linux. >> > >> > After installing (copied bin, lib, > include directories to montavista machine), > >> > and running valgrind with no arguments, > I get a core file from memcheck. >> > >> > Using GDB, I see that the core occurs at line 251 in mc_leakcheck.c. >> > > Thanks Bart for the reply. > As mentioned in my original post: > I have not provided any input arguments to > valgrind when it dumped core. > > Also, I cross-compiled valgrind on host Solaris > for MontaVista Linux target. The fact that Valgrind has been cross-compiled shouldn't affect its behavior. Sorry, I had overlooked that no input arguments were provided. You can see what happens while Valgrind starts by running the following command: valgrind -v -d -d Bart. |
|
From: Pramod <akp...@gm...> - 2010-07-14 12:08:48
|
Bart Van Assche <bvanassche <at> acm.org> writes: > > On Mon, Jun 21, 2010 at 8:03 AM, Pramod <akpramod <at> gmail.com> wrote: > >> > >> On Fri, Jun 18, 2010 at 1:18 PM, Pramod <akpramod <at> gmail.com> wrote: > >> > > >> > I have cross-compiled valgrind 3.5.0 to work on MontaVista Linux. > >> > > >> > After installing (copied bin, lib, > > include directories to montavista machine), > > > >> > and running valgrind with no arguments, > > I get a core file from memcheck. > >> > > >> > Using GDB, I see that the core occurs at line 251 in mc_leakcheck.c. > >> > > > Thanks Bart for the reply. > > As mentioned in my original post: > > I have not provided any input arguments to > > valgrind when it dumped core. > > > > Also, I cross-compiled valgrind on host Solaris > > for MontaVista Linux target. > > The fact that Valgrind has been cross-compiled shouldn't affect its behavior. > > Sorry, I had overlooked that no input arguments were provided. You can > see what happens while Valgrind starts by running the following > command: > > valgrind -v -d -d > > Bart. > > ------------------------------------------------------------------------------ > ThinkGeek and WIRED's GeekDad team up for the Ultimate > GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the > lucky parental unit. See the prize list and enter to win: > http://p.sf.net/sfu/thinkgeek-promo > I ran valgirnd -v -d -d and following is the output. It still fails at the same point. [flx208]-> ./valgrind -v -d -d --7131:1:debuglog DebugLog system started by Stage 1, level 2 logging requested --7131:1:launcher no tool requested, defaulting to 'memcheck' --7131:1:launcher no client specified, defaulting platform to 'x86-linux' --7131:1:launcher launching /home/vg/lib/valgrind/memcheck-x86-linux Segmentation fault (core dumped) I used the following command to configure valgrind. Also, I had to do some changes (hack) configure to run it for cross compilation environment. ./configure --host=x86_64-linux --build=sparc CXX=/opt/mvista/cge5.1_p2/monta vista/cge/devkit/x86/em64t/bin/em64t-g++ CPP=/opt/mvista/cge5.1_p2/montavista/cge/devkit/x86/em64t/bin/em64t-cpp CC=/opt/mvista/cge5.1_p2/montavista/cge/devkit/x86/em64t/bin/em64t-gcc --prefix="/home/vg" --disable-tls Please help me solve this crash of memcheck. |