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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Not Evaluated
    • Resolution: Done
    • Affects Version/s: 5.3.0 Alpha
    • Fix Version/s: 5.3.0 Beta1
    • Component/s: Quick: SceneGraph
    • Labels:
    • Environment:
      Windows 8.1 Runtime
      Windows Phone 8
    • Platform/s:
      WinRT
    • Commits:
      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

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            andrew.knight Andrew Knight
            Reporter:
            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