pcp
[Top] [All Lists]

RE: valgrind oddness qa/828

To: "'Frank Ch. Eigler'" <fche@xxxxxxxxxx>
Subject: RE: valgrind oddness qa/828
From: "Ken McDonell" <kenj@xxxxxxxxxxxxxxxx>
Date: Fri, 5 Sep 2014 18:12:57 +1000
Cc: "'PCP'" <pcp@xxxxxxxxxxx>
Delivered-to: pcp@xxxxxxxxxxx
In-reply-to: <y0md2ba29j5.fsf@xxxxxxxx>
References: <5408F426.1060107@xxxxxxxxxxxxxxxx> <y0md2ba29j5.fsf@xxxxxxxx>
Thread-index: AQJPy6PtcK+tssWU+ZkOqIaImYj7XAG9mv7xmuQ7eyA=
> From: Frank Ch. Eigler [mailto:fche@xxxxxxxxxx]
>  ...
> Just a WAG, but could it be that *icp is getting corrupted by a
misaddressed
> assignment on line 1257?

Fair guess Frank.

But this is smelling like a valgrind/toolchain bug.

If I change the source thusly ...

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 fprintf(stderr, "new float pval=%p icp=%p t_prior=%.6f\n",
&rp->vset[j]->vl    ist[i].value.pval, icp, icp->t_prior);
1258                     rp->vset[j]->vlist[i++].value.pval = vp;
1259                     if (icp->t_prior == t_req)

there is nothing strange reported (specifically the address of  "pval" is
not aliased to the address icp points to) BUT the valgrind error goes away
... Heisenbug strikes again.

Comment out line 1257 and the valgrind reported "error" returns.

I'm planning to suppress this one conditionally for this version of valgrind
and gcc.

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