pcp
[Top] [All Lists]

valgrind oddness qa/828

To: PCP <pcp@xxxxxxxxxxx>
Subject: valgrind oddness qa/828
From: Ken McDonell <kenj@xxxxxxxxxxxxxxxx>
Date: Fri, 05 Sep 2014 09:22:14 +1000
Delivered-to: pcp@xxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0
Can anyone help explain this?

valgrind reports ...

==4790== Conditional jump or move depends on uninitialised value(s)
==4790==    at 0x407A6F5: __pmLogFetchInterp (interp.c:1258)
==4790==    by 0x4075C4D: __pmLogFetch (logutil.c:1749)
==4790==    by 0x405A7C6: pmFetch (fetch.c:151)
==4790==    by 0x8049685: main (churnctx.c:398)
==4790==  Uninitialised value was created by a heap allocation
==4790==    at 0x4029EAD: malloc (in 
/usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==4790==    by 0x407A091: __pmLogFetchInterp (interp.c:1250)
==4790==    by 0x4075C4D: __pmLogFetch (logutil.c:1749)
==4790==    by 0x405A7C6: pmFetch (fetch.c:151)
==4790==    by 0x8049685: main (churnctx.c:398)
==4790== 

and the relevant part of interp.c is ...

1250                     if ((vp = (pmValueBlock *)malloc(need)) == NULL) {
1251                         sts = -oserror();
1252                         goto bad_alloc;
1253                     }
1254                     vp->vlen = need;
1255                     vp->vtype = PM_TYPE_FLOAT;
1256                     rp->vset[j]->valfmt = PM_VAL_DPTR;
1257                     rp->vset[j]->vlist[i++].value.pval = vp;
1258                     if (icp->t_prior == t_req)
1259                         memcpy((void *)vp->vbuf, (void 
*)icp->v_prior.pval->vbuf, sizeof(float));
1260                     else if (icp->t_next == t_req)

Is this a valgrind bug or is there something here I am not seeing?

And of course, it is *not* happening on all platforms!

<Prev in Thread] Current Thread [Next in Thread>