public inbox for dtrace@lists.linux.dev
 help / color / mirror / Atom feed
From: Kris Van Hees <kris.van.hees@oracle.com>
To: Eugene Loh <eugene.loh@oracle.com>
Cc: Kris Van Hees <kris.van.hees@oracle.com>,
	dtrace@lists.linux.dev, dtrace-devel@oss.oracle.com
Subject: Re: [PATCH 3/3] usdt parser: make sure prbmap is cleaned up in case of error
Date: Mon, 30 Jun 2025 19:09:00 -0400	[thread overview]
Message-ID: <aGMZDK633uF51oJ6@oracle.com> (raw)
In-Reply-To: <c1bae7f0-6024-6cbf-8dc7-61b7ba1b99ea@oracle.com>

On Mon, Jun 30, 2025 at 06:07:39PM -0400, Eugene Loh wrote:
> Reviewed-by: Eugene Loh <eugene.loh@oracle.com>
> but it'd be great if Nick could take a look, given that he reviewed the file
> earlier.
> Out of curiosity, was there some case where the assertion failed? Could that
> be a test case?

There was an assertion failure but not one that we can have a test for since
it is in dtprobed and the testsuite cannot capture those at this point.

> (Minor nit:  I'd go for a sentence break after "allocate iterators.")
> 
> On 6/24/25 17:40, Kris Van Hees wrote:
> > Signed-off-by: Kris Van Hees <kris.van.hees@oracle.com>
> > ---
> >   libcommon/usdt_parser_notes.c | 13 +++++++------
> >   1 file changed, 7 insertions(+), 6 deletions(-)
> > 
> > diff --git a/libcommon/usdt_parser_notes.c b/libcommon/usdt_parser_notes.c
> > index d3d744fb..c98c9fb0 100644
> > --- a/libcommon/usdt_parser_notes.c
> > +++ b/libcommon/usdt_parser_notes.c
> > @@ -829,15 +829,16 @@ usdt_parse_notes(int out, dof_helper_t *dhp, usdt_data_t *data)
> >   	goto out;
> >   err:
> > -	rc = -1;
> > -
> > -out:
> >   	/*
> > -	 * All tracepoint probes in prbmap should have been removed during
> > -	 * proessing.
> > +	 * In case of an error, we don't know whether we can allocate iterators
> > +	 * so we have few options to provide cleanup.  Since cleanup is all we
> > +	 * do now, we plug the probe cleanup function into the ops for prbmap,
> > +	 * and let the hashtable destroy function take care of all cleanup.
> >   	 */
> > -	assert(dt_htab_entries(prbmap) == 0);
> > +	prb_htab_ops.del = (htab_del_fn)prb_del_probe;
> > +	rc = -1;
> > +out:
> >   	dt_htab_destroy(prvmap);
> >   	dt_htab_destroy(prbmap);

  reply	other threads:[~2025-06-30 23:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-24 21:40 [PATCH 3/3] usdt parser: make sure prbmap is cleaned up in case of error Kris Van Hees
2025-06-30 22:07 ` Eugene Loh
2025-06-30 23:09   ` Kris Van Hees [this message]
2025-07-15 14:14 ` Nick Alcock

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aGMZDK633uF51oJ6@oracle.com \
    --to=kris.van.hees@oracle.com \
    --cc=dtrace-devel@oss.oracle.com \
    --cc=dtrace@lists.linux.dev \
    --cc=eugene.loh@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox