https://registry.khronos.org/OpenGL-Refpages/gl4/html/glDebugMessageInsert.xhtml says:
GL_INVALID_VALUE is generated if the length of the message is greater than the value of GL_MAX_DEBUG_MESSAGE_LENGTH
Specification says:
An INVALID_VALUE error is generated if the number of characters in buf, excluding the null terminator when length is negative, is not less than the value of MAX_DEBUG_MESSAGE_LENGTH.
My interpretation of specification is that when length is not negative, INVALID_VALUE should not happen.
For reference, https://registry.khronos.org/OpenGL-Refpages/gl4/html/glPushDebugGroup.xhtml says:
GL_INVALID_VALUE is generated if length is negative and the number of characters in message, excluding the null-terminator, is not less than the value of GL_MAX_DEBUG_MESSAGE_LENGTH.
https://registry.khronos.org/OpenGL-Refpages/gl4/html/glDebugMessageInsert.xhtml says:
Specification says:
My interpretation of specification is that when length is not negative, INVALID_VALUE should not happen.
For reference, https://registry.khronos.org/OpenGL-Refpages/gl4/html/glPushDebugGroup.xhtml says: