[Mesa-dev] [PATCH 2/2] mesa: Handle negative length in glPushDebugGroup().

Eduardo Lima Mitev elima at igalia.com
Thu Mar 24 08:35:17 UTC 2016


Both patches are:

Reviewed-by: Eduardo Lima Mitev <elima at igalia.com>

Together with the other patch you sent earlier, I get these results for 
dEQP-GLES31.functional.debug.* :

Test run totals:
   Passed:        1004/1010 (99.4%)
   Failed:        6/1010 (0.6%)
   Not supported: 0/1010 (0.0%)
   Warnings:      0/1010 (0.0%)

Nice!

Eduardo

On 03/24/2016 08:31 AM, Kenneth Graunke wrote:
> The KHR_debug spec doesn't actually say we should handle this, but that
> is most likely an oversight - it says to check against strlen and
> generate errors if length is negative.  It appears they just forgot to
> explicitly spell out that we should then proceed to actually handle it.
>
> Fixes crashes from uncaught std::string exceptions in many
> dEQP-GLES31.functional.debug.error_filters.* tests.
>
> Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
> ---
>   src/mesa/main/debug_output.c | 3 +++
>   1 file changed, 3 insertions(+)
>
> diff --git a/src/mesa/main/debug_output.c b/src/mesa/main/debug_output.c
> index 001f63e..85f64bd 100644
> --- a/src/mesa/main/debug_output.c
> +++ b/src/mesa/main/debug_output.c
> @@ -1189,6 +1189,9 @@ _mesa_PushDebugGroup(GLenum source, GLuint id, GLsizei length,
>      if (!validate_length(ctx, callerstr, length, message))
>         return; /* GL_INVALID_VALUE */
>
> +   if (length < 0)
> +      length = strlen(message);
> +
>      debug = _mesa_lock_debug_state(ctx);
>      if (!debug)
>         return;
>



More information about the mesa-dev mailing list