Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QPersistentModelIndex coring on destruction
Qt 6.11 is out! See what's new in the release blog

QPersistentModelIndex coring on destruction

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 357 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.
  • P Offline
    P Offline
    psigil
    wrote on last edited by
    #1

    Hi,

    I am using qt 4.8 c++ and I am running into an interesting issue. I am working on some code I inherited and occasionally my process will crash when destroying a view. It looks like it is getting a sigserv when trying delete a QModelIndex. Is there a way to protect against double freeing a QModelIndex? I am new to Qt so my apologies if my question does not make sense.

    Program terminated with signal SIGSEGV, Segmentation fault.
    #0 0x00007f4551ed6ba0 in QHash<QModelIndex, QPersistentModelIndexData*>::remove(QModelIndex const&) ()
    from /privdir/igen029/Downloads/tshui_1574270067447/solibs/libQtCore.so.4
    [Current thread is 1 (Thread 0x7f4559248d40 (LWP 23319))]
    (gdb) bt
    #0 0x00007f4551ed6ba0 in QHash<QModelIndex, QPersistentModelIndexData*>::remove(QModelIndex const&) ()
    from /privdir/igen029/Downloads/tshui_1574270067447/solibs/libQtCore.so.4
    #1 0x00007f4551ecee04 in QAbstractItemModelPrivate::removePersistentIndexData(QPersistentModelIndexData*)
    () from /privdir/igen029/Downloads/tshui_1574270067447/solibs/libQtCore.so.4
    #2 0x00007f4551ecf199 in QPersistentModelIndexData::destroy(QPersistentModelIndexData*) ()
    from /privdir/igen029/Downloads/tshui_1574270067447/solibs/libQtCore.so.4
    #3 0x00007f4551ecf1df in QPersistentModelIndex::~QPersistentModelIndex() ()
    from /privdir/igen029/Downloads/tshui_1574270067447/solibs/libQtCore.so.4
    #4 0x00007f455292c0ae in QAbstractItemViewPrivate::~QAbstractItemViewPrivate() ()
    from /privdir/igen029/Downloads/tshui_1574270067447/solibs/libQtGui.so.4
    #5 0x00007f4552978b77 in QTreeViewPrivate::~QTreeViewPrivate() ()
    from /privdir/igen029/Downloads/tshui_1574270067447/solibs/libQtGui.so.4
    #6 0x00007f4551ef33f5 in QObject::~QObject() ()
    from /privdir/igen029/Downloads/tshui_1574270067447/solibs/libQtCore.so.4
    #7 0x00007f455245d46c in QWidget::~QWidget() (

    1 Reply Last reply
    0
    • Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Please show the complete backtrace. I would guess you're trying to delete an object/widget twice.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      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