public inbox for dtrace@lists.linux.dev
 help / color / mirror / Atom feed
From: Eugene Loh <eugene.loh@oracle.com>
To: Kris Van Hees <kris.van.hees@oracle.com>,
	dtrace@lists.linux.dev, dtrace-devel@oss.oracle.com
Subject: Re: [PATCH 2/3] cg: validate tstring alloc/free
Date: Wed, 16 Jul 2025 19:07:59 -0400	[thread overview]
Message-ID: <529c8de5-2eaa-6bbd-1dfb-392ab4d4a4d0@oracle.com> (raw)
In-Reply-To: <2032c9f8-aaa5-91ad-64ef-53ba665613b6@oracle.com>

I was a little concerned about this patch, but also wanted to expedite 
review.  FWIW, testing shows

test/unittest/builtinvar/tst.psinfo-bug21974606.d:
test/unittest/builtinvar/tst.psinfo-bug22561297.d:
test/unittest/builtinvar/tst.psinfo.d:
test/unittest/builtinvar/tst.psinfo1.d:
test/unittest/fbtprovider/tst.entryargs2.sh:
test/unittest/funcs/copyinstr/tst.copyinstr-high-maxsize.d:
test/unittest/funcs/copyinstr/tst.copyinstr-low-maxsize.d:
test/unittest/funcs/copyinstr/tst.copyinstr-no-maxsize.d:
test/unittest/funcs/copyinstr/tst.copyinstr.d:
test/unittest/proc/tst.exec.sh:
test/unittest/proc/tst.execfail.ENOENT.sh:
test/unittest/proc/tst.execfail.sh:
test/unittest/proc/tst.pr_psargs.d:
test/unittest/proc/tst.pr_psargs_other_task.d:
test/unittest/usdt/tst.argmap-typed-partial.d:
test/unittest/usdt/tst.argmap-typed.d:
test/unittest/variables/bvar/tst.execargs.d:
test/demo/spec/specopen.d:

test/unittest/dif/bcopy.d:

failing on every VM.  (Well, bcopy is listed separately since we skip it 
on ARM.)  I'll try to put together a patch, but let me know if you 
already knew about this and have a fix.

On 7/16/25 00:45, Eugene Loh wrote:
> Reviewed-by: Eugene Loh <eugene.loh@oracle.com>
> though apparently
> undiscriminantly ->
> indiscriminately
>
> On 7/15/25 15:50, Kris Van Hees wrote:
>> Rather than undiscriminantly resetting tstring allocations at the
>> beginning of a compilation, actually verify that alloc/free of
>> tstrings is done correctly, i.e. that none are left allocated after
>> compilation is done.
>>
>> Signed-off-by: Kris Van Hees <kris.van.hees@oracle.com>
>> ---
>>   libdtrace/dt_cg.c | 9 +++++----
>>   1 file changed, 5 insertions(+), 4 deletions(-)
>>
>> diff --git a/libdtrace/dt_cg.c b/libdtrace/dt_cg.c
>> index bd0763d6..6c7ad076 100644
>> --- a/libdtrace/dt_cg.c
>> +++ b/libdtrace/dt_cg.c
>> @@ -1432,11 +1432,12 @@ dt_cg_tstring_reset(dtrace_hdl_t *dtp)
>>           ts = dtp->dt_tstrings;
>>           for (i = 0; i < DT_TSTRING_SLOTS; i++, ts++)
>>               ts->offset = i * size;
>> +    } else {
>> +        /* Ensure that all allocated tstrings were freed correctly. */
>> +        ts = dtp->dt_tstrings;
>> +        for (i = 0; i < DT_TSTRING_SLOTS; i++, ts++)
>> +            assert(ts->in_use == 0);
>>       }
>> -
>> -    ts = dtp->dt_tstrings;
>> -    for (i = 0; i < DT_TSTRING_SLOTS; i++, ts++)
>> -        ts->in_use = 0;
>>   }
>>     /*

  reply	other threads:[~2025-07-16 23:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-15 19:50 [PATCH 2/3] cg: validate tstring alloc/free Kris Van Hees
2025-07-16  4:45 ` Eugene Loh
2025-07-16 23:07   ` Eugene Loh [this message]
2025-07-17  0:22     ` Kris Van Hees
2025-07-17  0:45       ` Eugene Loh
2025-07-17  4:59         ` Kris Van Hees
2025-07-17 18:20         ` Kris Van Hees

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=529c8de5-2eaa-6bbd-1dfb-392ab4d4a4d0@oracle.com \
    --to=eugene.loh@oracle.com \
    --cc=dtrace-devel@oss.oracle.com \
    --cc=dtrace@lists.linux.dev \
    --cc=kris.van.hees@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