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

Canvas2D: crash in QV4

    XMLWordPrintable

Details

    • eea43b5cc5aa6fab0d7523f92a83a5f75849782d

    Description

      qtquickcontrols2/tst_snippets started crashing consistently in the 5.9 branch. Here's a stripped down test case without controls:

      import QtQuick 2.7
      import QtQuick.Window 2.2
      
      Window {
          id: window
          width: 360
          height: 360
          visible: true
      
          Canvas {
              id: canvas
              anchors.fill: parent
      
              onPaint: {
                  var ctx = getContext("2d")
                  ctx.clearRect(0, 0, width, height)
                  ctx.strokeStyle = "blue"
                  ctx.lineWidth = 10
                  ctx.beginPath()
                  ctx.arc(width / 2, height / 2, width / 2 - ctx.lineWidth / 2, 0, Math.PI * 2) // <==
                  ctx.stroke()
              }
          }
      }
      

      The backtrace looks like:

      #0  0x00007ffff71ccc83 in QV4::Value::isString() const (this=0x7fffcb000388)
          at /home/jpnurmi/Projects/qt-59/qtbase/include/QtQml/5.9.0/QtQml/private/../../../../../../qtdeclarative/src/qml/jsruntime/qv4value_p.h:492
      #1  0x00007ffff71ccc83 in QV4::Value::stringValue() const (this=0x7fffcb000388)
          at /home/jpnurmi/Projects/qt-59/qtbase/include/QtQml/5.9.0/QtQml/private/../../../../../../qtdeclarative/src/qml/jsruntime/qv4value_p.h:377
      #2  0x00007ffff71ccc83 in QV4::Value::toNumberImpl() const (this=0x7fffcb000388) at jsruntime/qv4value.cpp:117
      #3  0x00007ffff71c6c3e in QV4::Value::toNumber() const (this=<optimized out>)
          at /home/jpnurmi/Projects/qt-59/qtbase/include/QtQml/5.9.0/QtQml/private/../../../../../../qtdeclarative/src/qml/jsruntime/qv4value_p.h:511
      #4  0x00007ffff71c6c3e in QV4::Runtime::method_toDouble(QV4::Value const&) (value=...) at jsruntime/qv4runtime.cpp:1376
      #5  0x00007ffff69e7c08 in  ()
      #6  0x0000000000c092c0 in  ()
      #7  0x0000000000000000 in  ()
      

      The problem has appeared between the initial 5.9 branching (cd39a62bbd5c6e725547a696c297c46f929b3439) and when the soft branching was finished ie. dev was merged to 5.9 (6ba26317d0fc0573aca7638eda8bdb91e52d1ab3).

      Attachments

        Issue Links

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

          Activity

            People

              laknoll Lars Knoll
              jpnurmi J-P Nurmi
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes