[Mesa-dev] [PATCH 4/6] EGL: Call the EGL_KHR_debug callback on errors.

Kyle Brenneman kbrenneman at nvidia.com
Tue Sep 6 20:08:55 UTC 2016


The patch also changes _eglDebugReport so that it calls 
_eglInternalError at the end instead of _eglError.

-Kyle

On 09/06/2016 01:53 PM, Adam Jackson wrote:
> On Wed, 2016-07-06 at 10:33 -0600, Kyle Brenneman wrote:
>
>> @@ -292,6 +292,24 @@ _eglError(EGLint errCode, const char *msg)
>>      return EGL_FALSE;
>>   }
>>   
>> +EGLBoolean
>> +_eglError(EGLint errCode, const char *msg)
>> +{
>> +   if (errCode != EGL_SUCCESS) {
>> +      EGLint type;
>> +      if (errCode == EGL_BAD_ALLOC) {
>> +         type = EGL_DEBUG_MSG_CRITICAL_KHR;
>> +      } else {
>> +         type = EGL_DEBUG_MSG_ERROR_KHR;
>> +      }
>> +
>> +      _eglDebugReport(errCode, NULL, msg, type, NULL, NULL);
>> +   } else {
>> +      _eglInternalError(errCode, msg);
>> +   }
>> +   return EGL_FALSE;
>> +}
> I don't think this can be right? _eglDebugReport ends with:
>
>     if (type == EGL_DEBUG_MSG_CRITICAL_KHR || type == EGL_DEBUG_MSG_ERROR_KHR) {
>        _eglError(error, command);
>     }
>
> So this looks like it could mutually recurse until you run out of stack
> space and crash. I'll try to write a test to prove the point but maybe
> I'm missing something about how this is meant to work.
>
> - ajax



More information about the mesa-dev mailing list