[DTrace-devel] [PATCH] usdt parser: fix memory leak in provider and probe htabs
Nick Alcock
nick.alcock at oracle.com
Thu Jun 19 11:58:21 UTC 2025
On 19 Jun 2025, Kris Van Hees spake thusly:
> The prvmap and prbmap hashtable implementation was lacking code to
> ensure that entries are freed when the hashtables are destroyed. In
> addition, the pvp->pmap hashtables were also not cleaned up.
Much the same as what I wrote yesterday, but simpler and more obviously
correct, so I'd say pull it in, and I'll rebase my jailing series on top
of it.
> To provide cleaner data structures and to facilitate cleanup, tracepoint
> probes are now always removed from prbmap and either added to the
> pvp->pmap hashtable or added to the list of tracepoints for a particular
> probe. Therefore, when the prbmap is destroyed it no longer contains
> any entries.
Very nice...
> So, only pvp->pmap hashtables can contain probes. If they are function
> specific, they represent a tracepoint (and may have additional
> tracepoints linked to them). If they are not function specific, they
> provide a probe definition and they will contain probe argument data
> that needs freeing.
... but perhaps these two paragraphs should be in a comment in the code?
The shape of the data structures does matter to maintenance, after all.
> Signed-off-by: Kris Van Hees <kris.van.hees at oracle.com>
Reviewed-by: Nick Alcock <nick.alcock at oracle.com>, particularly if you
make those two paras comments.
--
NULL && (void)
More information about the DTrace-devel
mailing list