[Mesa-dev] [PATCH 7/7] mesa: HACK! tweak the MAX_DEBUG_MESSAGE_LENGTH limit

Timothy Arceri t_arceri at yahoo.com.au
Sun Nov 22 17:15:21 PST 2015


On Mon, 2015-11-23 at 00:59 +0000, Emil Velikov wrote:
> On 23 November 2015 at 00:35, Timothy Arceri <t_arceri at yahoo.com.au> wrote:
> > On Sun, 2015-11-22 at 23:21 +0000, Emil Velikov wrote:
> > > Based on one's interpretation of the spec one may say that length (when
> > > non negative) either considers or doesn't the null terminator.
> > > 
> > > I'm leaning towards the latter case, although the CTS authors are
> > > thinking about the former.
> > 
> > The spec says:
> > 
> >     "The lengths of all messages, including their null terminators, must
> > be
> >     guaranteed to be less or equal to the value of the
> >     implementation-dependent constant MAX_DEBUG_MESSAGE_LENGTH."
> > 
> So it seems that we're missing the "walk over all messages, calculate
> and check the total length" step. 

No I think the spec is just badly worded. There is MAX_DEBUG_LOGGED_MESSAGES
to limit the number of messaged so as long as a message is not longer than
 MAX_DEBUG_MESSAGE_LENGTH and there isn't more than MAX_DEBUG_LOGGED_MESSAGES
then there should be no need to do that.


> Seems that _mesa_gl_vdebug,
> _mesa_error (do_output || do_log), _mesa_shader_debug could use the
> same thing.
> 
> Might as well reworking the function to "cap or error", and push it
> down to log_msg() might.
> 
> Nicely spotted, Tim.
> -Emil


More information about the mesa-dev mailing list