[DTrace-devel] [oracle/dtrace-utils] 2cc19c: string: ensure string size is handled correctly

Kris Van Hees noreply at github.com
Thu Aug 14 22:04:59 UTC 2025


  Branch: refs/heads/dev-queue
  Home:   https://github.com/oracle/dtrace-utils
  Commit: 2cc19c55c52bbe3b1161bb43d5d08e8eed11120a
      https://github.com/oracle/dtrace-utils/commit/2cc19c55c52bbe3b1161bb43d5d08e8eed11120a
  Author: Kris Van Hees <kris.van.hees at oracle.com>
  Date:   2025-08-14 (Thu, 14 Aug 2025)

  Changed paths:
    M libdtrace/dt_bpf.c
    M libdtrace/dt_cg.c
    M test/unittest/codegen/tst.str_const_length.d
    M test/unittest/codegen/tst.str_data_size.d
    M test/unittest/codegen/tst.str_store_var.d
    M test/unittest/funcs/inet_ntoa6/tst.inet_ntoa6.strsize_10.r
    M test/unittest/funcs/strjoin/tst.strjoin-bordercases.d
    M test/unittest/funcs/strjoin/tst.strjoin-capped-size-2.d
    M test/unittest/funcs/strjoin/tst.strjoin-capped-size-3.d
    M test/unittest/funcs/strjoin/tst.strjoin-capped-size.d
    M test/unittest/funcs/strjoin/tst.strjoin_nonDPTR.d
    A test/unittest/funcs/strlen/tst.capped-size.d
    R test/unittest/funcs/strlen/tst.capped-sizw.d
    M test/unittest/funcs/strtok/tst.strtok_long.d
    M test/unittest/funcs/strtok/tst.strtok_long.r
    M test/unittest/funcs/substr/tst.substr-stored-len.d
    M test/unittest/funcs/substr/tst.substr-strsize.d
    M test/unittest/funcs/substr/tst.substr_nonDPTR.d
    M test/unittest/funcs/tst.basename_nonDPTR.d
    M test/unittest/funcs/tst.inet_ntoa_nonDPTR.d
    M test/unittest/funcs/tst.lltostr-short.d
    M test/unittest/variables/tvar/tst.str-size.d

  Log Message:
  -----------
  string: ensure string size is handled correctly

A string is defined as a character array of size strsize.  Strings
that are less that strsize in length are terminated by a NUL byte.
This implies that the NUL byte is part of the array and therefore,
strsize is indeed the size of the array and not the maximum number
of characters in the string.

Tests are adjusted to reflect this behaviour.

Signed-off-by: Kris Van Hees <kris.van.hees at oracle.com>
Reviewed-by: Eugene Loh <eugene.loh at oracle.com>


  Commit: d96bf293af145ba9f9abed1f4ee118f8a2b1c441
      https://github.com/oracle/dtrace-utils/commit/d96bf293af145ba9f9abed1f4ee118f8a2b1c441
  Author: Kris Van Hees <kris.van.hees at oracle.com>
  Date:   2025-08-14 (Thu, 14 Aug 2025)

  Changed paths:
    M bpf/get_dvar.c

  Log Message:
  -----------
  bpf: force generating code that all verifiers accept

The compiler could optimize val = *valp in a way where the verifier on
older kernels would complain.  We use inline assembler to force the
not optimize this expression and instead to always read the value as a
scalar.

The kernel gained support for using map_value addresses read from the
stack with commit cd17d38f8b28f ("bpf: Permits pointers on stack for
helper calls") which first appeared in kernel 5.11.

Signed-off-by: Kris Van Hees <kris.van.hees at oracle.com>
Reviewed-by: Eugene Loh <eugene.loh at oracle.com>


  Commit: 51b2ebdd59eddaeab2eb4ce8d164feb9f8b18954
      https://github.com/oracle/dtrace-utils/commit/51b2ebdd59eddaeab2eb4ce8d164feb9f8b18954
  Author: Kris Van Hees <kris.van.hees at oracle.com>
  Date:   2025-08-14 (Thu, 14 Aug 2025)

  Changed paths:
    M libdtrace/dt_prov_uprobe.c

  Log Message:
  -----------
  uprobe: do not call populate_args() for pid probes

Only USDT (regular and is-enabled) probes need populate_args().

Signed-off-by: Kris Van Hees <kris.van.hees at oracle.com>
Reviewed-by: Eugene Loh <eugene.loh at oracle.com>


Compare: https://github.com/oracle/dtrace-utils/compare/8e6924a643f0...51b2ebdd59ed

To unsubscribe from these emails, change your notification settings at https://github.com/oracle/dtrace-utils/settings/notifications



More information about the DTrace-devel mailing list