|
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
|