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] Need -w for destructive actions, even if clause is not used
Date: Fri, 1 Aug 2025 14:22:13 -0400 [thread overview]
Message-ID: <aI0F1TEE1b10zbVP@oracle.com> (raw)
In-Reply-To: <65fbbdeb-54af-ff2a-cef3-ebf019f6393d@oracle.com>
On Fri, Aug 01, 2025 at 02:15:18PM -0400, Eugene Loh wrote:
> On 8/1/25 11:36, Kris Van Hees wrote:
>
> > On Fri, Jul 11, 2025 at 12:40:24AM -0400, eugene.loh@oracle.com wrote:
> > > From: Eugene Loh <eugene.loh@oracle.com>
> > >
> > > If a clause includes a destructive action but -w is not used, dtrace
> > > should not start up, even if the clause is ignored (due to -Z).
> > > Solaris treated this as a runtime error. We should do the same.
> > >
> > > diff --git a/test/unittest/options/err.no-w-or-destructive2.d b/test/unittest/options/err.no-w-or-destructive2.d
> > > new file mode 100644
> > > @@ -0,0 +1,25 @@
> > > +/*
> > > + * ASSERTION: Without -w or -xdestructive, destructive operations are not ok,
> > > + * even if a clause will be ignored since it does not exist and
> > > + * -Z was specified.
> > This could do with some rewriting.
>
> Sorry, what does "this" refer to? The comment, the test, or the patch?
The text of the assertion.
> > The issue is that DTrace used to always
> > load all tracing programs, and the kernel would activate them as needed. We
> > now only load programs for enabled probes (and with -Z active, we may load
> > some programs later).
> >
> > What we need to be testing here is that if any clauses of a tracing script
> > contain destructive actions, and we are using the script for probing, then
> > an error should be reported unless we are allowing destructive actions (-w
> > or -xdestructive).
>
> I think we have such a test?
Yes, I just don't think that the way the assertion is phrased well. E.g.
talking about a clause being ignored since it does not exist. The clause
very certainly exists (since it is in the script). It is the probe that
does not exist at the point of initial program construction and loading).
> The case being tested here is where a destructive action is specified, no -w
> is specified, but the clause will not be exercised since the probe does not
> exist and -Z allows us to ignore it. In this case, should the script be
> accepted or rejected? The patch says the script should be rejected, which
> was the legacy behavior. (People familiar with the legacy implementation may
> understand why the legacy behavior was what it was, but the question now is
> whether that behavior should be changed.)
Yes, again, it is the way the assertion is phrased that needs fixing I think.
>
> > > +/* @@runtest-opts: -Z */
> > > +
> > > +bogus:bogus:bogus:bogus
> > > +{
> > > + system("echo ok");
> > > +}
prev parent reply other threads:[~2025-08-01 18:22 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-11 4:40 [PATCH] Need -w for destructive actions, even if clause is not used eugene.loh
2025-07-15 10:59 ` Nick Alcock
2025-07-17 16:37 ` Eugene Loh
2025-07-22 13:36 ` Nick Alcock
2025-08-01 15:36 ` Kris Van Hees
2025-08-01 17:49 ` Kris Van Hees
2025-08-01 18:02 ` Eugene Loh
2025-08-01 18:19 ` Kris Van Hees
2025-08-01 18:15 ` Eugene Loh
2025-08-01 18:22 ` Kris Van Hees [this message]
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=aI0F1TEE1b10zbVP@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