[DTrace-devel] [PATCH] Need -w for destructive actions, even if clause is not used

Eugene Loh eugene.loh at oracle.com
Thu Jul 17 16:37:20 UTC 2025


On 7/15/25 06:59, Nick Alcock wrote:

> On 11 Jul 2025, eugene loh uttered the following:
>> From: Eugene Loh <eugene.loh at 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.
>>
>> The test err.Z_no-w.sh was misguided and is replaced by a more
>> direct test.
>>
>> Signed-off-by: Eugene Loh <eugene.loh at oracle.com>
> Reviewed-by: Nick Alcock <nick.alcock at oracle.com>
>
> modulo one microscopic annoyance (I am not a real unix programmer, I
> don't like creat() and think we shouldn't add more).

Sorry, I don't know what you're asking for here.

>> diff --git a/libdtrace/dt_bpf.c b/libdtrace/dt_bpf.c
>> @@ -1304,6 +1313,11 @@ dt_bpf_load_progs(dtrace_hdl_t *dtp, uint_t cflags)
>>   
>>   		DT_DISASM_PROG_LINKED(dtp, cflags, dp, stderr, NULL, prp->desc);
>>   
>> +		/*
>> +		 * This check should never fail since, if any action is
> Grammar:
>
> This check should never fail, since if any action is

I think I see what you're saying:  separate the two phrases with a 
comma.  But there is a big appositional phrase in there ("if any action 
is destructive and -w is not set") and I wanted to set it off with the 
commas.  Maybe I'm wrong.  Dunno.

>> +		 * destructive and -w is not set, we should already have
>> +		 * failed.
>> +		 */
> (but worth keeping anyway, I agree.)



More information about the DTrace-devel mailing list