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

ToolBar switch crashes in QQmlJavaScriptExpression::hasError()

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 5.6.0 RC
    • 5.6.0 Beta
    • Quick: Controls 2
    • None
    • Mageia Linux Cauldron x86_64, gcc 5.3.1
    • 14b41264a1c3770e98d2ff075ba8bbe6cda2f841

    Description

      Test program use StackView and use toolbar from the topmost item in stack, if the item has toolbar (or default toolbar otherwise). When I click on toolbar button, that cause current item (which contains this toolbar) to be removed from the stack, program crashes.

      To reproduce, click on "Push" button and then on "back" toolbar button.

      Test program:

      import QtQuick 2.5
      import QtQuick.Layouts 1.3
      import Qt.labs.controls 1.0
      
      ApplicationWindow {
          visible: true
          width: 640
          height: 480
      
          header: stackView.currentItem.toolBar ? stackView.currentItem.toolBar : mainToolBar
      
          Connections {
              target: header
              ignoreUnknownSignals: true
              onBack: stackView.pop()
          }
      
          ToolBar {
              id: mainToolBar
      
              RowLayout {
                  Label {
                      text: "main"
                  }
              }
          }
      
          Item {
              id: firstItem
      
              Text {
                  anchors.centerIn: parent
                  text: "The first item"
              }
          }
      
          Item {
              id: topItem
      
              property ToolBar toolBar: ToolBar {
                  id: topItemToolBar
      
                  signal back()
      
                  RowLayout {
                      ToolButton {
                          text: "back"
                          onClicked: topItemToolBar.back()
                      }
                  }
              }
      
              visible: false
      
              Text {
                  anchors.centerIn: parent
                  text: "The top item"
              }
          }
      
          ColumnLayout {
              anchors.fill: parent
              spacing: 10
      
              StackView {
                  id: stackView
      
                  Layout.fillHeight: true
                  Layout.fillWidth: true
                  initialItem: firstItem
              }
      
              Row {
                  Layout.alignment: Qt.AlignHCenter
      
                  Button {
                      text: "Push"
                      onClicked: stackView.push(topItem)
                  }
              }
          }
      }
      

      Stack trace:

      1	QQmlJavaScriptExpression::hasError	qqmljavascriptexpression_p.h	232	0x7ffff6dd5c58	
      2	QQmlBoundSignal_callback	qqmlboundsignal.cpp	333	0x7ffff6deb866	
      3	QQmlNotifier::emitNotify	qqmlnotifier.cpp	94	0x7ffff6e370c5	
      4	QQmlData::signalEmitted	qqmlengine.cpp	772	0x7ffff6dc20d1	
      5	QMetaObject::activate	qobject.cpp	3616	0x7ffff67c8080	
      6	QQmlVMEMetaObject::activate	qqmlvmemetaobject.cpp	1195	0x7ffff6dbe7b2	
      7	QQmlVMEMetaObject::metaCall	qqmlvmemetaobject.cpp	818	0x7ffff6dbcc8b	
      8	QMetaObject::metacall	qmetaobject.cpp	293	0x7ffff6790b63	
      9	QQmlObjectOrGadget::metacall	qqmlpropertycache.cpp	1557	0x7ffff6e31040	
      10	CallMethod	qv4qobjectwrapper.cpp	1140	0x7ffff6d8169f	
      11	CallPrecise	qv4qobjectwrapper.cpp	1375	0x7ffff6d820e2	
      12	QV4::QObjectMethod::callInternal	qv4qobjectwrapper.cpp	1853	0x7ffff6d84854	
      13	QV4::QObjectMethod::call	qv4qobjectwrapper.cpp	1792	0x7ffff6d842f1	
      14	QV4::Object::call	qv4object_p.h	324	0x7ffff6c5a5c8	
      15	QV4::Runtime::callProperty	qv4runtime.cpp	999	0x7ffff6da400d	
      16	QV4::Moth::VME::run	qv4vme_moth.cpp	579	0x7ffff6d8d64b	
      17	QV4::Moth::VME::exec	qv4vme_moth.cpp	968	0x7ffff6d91335	
      18	QV4::ScriptFunction::call	qv4functionobject.cpp	466	0x7ffff6d1a669	
      19	QV4::Object::call	qv4object_p.h	324	0x7ffff6c5a5c8	
      20	QQmlJavaScriptExpression::evaluate	qqmljavascriptexpression.cpp	189	0x7ffff6e58714	
      21	QQmlBoundSignalExpression::evaluate	qqmlboundsignal.cpp	237	0x7ffff6deb3f0	
      22	QQmlBoundSignal_callback	qqmlboundsignal.cpp	332	0x7ffff6deb839	
      23	QQmlNotifier::emitNotify	qqmlnotifier.cpp	94	0x7ffff6e370c5	
      24	QQmlData::signalEmitted	qqmlengine.cpp	772	0x7ffff6dc20d1	
      25	QMetaObject::activate	qobject.cpp	3616	0x7ffff67c8080	
      26	QMetaObject::activate	qobject.cpp	3595	0x7ffff67c7e7e	
      27	QQuickAbstractButton::clicked	moc_qquickabstractbutton_p.cpp	388	0x7fffd168e9fd	
      28	QQuickAbstractButton::mouseReleaseEvent	qquickabstractbutton.cpp	525	0x7fffd1650528	
      29	QQuickItem::event	qquickitem.cpp	7475	0x7ffff7a53b93	
      30	QCoreApplicationPrivate::notify_helper	qcoreapplication.cpp	1147	0x7ffff6787e26	
      31	doNotify	qcoreapplication.cpp	1088	0x7ffff6787aa9	
      32	QCoreApplication::notify	qcoreapplication.cpp	1074	0x7ffff6787a1c	
      33	QGuiApplication::notify	qguiapplication.cpp	1582	0x7ffff71f76d6	
      34	QCoreApplication::notifyInternal2	qcoreapplication.cpp	1013	0x7ffff67879ac	
      35	QCoreApplication::sendEvent	qcoreapplication.h	227	0x7ffff7a58388	
      36	QQuickWindow::sendEvent	qquickwindow.cpp	2612	0x7ffff7a72310	
      37	QQuickWindowPrivate::deliverMouseEvent	qquickwindow.cpp	1527	0x7ffff7a6bc46	
      38	QQuickWindow::mouseReleaseEvent	qquickwindow.cpp	1567	0x7ffff7a6c095	
      39	QWindow::event	qwindow.cpp	2008	0x7ffff7208aa8	
      40	QQuickWindow::event	qquickwindow.cpp	1429	0x7ffff7a6b46e	
      41	QCoreApplicationPrivate::notify_helper	qcoreapplication.cpp	1147	0x7ffff6787e26	
      42	doNotify	qcoreapplication.cpp	1088	0x7ffff6787aa9	
      43	QCoreApplication::notify	qcoreapplication.cpp	1074	0x7ffff6787a1c	
      44	QGuiApplication::notify	qguiapplication.cpp	1582	0x7ffff71f76d6	
      45	QCoreApplication::notifyInternal2	qcoreapplication.cpp	1013	0x7ffff67879ac	
      46	QCoreApplication::sendSpontaneousEvent	qcoreapplication.h	230	0x7ffff71ff2fa	
      47	QGuiApplicationPrivate::processMouseEvent	qguiapplication.cpp	1843	0x7ffff71f8391	
      48	QGuiApplicationPrivate::processWindowSystemEvent	qguiapplication.cpp	1627	0x7ffff71f7856	
      49	QWindowSystemInterface::sendWindowSystemEvents	qwindowsysteminterface.cpp	636	0x7ffff71dbc32	
      50	userEventSourceDispatch	qeventdispatcher_glib.cpp	70	0x7fffe7a030c2	
      51	g_main_context_dispatch			0x7ffff39d3267	
      52	g_main_context_iterate.isra			0x7ffff39d3498	
      53	g_main_context_iteration			0x7ffff39d353c	
      54	QEventDispatcherGlib::processEvents	qeventdispatcher_glib.cpp	417	0x7ffff68010e9	
      55	QPAEventDispatcherGlib::processEvents	qeventdispatcher_glib.cpp	115	0x7fffe7a032f2	
      56	QEventLoop::processEvents	qeventloop.cpp	128	0x7ffff678429a	
      57	QEventLoop::exec	qeventloop.cpp	204	0x7ffff6784596	
      58	QCoreApplication::exec	qcoreapplication.cpp	1283	0x7ffff67880f6	
      59	QGuiApplication::exec	qguiapplication.cpp	1573	0x7ffff71f7686	
      60	main	main.cpp	11	0x400f05	
      

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            krnekit Nikita Krupenko
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes