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. ComboBox on a page in a StackView causes an assert failure in AddConnection
QtWS25 Last Chance

ComboBox on a page in a StackView causes an assert failure in AddConnection

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
qmlcomboboxstackviewassertqt 5.9.1
2 Posts 1 Posters 674 Views
  • 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.
  • B Offline
    B Offline
    Brian K.
    wrote on 17 Jul 2019, 13:12 last edited by
    #1

    I've been having an issue where using a ComboBox (Controls 2) in an item rendered on a StackView is causing switching to new views on that StackView to throw an assertion error in QObjectPrivate::addConnection. I'm running Qt 5.9.1 on Windows 10 amd64 using the MinGW 5.9.1 32bit compiler. I'm using Qt Creator 4.9.2 as my IDE.

    I've recreated the problem in the Qt Quick Application - Stack project template by adding a ComboBox to the Page1Form.ui.qml.

    import QtQuick 2.9
    import QtQuick.Controls 2.2
    
    Page {
        width: 600
        height: 400
    
        title: qsTr("Page 1")
    
        Label {
            text: qsTr("You are on Page 1.")
            anchors.centerIn: parent
        }
    
        ComboBox {
            id: comboBox
            model: ["123", "456", "1435", "5347", "56798", "5789", "7-0", "87509", "3564", "543", "3425", "64532", "763", "8746",
             "75364", "847", "085", "456", "4678", "7864", "542", "736", "478", "354", "4321", "6425", "735", "53678", "54678", "5879",
             "4536", "451", "736", "847", "5497", "245", "375", "9785", "069", "8567", "6524", "5243", "4256", "34576", "2346",
             "2546", "54687", "7689", "5679", "9865", "56789", "9867", "45679", "2346", "73", "5678", "5", "27", "46785", "874"]
            x: 28
            y: 37
        }
    }
    
    

    I get the error when I scroll through the drop down list on the combo box and choose something and then go to switch pages on the StackView. It doesn't happen all of the time, but it happens most of the time.

    It's worth noting that I can get this error to show up much more reliably when I 'm running with the QT Debugger attached. I think this is because there is some kind of race condition at the root cause of this issue.

    The program dies at the assert on kernel\qobject.cpp:385

        Q_ASSERT(c->sender == q_ptr);
    

    At this point the this pointer is 0x16c, which is obviously causing a segmentation fault. Other times I've seen the data being compared in the assertion be 0xfeeefeee, so it was obviously memory that had been cleared by HeapFree.

    The stack trace shows that this problem is ultimately caused from a notify from a QEvent::MetaCall event. This leads to a QQmlEngineDebugServiceImpl::processMessage call, followed by 11 frames of QQmlEngineDebugServiceImpl::buildObjectList, eventually leading to the addConnection call for the corrupted memory address. At this point, I've reached the limit of my diagnostic skills. Could anyone give me any clues as to what I'm doing wrong or some other data I could try to look up to debug this issue?

    Attached is a backtrace of the offending UI thread, but the site is popping up a permissions error when I try to upload it so I don't know if it will actually be available to anyone.
    [0_1563368797747_Backtrace.txt](Uploading 100%)

    Thank you for taking the time to look at this.

    1 Reply Last reply
    0
    • B Offline
      B Offline
      Brian K.
      wrote on 17 Jul 2019, 15:35 last edited by
      #2

      Update: I downloaded the most recent version of Qt, 5.13.0, and I could not get the issue to repeat. So I think the problem is related to specific versions of Qt.

      1 Reply Last reply
      0

      2/2

      17 Jul 2019, 15:35

      • Login

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