[DTrace-devel] [PATCH 4/7] Increase the maximum size of strstab
Eugene Loh
eugene.loh at oracle.com
Tue Dec 6 22:14:36 UTC 2022
I do not understand this. If the limit is SSIZE_MAX, then there is no
point in having a max (or a max check) at all. The test (soff >
DIF_STROFF_MAX) can never fail. So is the point to use a higher limit,
or to remove the limit entirely?
On 12/6/22 16:50, Kris Van Hees via DTrace-devel wrote:
> The strtab size was limited in the legacy version to 0x7fff. This
> was generally sufficient because of how the strtab was implemented.
> Now that all strings used in a probe program are stored in a single
> strtab (incl. probe description names), a higher limit is needed.
>
> All string offsets (and strtab size calculations) are using ssize_t,
> so we use SSIZE_MAX as the upper limit.
>
> Signed-off-by: Kris Van Hees <kris.van.hees at oracle.com>
> ---
> include/dtrace/dif_defines.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/dtrace/dif_defines.h b/include/dtrace/dif_defines.h
> index 43824646..d88b3b2e 100644
> --- a/include/dtrace/dif_defines.h
> +++ b/include/dtrace/dif_defines.h
> @@ -113,7 +113,7 @@
> #endif
>
> #define DIF_INTOFF_MAX 0xffff /* highest integer table offset */
> -#define DIF_STROFF_MAX 0x7fff /* highest string table offset */
> +#define DIF_STROFF_MAX SSIZE_MAX /* highest string table offset */
> #define DIF_REGISTER_MAX 0xff /* highest register number */
> #define DIF_VARIABLE_MAX 0xffff /* highest variable identifier */
> #define DIF_SUBROUTINE_MAX 0xffff /* highest subroutine code */
More information about the DTrace-devel
mailing list