Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-37290

SG renderer accesses null pointer when shader can't be linked

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Not Evaluated
    • 5.3.0 Beta1
    • 5.3.0 Alpha
    • Quick: SceneGraph
    • Windows 8.1 Runtime
      Windows Phone 8
    • WinRT
    • 3aa6a8b90f9c0e5f0ad72c462a15157b4e419ae6

    Description

      See Renderer::renderMergedBatch() + about 50 lines:

      ShaderManager::Shader *sms = m_useDepthBuffer ? m_shaderManager->prepareMaterial(material) : m_shaderManager->prepareMaterialNoRewrite(material);
      QSGMaterialShader *program = sms->program;
      

      The sms variable can be a null pointer here. Avoiding the null pointer access and printing an error message would be helpful.

      This might happen on other platforms where the material doesn't link, but the bug is opened because it can happen quite commonly on WinRT if the D3D compiler is left out of the package or the compiler service isn't running.

      It's worth noting that there are already debug messages printed by QOpenGLShader and d3dcompiler_qt saying that something went wrong. However, it might be worth going the extra mile and avoiding the crash. Or, qFatal could be used so that a message box could be shown in release builds instead of simply crashing the application.

      Attachments

        For Gerrit Dashboard: QTBUG-37290
        # Subject Branch Project Status CR V

        Activity

          People

            andrew.knight Andrew Knight
            andrew.knight Andrew Knight
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes