[DTrace-devel] [PATCH 4/7] Increase the maximum size of strstab

Kris Van Hees kris.van.hees at oracle.com
Wed Dec 7 17:53:01 UTC 2022


On Tue, Dec 06, 2022 at 05:14:36PM -0500, Eugene Loh via DTrace-devel wrote:
> 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?

I chose not to get rid of the define just yet because that entire set of
defines needs to be reviewed and whatever is not needed, be dropped).  This
patch gives us the minimal change to accomplish what we need.

Also, there is value to this because the raw size of the strtab is actually
much larger.  This define is a limit on the size of strtab we are able (or
willing) to support in our programs.

> 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 */
> 
> _______________________________________________
> DTrace-devel mailing list
> DTrace-devel at oss.oracle.com
> https://oss.oracle.com/mailman/listinfo/dtrace-devel



More information about the DTrace-devel mailing list