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

QML/Qt – SegFault occurs when View3D has dimensions 0×0 and an Effect uses a Buffer with sizeMultiplier ≤ 0.25

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P1: Critical P1: Critical
    • None
    • 6.10.0
    • Quick: 3D
    • None
    • OS: Archlinux
      WM: Hyprland
      RenderingBackend: OpenGL
    • Linux/Wayland

       I am encountering a SegmentationFault when the View3D has a very small size (0 or 1) in my case and you have a Pass inside an Effect that attempts to read from a Buffer that is smaller. In my case when the buffer is 0.25 it crashes, but at 0.5 it does not.

      Could this be related to https://bugreports.qt.io/browse/QTBUG-91871 ?

      Sample code:

      import QtQuick
      import QtQuick3D
      
      Window {
          visible: true
      
          Shader
          {
              id: shd
              stage: Shader.Fragment
              shader: "sample-simple.frag"
          }
      
          Effect 
          {
              id: effect
              
              passes: [
                  Pass 
                  {
                      shaders: shd
                      commands: [ BufferInput { buffer: buf1 } ]
                  }
              ]
              
              Buffer 
              {
                  id: buf1
                  sizeMultiplier: 0.25 // 0.5 works
              }
          }
          
          View3D
          {
              implicitWidth:  0
              implicitHeight: 0
      
              id: view
      
              OrthographicCamera {}
      
              environment: SceneEnvironment
              {
                  effects: [effect]
              }
          }
      }
      

       
      Shader used:

      void MAIN()
      {
          FRAGCOLOR = texture(INPUT, INPUT_UV);
      }
      

       

      output from running this sample with gdb:

      (gdb) run
      Starting program: /home/entity/projects/debug_qml/build/appdebug_qml 
      [Thread debugging using libthread_db enabled]
      Using host libthread_db library "/usr/lib/libthread_db.so.1".
      [New Thread 0x7ffff03ff6c0 (LWP 22425)]
      [New Thread 0x7fffefbfe6c0 (LWP 22426)]
      [New Thread 0x7fffef3fd6c0 (LWP 22427)]
      [New Thread 0x7fffee1b86c0 (LWP 22428)]
      (gdb) [New Thread 0x7fffec9b16c0 (LWP 22430)]
      [New Thread 0x7fffdddff6c0 (LWP 22431)]
      [New Thread 0x7fffdd5fe6c0 (LWP 22432)]
      [Thread 0x7fffdddff6c0 (LWP 22431) exited]
      [Thread 0x7fffdd5fe6c0 (LWP 22432) exited]
      1D textures are not supportedThread 1 "appdebug_qml" received signal SIGSEGV, Segmentation fault.
      0x0000000000000000 in ?? ()
      (gdb) bt full
      #0  0x0000000000000000 in ?? ()
      No symbol table info available.
      #1  0x00007ffff57c2aa2 in QGles2TextureRenderTarget::create (this=0x555555e0b510) at /usr/src/debug/qt6-base/qtbase/src/gui/rhi/qrhi.h:589
              texD = 0x5555557e3e50
              colorAtt = @0x555555e0b560: {m_texture = 0x5555557e3e50, m_renderBuffer = 0x0, m_layer = 0, m_level = 0, m_resolveTexture = 0x0, m_resolveLayer = 0, m_resolveLevel = 0, m_multiViewCount = 1}
              texture = 0x5555557e3e50
              renderBuffer = <optimized out>
              it = 0x555555e0b560
              itEnd = 0x555555e0b590
              rhiD = 0x5555558a3750
              hasColorAttachments = <optimized out>
              hasDepthStencil = false
              attIndex = 0
              multiViewCount = <optimized out>
              status = <optimized out>
      #2  0x00007ffff78d6bf4 in QSSGRhiEffectSystem::getTexture (this=0x555555d56e70, bufferName=..., size=..., format=<optimized out>, isFinalOutput=isFinalOutput@entry=false, inEffect=0x5555557deeb0, viewCount=1 '\001')
          at /usr/src/debug/qt6-quick3d/qtquick3d/src/runtimerender/qssgrhieffectsystem.cpp:127
              colorAttachment = {m_texture = 0x5555557e3e50, m_renderBuffer = 0x0, m_layer = 0, m_level = 0, m_resolveTexture = 0x0, m_resolveLayer = 0, m_resolveLevel = 0, m_multiViewCount = 1}
              desc = {m_colorAttachments = {<QVLABase<QRhiColorAttachment>> = {<QVLABaseBase> = {a = 8, s = 1, ptr = 0x7fffffffa918}, <No data fields>}, <QVLAStorage<48, 8, 8>> = {
                    array = "P>~UUU", '\000' <repeats 34 times>, "\001\000\000\000\000\000\000\000", '\376' <repeats 336 times>}, <No data fields>}, m_depthStencilBuffer = 0x0, m_depthTexture = 0x0, m_depthResolveTexture = 0x0, 
                m_shadingRateMap = 0x0}
              result = 0x555555e0a8e0
              gotMatch = false
              rhiCtx = <optimized out>
              rhi = 0x55555582cb20
              formatChanged = <optimized out>
              needsRebuild = <optimized out>
              flags = <optimized out>
      #3  0x00007ffff78d80f7 in QSSGRhiEffectSystem::allocateBufferCmd (this=this@entry=0x555555d56e70, inCmd=inCmd@entry=0x7fffe40042b0, inTexture=inTexture@entry=0x7fffffffac90, inEffect=inEffect@entry=0x5555557deeb0, 
          viewCount=viewCount@entry=1 '\001') at /usr/src/debug/qt6-quick3d/qtquick3d/src/runtimerender/qssgrhieffectsystem.cpp:320
              bufferSize = {wd = {<QtPrivate::QCheckedIntegers::CheckIntTypeHelper<int>> = {<No data fields>}, m_i = 0}, ht = {<QtPrivate::QCheckedIntegers::CheckIntTypeHelper<int>> = {<No data fields>}, m_i = 0}}
              f = <optimized out>
              rhiFormat = <optimized out>
              buf = <optimized out>
              filter = <optimized out>
              tiling = <optimized out>
      #4  0x00007ffff78db329 in QSSGRhiEffectSystem::doRenderEffect (this=this@entry=0x555555d56e70, inEffect=inEffect@entry=0x5555557deeb0, inTexture=inTexture@entry=0x7fffffffac90, viewCount=viewCount@entry=1 '\001')
          at /usr/src/debug/qt6-quick3d/qtquick3d/src/runtimerender/qssgrhieffectsystem.cpp:234
              theCommand = 0x7fffe40042b0
              c = @0x555555d74f50: {command = 0x7fffe40042b0, own = 0 '\000'}
              __for_range = @0x5555557def00: {<QListSpecialMethods<QSSGRenderEffect::Command>> = {<QListSpecialMethodsBase<QSSGRenderEffect::Command>> = {<No data fields>}, <No data fields>}, d = {d = 0x555555d74f10, 
                  ptr = 0x555555d74f20, size = 6}}
              __for_begin = <optimized out>
              __for_end = <optimized out>
              finalOutputTexture = <optimized out>
              currentOutput = 0x555555d81880
              currentInput = 0x7fffffffac90
      #5  0x00007ffff78dbe3a in QSSGRhiEffectSystem::process (this=0x555555d56e70, layer=..., inTexture=inTexture@entry=0x5555557dfba0, inDepthTexture=<optimized out>, cameraClipRange=...)
          at /usr/src/debug/qt6-quick3d/qtquick3d/src/runtimerender/qssgrhieffectsystem.cpp:184
              rhiContext = <optimized out>
              renderer = <optimized out> 

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

            qt.team.graphics.and.multimedia Qt Graphics Team
            jsentity Timur Vaydogan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes