|
From: Philippe W. <phi...@sk...> - 2013-10-02 21:03:25
|
On Wed, 2013-10-02 at 07:01 +0200, Matthias Schwarzott wrote:
> > + for (h = LchStdString; h <= LchMultipleInheritance; h++) {
> > + if (heuristic_reachedness(addr, ch, ex, H2S(h)) == h) {
> > + VG_(umsg)("block at %#lx considered reachable "
> > + "by ptr %#lx using %s heuristic\n",
> > + ch->data, addr, pp_heuristic(h));
> > + }
> > + }
> > + tl_assert (h == N_LEAK_CHECK_HEURISTICS - 1);
>
> Hi!
>
> This assert in line mc_leakcheck.c, line 1037 fails for me, when doing
> gdb monitor command who_points_at on a possibly leaked block.
Thanks, fixed the problem in rev 13609.
> I wonder if the existing gdb test does not run into this.
No, because there was no test testing who_points_at with an
"interior-ly" pointed block.
This is tested now :).
>
> The assert must be:
>
> tl_assert (h == N_LEAK_CHECK_HEURISTICS);
>
> I wonder why the loop before also does not use the check "h <
> N_LEAK_CHECK_HEURISTICS" if there already is a constant
The idea of the assert is to double check the consistency between
the enum and the N_LEAK_CHECK_HEURISTICS: if the enum is changed
without changing the N_LEAK_CHECK_HEURISTICS, this assert should
detect it.
This detection half-worked in this case, except there was no test :(.
Have you tested these heuristics with a (big) c++ application ?
Philippe
|