Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Crash when using a ValueAxis in a ChartView. Why?
Forum Updated to NodeBB v4.3 + New Features

Crash when using a ValueAxis in a ChartView. Why?

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
19 Posts 4 Posters 3.4k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I igor_stravinsky

    @ambershark There's no C++ backing. The code is pure QML, although the graph is showing data from an outside source. I removed that source to see if that were part of the problem, and discovered that even graphic a fixed number of points would generate a crash on quit.

    Interestingly, I added a StackedBarSeries to another section of my app yesterday, and now that is generating a similar crash on quit.

    Thread 0 Crashed:: CrBrowserMain  Dispatch queue: com.apple.main-thread
    0   org.qt-project.QtQml          	0x0000000115f7815b QQmlContextData::ContextGuard::objectDestroyed(QObject*) + 43
    1   org.qt-project.QtQml          	0x0000000115f5b209 QQmlData::destroyed(QObject*) + 441
    2   org.qt-project.QtCore         	0x000000011649bbbf QObject::~QObject() + 319
    3   libqtchartsqml2.dylib         	0x0000000127caa468 QQmlPrivate::QQmlElement<QtCharts::DeclarativeStackedBarSeries>::~QQmlElement() + 56
    4   org.qt-project.QtQml          	0x0000000115da7cc8 QV4::MemoryManager::sweep(bool, void (*)(char const*)) + 296
    5   org.qt-project.QtQml          	0x0000000115da8c69 QV4::MemoryManager::~MemoryManager() + 57
    6   org.qt-project.QtQml          	0x0000000115e7f5f7 QV4::ExecutionEngine::~ExecutionEngine() + 87
    7   org.qt-project.QtQml          	0x0000000116000560 QV8Engine::~QV8Engine() + 176
    8   org.qt-project.QtQml          	0x000000011600066e QV8Engine::~QV8Engine() + 14
    9   org.qt-project.QtQml          	0x0000000115e2b3ff QJSEngine::~QJSEngine() + 79
    10  org.qt-project.QtQml          	0x0000000115f5c582 QQmlEngine::~QQmlEngine() + 370
    11  com.onsemi.usb-pd             	0x000000010fc158ac main + 2828 (main.cpp:118)
    12  libdyld.dylib                 	0x00007fff6383b015 start + 1
    

    Could the problem be an issue at a higher level involving QtCharts in general? I'm using QtQuick 2.10 and QtCharts 2.2

    A Offline
    A Offline
    ambershark
    wrote on last edited by ambershark
    #7

    @igor_stravinsky This is starting to sound like it's a mixing Qt versions problem. It sounds like it's using a mix of versions 5.8/5.10/etc. I would find out which version of Qt it is loading when run versus what you expect it to be running. If the version is correct make sure all the (so/dlls) are for the same version of Qt. On linux you can use ldd on windows dependency walker.

    It's also possible you have a corrupt Qt library, albeit unlikely. If you have another system to test on that would help too. It works for me, and seems to work for @6thC so it's more than likely something with your Qt install.

    Again if you can share a simple full .qml file that can reproduce the issue I can test locally for your exact code. Always nice to share a snippet that can reproduce the problem. It could be a bug in Qt, but it's not sounding like it. My money is on bad Qt mixes on your system.

    My L-GPL'd C++ Logger github.com/ambershark-mike/sharklog

    1 Reply Last reply
    0
    • I igor_stravinsky

      @ambershark There's no C++ backing. The code is pure QML, although the graph is showing data from an outside source. I removed that source to see if that were part of the problem, and discovered that even graphic a fixed number of points would generate a crash on quit.

      Interestingly, I added a StackedBarSeries to another section of my app yesterday, and now that is generating a similar crash on quit.

      Thread 0 Crashed:: CrBrowserMain  Dispatch queue: com.apple.main-thread
      0   org.qt-project.QtQml          	0x0000000115f7815b QQmlContextData::ContextGuard::objectDestroyed(QObject*) + 43
      1   org.qt-project.QtQml          	0x0000000115f5b209 QQmlData::destroyed(QObject*) + 441
      2   org.qt-project.QtCore         	0x000000011649bbbf QObject::~QObject() + 319
      3   libqtchartsqml2.dylib         	0x0000000127caa468 QQmlPrivate::QQmlElement<QtCharts::DeclarativeStackedBarSeries>::~QQmlElement() + 56
      4   org.qt-project.QtQml          	0x0000000115da7cc8 QV4::MemoryManager::sweep(bool, void (*)(char const*)) + 296
      5   org.qt-project.QtQml          	0x0000000115da8c69 QV4::MemoryManager::~MemoryManager() + 57
      6   org.qt-project.QtQml          	0x0000000115e7f5f7 QV4::ExecutionEngine::~ExecutionEngine() + 87
      7   org.qt-project.QtQml          	0x0000000116000560 QV8Engine::~QV8Engine() + 176
      8   org.qt-project.QtQml          	0x000000011600066e QV8Engine::~QV8Engine() + 14
      9   org.qt-project.QtQml          	0x0000000115e2b3ff QJSEngine::~QJSEngine() + 79
      10  org.qt-project.QtQml          	0x0000000115f5c582 QQmlEngine::~QQmlEngine() + 370
      11  com.onsemi.usb-pd             	0x000000010fc158ac main + 2828 (main.cpp:118)
      12  libdyld.dylib                 	0x00007fff6383b015 start + 1
      

      Could the problem be an issue at a higher level involving QtCharts in general? I'm using QtQuick 2.10 and QtCharts 2.2

      6thC6 Offline
      6thC6 Offline
      6thC
      wrote on last edited by
      #8

      @igor_stravinsky said in Crash when using a ValueAxis in a ChartView. Why?:

      com.apple.main-thread

      Perhaps the environment / charts too?

      Is this iOS? I'm using charts under MinGW || GCC
      Qt 5.10 and 5.10.1
      under linux, linux VM, win10
      Perhaps this is something for the mailing list or yes, a corrupt library?

      Did that basic example / exact qml code I sent you work?
      Cause that had button, a popup containing the chartview w/x&y axis + attached lineseries ready to go.

      1 Reply Last reply
      0
      • I Offline
        I Offline
        igor_stravinsky
        wrote on last edited by
        #9

        @ambershark Mixed versions is a thought I had as well. I just did an update to 5.11, and am testing that out. I'll try to get a simple example that crashes for me posted shortly.

        @6thC I just installed 5.11, and updated headers, so hopefully the project is now current. I'm compiling on MacOS, and the example you posted worked without a problem for me.

        The first crash comes when a ChartView is in a Popup, and the second happens when a ChartView is in a ToolTip, and the crash only happens when the app is quitting, so I'm wondering if the fact that the chart isn't part of a standard qml page (i.e. it's only shown sometimes) has to do with the crash on in the destructor. When I show a chart on a page not on a Popup or ToolTip, it works without a problem.

        1 Reply Last reply
        0
        • 6thC6 Offline
          6thC6 Offline
          6thC
          wrote on last edited by
          #10

          Are you on a commercial license. That sounds the sort of thing I'd touch base for confirming / getting a bug raised. I think you can directly, I just have a commercial so use the support first, they confirm or deny and even raise bugs for me. It's very much appreciated for a small project (sole developer) as myself.

          I'm sorry I have no mac / ios equipment / dev env here to reproduce for you. I think this has narrowed the situation down (potentially) to limited to this system or your specific environment. Hopefully another qt dev using IOS can help? If you have a standalone project with working and broken examples I'd suggest that always helps.

          We're lazy (try to be efficient) and time limited so if you already have something others can just hit F5 and confirm or deny expectations and behavior - it'd only be appreciated.

          I 1 Reply Last reply
          0
          • 6thC6 6thC

            Are you on a commercial license. That sounds the sort of thing I'd touch base for confirming / getting a bug raised. I think you can directly, I just have a commercial so use the support first, they confirm or deny and even raise bugs for me. It's very much appreciated for a small project (sole developer) as myself.

            I'm sorry I have no mac / ios equipment / dev env here to reproduce for you. I think this has narrowed the situation down (potentially) to limited to this system or your specific environment. Hopefully another qt dev using IOS can help? If you have a standalone project with working and broken examples I'd suggest that always helps.

            We're lazy (try to be efficient) and time limited so if you already have something others can just hit F5 and confirm or deny expectations and behavior - it'd only be appreciated.

            I Offline
            I Offline
            igor_stravinsky
            wrote on last edited by
            #11

            @6thC Sadly, I'm working under a free, not commercial license. No support for me...

            I have replicated one of my bugs. I'll post that code.

            I 1 Reply Last reply
            0
            • I igor_stravinsky

              @6thC Sadly, I'm working under a free, not commercial license. No support for me...

              I have replicated one of my bugs. I'll post that code.

              I Offline
              I Offline
              igor_stravinsky
              wrote on last edited by
              #12

              Here's a simple example of a chart causing a crash on quit. In this case the chart is inside of a ToolTip

              main.qml:

              import QtQuick 2.11
              import QtQuick.Window 2.11
              import QtQuick.Controls 1.4
              
              Window {
                  visible: true
                  width: 1200
                  height: 800
                  title: qsTr("Hello World")
              
                  Button{
                      id:testButton
                      text:"test"
                      anchors.centerIn:parent
                      height:parent.height/8
                      width:parent.width/8
              
                      CustomToolTip{
                          visible: testButton.hovered
                      }
                  }
              }
              

              CustomToolTip:

              import QtQuick 2.11
              import QtQuick.Layouts 1.3
              import QtQuick.Controls 2.4
              import QtCharts 2.2
              
              ToolTip{
                  delay: 0
              
                  Rectangle{
                      id:tooltipBackgound
                      width:400
                      height:300
                      radius:10
                      border.color:"black"
              
                      ChartView {
                          title: "Memory"
                          antialiasing: true
              
                          PieSeries {
                                  id: pieSeries
                                  PieSlice { label: "eaten"; value: 94.9 }
                                  PieSlice { label: "not yet eaten"; value: 5.1 }
                              }
                      }
                  }   //background rectangle
              }
              

              I don't think the crash actually requires a series of any sort. Simply having a chart view in the tool tip seem to be sufficient.

              Crash stack trace:

              Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
              0   org.qt-project.QtQml          	0x0000000106033ccb QQmlContextData::ContextGuard::objectDestroyed(QObject*) + 43
              1   org.qt-project.QtQml          	0x00000001060161c9 QQmlData::destroyed(QObject*) + 489
              2   org.qt-project.QtCore         	0x000000010656924f QObject::~QObject() + 319
              3   libqtchartsqml2.dylib         	0x000000010d010b48 QQmlPrivate::QQmlElement<QtCharts::DeclarativePieSeries>::~QQmlElement() + 56
              4   org.qt-project.QtQml          	0x0000000105ea8bf8 QV4::MemoryManager::sweep(bool, void (*)(char const*)) + 296
              5   org.qt-project.QtQml          	0x0000000105ea9b62 QV4::MemoryManager::~MemoryManager() + 66
              6   org.qt-project.QtQml          	0x0000000105f2eb57 QV4::ExecutionEngine::~ExecutionEngine() + 87
              7   org.qt-project.QtQml          	0x0000000105f25057 QJSEngine::~QJSEngine() + 103
              8   org.qt-project.QtQml          	0x0000000106017572 QQmlEngine::~QQmlEngine() + 370
              9   com.onsemi.ToolTipCrashTest   	0x0000000105ab5033 main + 339 (main.cpp:17)
              10  libdyld.dylib                 	0x00007fff6383b015 start + 1
              
              
              1 Reply Last reply
              0
              • I Offline
                I Offline
                igor_stravinsky
                wrote on last edited by
                #13

                Here's a simple example of a chart in a popup which causes a crash on quit on my system (MacOS, running Qt 5.11)

                main.qml

                import QtQuick 2.11
                import QtQuick.Window 2.11
                import QtQuick.Controls 1.4
                
                Window {
                    id:mainWindow
                    visible: true
                    width: 1200
                    height: 800
                    title: qsTr("Hello World")
                
                    Button{
                        id:testButton
                        text:"test"
                        anchors.centerIn:parent
                        height:parent.height/8
                        width:parent.width/8
                
                        onClicked: { customGraph.open() }
                    }
                
                    CustomPopup{
                        id:customGraph
                        width: mainWindow.width/2
                        height: mainWindow.height/2
                        leftMargin: mainWindow.width/4
                        topMargin: mainWindow.height/4
                    }
                }
                
                

                CustomPopup.qml:

                import QtQuick 2.11
                import QtQuick.Controls 2.4
                import QtCharts 2.2
                
                Popup {
                    id: customPopup
                
                    modal: true
                    focus: false
                    dim: true
                
                    ChartView {
                        id: chartView
                        title: "Custom Chart"
                        height: parent.height
                        antialiasing: true
                        theme: ChartView.ChartThemeDark
                
                        ValueAxis {
                            id: valueAxisX
                        }
                
                        ValueAxis{
                            id: valueAxisY
                        }
                
                        LineSeries {
                            id: powerSeries
                            axisX: valueAxisX
                            axisY: valueAxisY
                            name: "Series"
                        }
                
                    }   //chartView
                
                }
                

                And the stack trace from the crash:

                Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
                0   org.qt-project.QtQml          	0x0000000104be9ccb QQmlContextData::ContextGuard::objectDestroyed(QObject*) + 43
                1   org.qt-project.QtQml          	0x0000000104bcc1c9 QQmlData::destroyed(QObject*) + 489
                2   org.qt-project.QtCore         	0x000000010512324f QObject::~QObject() + 319
                3   libqtchartsqml2.dylib         	0x000000010bae06f0 QQmlPrivate::QQmlElement<QtCharts::QValueAxis>::~QQmlElement() + 32
                4   org.qt-project.QtQml          	0x0000000104a5ebf8 QV4::MemoryManager::sweep(bool, void (*)(char const*)) + 296
                5   org.qt-project.QtQml          	0x0000000104a5fb62 QV4::MemoryManager::~MemoryManager() + 66
                6   org.qt-project.QtQml          	0x0000000104ae4b57 QV4::ExecutionEngine::~ExecutionEngine() + 87
                7   org.qt-project.QtQml          	0x0000000104adb057 QJSEngine::~QJSEngine() + 103
                8   org.qt-project.QtQml          	0x0000000104bcd572 QQmlEngine::~QQmlEngine() + 370
                9   com.onsemi.ToolTipCrashTest   	0x000000010466aca3 main + 339 (main.cpp:17)
                10  libdyld.dylib                 	0x00007fff6383b015 start + 1
                

                Any idea why this is happening?

                A 1 Reply Last reply
                0
                • I igor_stravinsky

                  Here's a simple example of a chart in a popup which causes a crash on quit on my system (MacOS, running Qt 5.11)

                  main.qml

                  import QtQuick 2.11
                  import QtQuick.Window 2.11
                  import QtQuick.Controls 1.4
                  
                  Window {
                      id:mainWindow
                      visible: true
                      width: 1200
                      height: 800
                      title: qsTr("Hello World")
                  
                      Button{
                          id:testButton
                          text:"test"
                          anchors.centerIn:parent
                          height:parent.height/8
                          width:parent.width/8
                  
                          onClicked: { customGraph.open() }
                      }
                  
                      CustomPopup{
                          id:customGraph
                          width: mainWindow.width/2
                          height: mainWindow.height/2
                          leftMargin: mainWindow.width/4
                          topMargin: mainWindow.height/4
                      }
                  }
                  
                  

                  CustomPopup.qml:

                  import QtQuick 2.11
                  import QtQuick.Controls 2.4
                  import QtCharts 2.2
                  
                  Popup {
                      id: customPopup
                  
                      modal: true
                      focus: false
                      dim: true
                  
                      ChartView {
                          id: chartView
                          title: "Custom Chart"
                          height: parent.height
                          antialiasing: true
                          theme: ChartView.ChartThemeDark
                  
                          ValueAxis {
                              id: valueAxisX
                          }
                  
                          ValueAxis{
                              id: valueAxisY
                          }
                  
                          LineSeries {
                              id: powerSeries
                              axisX: valueAxisX
                              axisY: valueAxisY
                              name: "Series"
                          }
                  
                      }   //chartView
                  
                  }
                  

                  And the stack trace from the crash:

                  Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
                  0   org.qt-project.QtQml          	0x0000000104be9ccb QQmlContextData::ContextGuard::objectDestroyed(QObject*) + 43
                  1   org.qt-project.QtQml          	0x0000000104bcc1c9 QQmlData::destroyed(QObject*) + 489
                  2   org.qt-project.QtCore         	0x000000010512324f QObject::~QObject() + 319
                  3   libqtchartsqml2.dylib         	0x000000010bae06f0 QQmlPrivate::QQmlElement<QtCharts::QValueAxis>::~QQmlElement() + 32
                  4   org.qt-project.QtQml          	0x0000000104a5ebf8 QV4::MemoryManager::sweep(bool, void (*)(char const*)) + 296
                  5   org.qt-project.QtQml          	0x0000000104a5fb62 QV4::MemoryManager::~MemoryManager() + 66
                  6   org.qt-project.QtQml          	0x0000000104ae4b57 QV4::ExecutionEngine::~ExecutionEngine() + 87
                  7   org.qt-project.QtQml          	0x0000000104adb057 QJSEngine::~QJSEngine() + 103
                  8   org.qt-project.QtQml          	0x0000000104bcd572 QQmlEngine::~QQmlEngine() + 370
                  9   com.onsemi.ToolTipCrashTest   	0x000000010466aca3 main + 339 (main.cpp:17)
                  10  libdyld.dylib                 	0x00007fff6383b015 start + 1
                  

                  Any idea why this is happening?

                  A Offline
                  A Offline
                  ambershark
                  wrote on last edited by
                  #14

                  @igor_stravinsky I will try to get some time to update to 5.11 on my mac and test for you to see if it happens on my system too.

                  In this case though it really is looking more and more like a bug in Qt. I would try reporting it with that code that makes it reproducible.

                  If you link the bug report here I will try to upvote it if I can reproduce it when I get time/updates to my mac.

                  Sadly, I'm working under a free, not commercial license.

                  Since you are using Qt Charts, just be careful with licensing. Qt Charts is only available under commerical and GPL licenses. You can't make a closed source (LGPL) product with Qt Charts unless you have a commercial license. Just wanted to warn you in case you weren't aware so you didn't end up in trouble later. :)

                  My L-GPL'd C++ Logger github.com/ambershark-mike/sharklog

                  I 1 Reply Last reply
                  0
                  • A ambershark

                    @igor_stravinsky I will try to get some time to update to 5.11 on my mac and test for you to see if it happens on my system too.

                    In this case though it really is looking more and more like a bug in Qt. I would try reporting it with that code that makes it reproducible.

                    If you link the bug report here I will try to upvote it if I can reproduce it when I get time/updates to my mac.

                    Sadly, I'm working under a free, not commercial license.

                    Since you are using Qt Charts, just be careful with licensing. Qt Charts is only available under commerical and GPL licenses. You can't make a closed source (LGPL) product with Qt Charts unless you have a commercial license. Just wanted to warn you in case you weren't aware so you didn't end up in trouble later. :)

                    I Offline
                    I Offline
                    igor_stravinsky
                    wrote on last edited by igor_stravinsky
                    #15

                    @ambershark Thanks for the reminder about QtCharts being under GPL. I've noted that, and alerted the powers that be above me. I'm not sure if they realize the ramifications right now, but they will...

                    And I don't think this issue requires an update to 5.11. I was having the problem under 5.10, but upgraded to test if this was still an issue under the new version.

                    A 1 Reply Last reply
                    0
                    • 6thC6 Offline
                      6thC6 Offline
                      6thC
                      wrote on last edited by
                      #16

                      I'd encourage your "higher ups" that commercial is affordable and very worth it.

                      1 Reply Last reply
                      0
                      • I igor_stravinsky

                        @ambershark Thanks for the reminder about QtCharts being under GPL. I've noted that, and alerted the powers that be above me. I'm not sure if they realize the ramifications right now, but they will...

                        And I don't think this issue requires an update to 5.11. I was having the problem under 5.10, but upgraded to test if this was still an issue under the new version.

                        A Offline
                        A Offline
                        ambershark
                        wrote on last edited by
                        #17

                        @igor_stravinsky said in Crash when using a ValueAxis in a ChartView. Why?:

                        And I don't think this issue requires an update to 5.11

                        My mac is on like 5.2 though, so I'd definitely update it before messing around. I haven't written any commercial software for the mac in a while so I haven't updated it recently. I've been busy the last week and haven't had time to even answer questions on the forums much less delve into problems like this. So I never got around to testing it.

                        Did you ever file a bug?

                        My L-GPL'd C++ Logger github.com/ambershark-mike/sharklog

                        I 1 Reply Last reply
                        0
                        • A ambershark

                          @igor_stravinsky said in Crash when using a ValueAxis in a ChartView. Why?:

                          And I don't think this issue requires an update to 5.11

                          My mac is on like 5.2 though, so I'd definitely update it before messing around. I haven't written any commercial software for the mac in a while so I haven't updated it recently. I've been busy the last week and haven't had time to even answer questions on the forums much less delve into problems like this. So I never got around to testing it.

                          Did you ever file a bug?

                          I Offline
                          I Offline
                          igor_stravinsky
                          wrote on last edited by
                          #18

                          @ambershark QTBUG-68483 has been filed.

                          1 Reply Last reply
                          2
                          • terma.abaT Offline
                            terma.abaT Offline
                            terma.aba
                            wrote on last edited by
                            #19

                            I get the same thing: Qt 5.12.0, my ChartView with ValueAxis is in a Page in a StackView, crashes on exit.
                            Noticeable is that if I unwind the StackView before exiting, the application doesn't crash.

                            1 Reply Last reply
                            0

                            • Login

                            • Login or register to search.
                            • First post
                              Last post
                            0
                            • Categories
                            • Recent
                            • Tags
                            • Popular
                            • Users
                            • Groups
                            • Search
                            • Get Qt Extensions
                            • Unsolved