|
From: Fielder, T. P. <tp...@sa...> - 2005-09-12 17:02:21
|
Hi, I'm new to valgrind, and am attempting to use cachegrind, but am = receiving the following error: Any ideas? =3D=3D10326=3D=3D =3D=3D10326=3D=3D Stack overflow in thread 0: can't grow stack to 0x0 --10326-- INTERNAL ERROR: Valgrind received a signal 11 (SIGSEGV) - = exiting --10326-- si_code=3D1 Fault EIP: 0xB002F580; Faulting address: 0x0 --10326-- esp=3D0xB04F6CFC valgrind: the `impossible' happened: Killed by fatal signal Basic block ctr is approximately 402065958 =3D=3D10326=3D=3D at 0xB002F580: vgPlain_strlen (vg_mylibc.c:718) =3D=3D10326=3D=3D by 0xB101A781: fprint_CC_table_and_calc_totals = (cg_main.c:833) =3D=3D10326=3D=3D by 0xB101AA52: vgSkin_fini (cg_main.c:914) =3D=3D10326=3D=3D by 0xB005BCD7: vgSkinInternal_fini = (vg_toolint.c:36) =3D=3D10326=3D=3D by 0xB002A928: vgPlain_shutdown_actions = (vg_main.c:2689) =3D=3D10326=3D=3D by 0xB0070809: vgArch_thread_wrapper (core_os.c:77) sched status: running_tid=3D0 |
|
From: Nicholas N. <nj...@cs...> - 2005-09-12 18:31:11
|
On Mon, 12 Sep 2005, Fielder, Todd Patrick wrote: > I'm new to valgrind, and am attempting to use cachegrind, but am > receiving the following error: Any ideas? > > ==10326== > ==10326== Stack overflow in thread 0: can't grow stack to 0x0 > --10326-- INTERNAL ERROR: Valgrind received a signal 11 (SIGSEGV) - exiting > --10326-- si_code=1 Fault EIP: 0xB002F580; Faulting address: 0x0 > --10326-- esp=0xB04F6CFC > > > valgrind: the `impossible' happened: > Killed by fatal signal > Basic block ctr is approximately 402065958 > ==10326== at 0xB002F580: vgPlain_strlen (vg_mylibc.c:718) > ==10326== by 0xB101A781: fprint_CC_table_and_calc_totals (cg_main.c:833) > ==10326== by 0xB101AA52: vgSkin_fini (cg_main.c:914) > ==10326== by 0xB005BCD7: vgSkinInternal_fini (vg_toolint.c:36) > ==10326== by 0xB002A928: vgPlain_shutdown_actions (vg_main.c:2689) > ==10326== by 0xB0070809: vgArch_thread_wrapper (core_os.c:77) I haven't seen that before. What does the output look like with --tool=memcheck and --tool=none? Nick |
|
From: Nicholas N. <nj...@cs...> - 2005-09-12 21:03:31
|
On Mon, 12 Sep 2005, Fielder, Todd Patrick wrote: >> I'm new to valgrind, and am attempting to use cachegrind, but am >> receiving the following error: Any ideas? >> >> ==10326== >> ==10326== Stack overflow in thread 0: can't grow stack to 0x0 >> --10326-- INTERNAL ERROR: Valgrind received a signal 11 (SIGSEGV) - exiting >> --10326-- si_code=1 Fault EIP: 0xB002F580; Faulting address: 0x0 >> --10326-- esp=0xB04F6CFC >> >> >> valgrind: the `impossible' happened: >> Killed by fatal signal >> Basic block ctr is approximately 402065958 >> ==10326== at 0xB002F580: vgPlain_strlen (vg_mylibc.c:718) >> ==10326== by 0xB101A781: fprint_CC_table_and_calc_totals (cg_main.c:833) >> ==10326== by 0xB101AA52: vgSkin_fini (cg_main.c:914) >> ==10326== by 0xB005BCD7: vgSkinInternal_fini (vg_toolint.c:36) >> ==10326== by 0xB002A928: vgPlain_shutdown_actions (vg_main.c:2689) >> ==10326== by 0xB0070809: vgArch_thread_wrapper (core_os.c:77) > > Thanks for responding, the output of memcheck is: > [snip] > and the output of --tool=none is: > [snip] So it's Cachegrind-specific... it's a very strange stack trace, it says the problem is in VG_(strlen)(), which is a very simple function and seems unlikely to cause such a crash. A workaround would be to try just commenting out the line in question -- you won't get a "cmd:" line in your cachegrind.out file but that doesn't matter very much. As for fixing the bug -- can you provide a small test case? Without one it will be hard to know what's going on. Nick |
|
From: Julian S. <js...@ac...> - 2005-09-12 21:24:51
|
> >> ==10326== > >> ==10326== Stack overflow in thread 0: can't grow stack to 0x0 > >> --10326-- INTERNAL ERROR: Valgrind received a signal 11 (SIGSEGV) - > >> exiting --10326-- si_code=1 Fault EIP: 0xB002F580; Faulting address: 0x0 > >> --10326-- esp=0xB04F6CFC > >> > >> > >> valgrind: the `impossible' happened: > >> Killed by fatal signal > >> Basic block ctr is approximately 402065958 > >> ==10326== at 0xB002F580: vgPlain_strlen (vg_mylibc.c:718) > >> ==10326== by 0xB101A781: fprint_CC_table_and_calc_totals > >> (cg_main.c:833) ==10326== by 0xB101AA52: vgSkin_fini (cg_main.c:914) > >> ==10326== by 0xB005BCD7: vgSkinInternal_fini (vg_toolint.c:36) > >> ==10326== by 0xB002A928: vgPlain_shutdown_actions (vg_main.c:2689) > >> ==10326== by 0xB0070809: vgArch_thread_wrapper (core_os.c:77) > > So it's Cachegrind-specific... it's a very strange stack trace, it says > the problem is in VG_(strlen)(), which is a very simple function and seems > unlikely to cause such a crash. Is it possible that fprint_CC_table_and_calc_totals could have passed NULL to vgPlain_strlen? J |
|
From: Nicholas N. <nj...@cs...> - 2005-09-12 21:31:30
|
On Mon, 12 Sep 2005, Julian Seward wrote:
> Is it possible that fprint_CC_table_and_calc_totals could have passed
> NULL to vgPlain_strlen?
Doesn't seem likely... here's the code:
for (i = 0; i < VG_(client_argc); i++) {
VG_(write)(fd, " ", 1);
VG_(write)(fd, VG_(client_argv)[i], VG_(strlen)(VG_(client_argv)[i]));
}
VG_(client_argv)[] would have to be screwed up.
Todd, can you give us Cachegrind's output running with the -v flag?
Thanks. Also, it might be worth trying again with Valgrind 3.0.1.
Nick
|
|
From: Julian S. <js...@ac...> - 2005-09-12 21:45:28
|
On Monday 12 September 2005 22:30, you wrote:
> On Mon, 12 Sep 2005, Julian Seward wrote:
> > Is it possible that fprint_CC_table_and_calc_totals could have passed
> > NULL to vgPlain_strlen?
>
> Doesn't seem likely... here's the code:
>
> for (i = 0; i < VG_(client_argc); i++) {
> VG_(write)(fd, " ", 1);
> VG_(write)(fd, VG_(client_argv)[i],
> VG_(strlen)(VG_(client_argv)[i])); }
>
> VG_(client_argv)[] would have to be screwed up.
The thing is .. this can't be 3.0.1. I already fixed it.
Simon Marlow reported the same thing a while back, running ghc
compiled code on cachegrind. These programs mess with their argv
and set some entries to NULL. After I expressed doubt that
this was portable, he pointed out that POSIX allows a program to
assign to its argv[].
The 3.0.1 version looks like this:
for (i = 0; i < VG_(client_argc); i++) {
if (VG_(client_argv)[i] == NULL)
continue;
VG_(write)(fd, " ", 1);
VG_(write)(fd, VG_(client_argv)[i], VG_(strlen)(VG_(client_argv)[i]));
}
Todd, what version of V is this? Is it 3.0.1? Does your program
mess with its argv?
J
|