|
From: John R.
|
Julian Seward wrote:
> On Friday 24 June 2005 05:31, John Reiser wrote:
>
>>Under valgrind 2.4.0 as distributed by Fedora Core 4,
>>there is an off-by-one bug for sysctl(CTL_KERN, KERN_VERSION,).
>>The kernel sets 1+strlen(version_string) bytes, but memcheck
>>thinks that the terminating '\0' is not set.
>
>
> I think I fixed this a while back in the 3 line, but am not
> confident I did the right fix. The post-wrapper now looks
> like this:
>
> POST(sys_sysctl)
> {
> struct __vki_sysctl_args *args;
> args = (struct __vki_sysctl_args *)ARG1;
> if (args->oldlenp != NULL) {
> POST_MEM_WRITE((Addr)args->oldlenp, sizeof(*args->oldlenp));
> POST_MEM_WRITE((Addr)args->oldval, 1 + *args->oldlenp);
> }
> }
>
> where the fix was to the "1 +" in front of *args->oldlenp.
>
> If you apply the same to your 2.4.0 tree, does it fix the problem?
> It would be useful to know.
Yes, making that change to Fedora Core 4 package valgrind-2.4.0-3
fixes the bogus complaint from memcheck on /bin/date.
--
John Reiser, jreiser@BitWagon.com
|