Randomly crash on libGLESv2_POWERVR_ROGUE.so (glDrawElements+140)

Been investigating a crash in our app, that randomly occurs on some specific devices with PowerVR GPU. The casue is not clear, as the app does not crash on other devices, and there appears to be no relevant diagnostic messages in the log . I can however provide the exact call stack, and looking for someone with enough insight into internal logic of the driver to help me figure out why it would crash, and then hopefully how to work around that.

crash stack like this:
#04 pc 00000000000a5dbc /vendor/lib64/egl/libGLESv2_POWERVR_ROGUE.so
#05 pc 00000000000a594c /vendor/lib64/egl/libGLESv2_POWERVR_ROGUE.so
#06 pc 00000000000a69ec /vendor/lib64/egl/libGLESv2_POWERVR_ROGUE.so
#07 pc 00000000000af668 /vendor/lib64/egl/libGLESv2_POWERVR_ROGUE.so
#08 pc 00000000000b4d90 /vendor/lib64/egl/libGLESv2_POWERVR_ROGUE.so
#09 pc 00000000000b5f58 /vendor/lib64/egl/libGLESv2_POWERVR_ROGUE.so
#10 pc 00000000000cba3c /vendor/lib64/egl/libGLESv2_POWERVR_ROGUE.so
#11 pc 000000000002b78c /vendor/lib64/egl/libGLESv2_POWERVR_ROGUE.so
#12 pc 000000000002b2f0 /vendor/lib64/egl/libGLESv2_POWERVR_ROGUE.so (glDrawElements+140)
#13 pc 000000000047b290 /xxxxxx/xxx::Mesh::Draw()

Mesh::Draw() function as below:

void Mesh::Draw() const
{
    assert(mVAO != 0 && mVBO != 0 && mEBO != 0);
    if(mVAO == 0)
        X3D_LOG_ERROR("mesh draw: mVAO is 0");
    if(mVBO == 0)
        X3D_LOG_ERROR("mesh draw: mVBO is 0");
    if(mEBO == 0)
        X3D_LOG_ERROR("mesh draw: mEBO is 0");
    if(glIsVertexArray (mVAO))
        X3D_LOG_ERROR("mesh draw: mVAO is glIsVertexArray");
    if(glIsBuffer(mVBO))
        X3D_LOG_ERROR("mesh draw: mVBO is glIsBuffer");
    if(glIsBuffer(mEBO))
        X3D_LOG_ERROR("mesh draw: mEBO is glIsBuffer");
    glBindVertexArray(mVAO);
    glBindBuffer(GL_ARRAY_BUFFER, mVBO);
    GL_CHECK_ERROR("DrawMeshBeforeBind");
    glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, mEBO);
    GL_CHECK_ERROR("DrawMeshBeforeDrawElements");
    glDrawElements(mDrawStyle, mIndices.size(), GL_UNSIGNED_INT, 0);

    glBindBuffer(GL_ARRAY_BUFFER, 0);
    glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
    glBindVertexArray(0);

    GL_CHECK_ERROR("DrawMesh");
}

No GL_CHECK_ERROR is found, and mVAO is glIsVertexArray,mVBO is glIsBuffer,mEBO is glIsBuffer.
More information:
Renderer: PowerVR Rogue GE8322
OpenGL version: OpenGL ES 3.2 build 1.11@5471373

Hello zyy,

Welcome to PVR Developer Forum!

For us to be better diagnose your issue it would be helpful if you could share the pvr carbon recording and a full verbose logcat.

Kindly register and raise a ticket in our support portal while adding these attachments, [PowerVR Insider Support] [https://pvrsupport.imgtec.com] (https://pvrsupport.imgtec.com/).

Best Regards,
Nagnath

Hi Nagnath,

The crash seems to occur randomly on some machines with PowerVR GPU, and we have tried many times to reproduce it, but so far we have not been able to reproduce it on any machine. So sorry for that we cann’t be able to share the pvr carbon recording with you. We have located the crash in the glDrawElements function from libGLESv2_POWERVR_ROGUE.so, and we would like to know the specific stack information from you. Could you also provide a rough analysis of the possible causes? We hope that you can provide some information to help us identify the cause of the problem. Thank you very much.

crash stack :
#04 pc 00000000000a5dbc /vendor/lib64/egl/libGLESv2_POWERVR_ROGUE.so
#05 pc 00000000000a594c /vendor/lib64/egl/libGLESv2_POWERVR_ROGUE.so
#06 pc 00000000000a69ec /vendor/lib64/egl/libGLESv2_POWERVR_ROGUE.so
#07 pc 00000000000af668 /vendor/lib64/egl/libGLESv2_POWERVR_ROGUE.so
#08 pc 00000000000b4d90 /vendor/lib64/egl/libGLESv2_POWERVR_ROGUE.so
#09 pc 00000000000b5f58 /vendor/lib64/egl/libGLESv2_POWERVR_ROGUE.so
#10 pc 00000000000cba3c /vendor/lib64/egl/libGLESv2_POWERVR_ROGUE.so
#11 pc 000000000002b78c /vendor/lib64/egl/libGLESv2_POWERVR_ROGUE.so
#12 pc 000000000002b2f0 /vendor/lib64/egl/libGLESv2_POWERVR_ROGUE.so
Renderer : PowerVR Rogue GE8322
OpenGL version : OpenGL ES 3.2 build 1.11@5471373

Best regards,

zyy