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. Std::__non_rtti_object is thrown in QAbstractItemModel::endResetModel()
Forum Update on Monday, May 27th 2025

Std::__non_rtti_object is thrown in QAbstractItemModel::endResetModel()

Scheduled Pinned Locked Moved General and Desktop
2 Posts 1 Posters 2.4k 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.
  • R Offline
    R Offline
    rtbo59
    wrote on last edited by
    #1

    Hello

    I recently switched compiler from MinGW to MSVC.
    I have now a bug on a code that worked fine with MinGW.

    The runtime throws a std::__non_rtti_object exception when I call endResetModel();

    I built Qt5 from git with rtti enabled. My code is also compiled with RTTI enabled.
    (I get the same exception when using the official binary release 5.0.2 for MSVC2010 and opengl)

    @
    // my code
    void
    ResultTableModel::setSim(Sim *sim) {
    if (sim_ != sim) {
    beginResetModel();
    sim_ = sim;
    endResetModel(); // <- exception is thrown here.
    }
    }

    // Qt's code (qtbase\src\corelib.moc\debug_shared\moc_qabstractitemmodel.cpp)
    // SIGNAL 18
    void QAbstractItemModel::modelReset(QPrivateSignal)
    {
    QMetaObject::activate(this, &staticMetaObject, 18, 0); // <- exception is thrown here.
    }
    @

    I get the Sim object from a dynamic_cast, however the debugger tells me that all the objects are valid (either sim or any other object I checked in the call stack).
    If I comment out endResetModel(), the exception is not thrown.
    And my code works perfectly with MinGW

    moreover, I get the following debug output:
    @
    First-chance exception at 0x102fd5cd (msvcr100d.dll) in MyProgram.exe: 0xC0000005: Access violation reading location 0xfeeefeea.
    First-chance exception at 0x7c812afb in MyProgram.exe: Microsoft C++ exception: std::__non_rtti_object at memory location 0x0012b7bc..
    Unhandled exception at 0x7c812afb in MyProgram.exe: Microsoft C++ exception: std::__non_rtti_object at memory location 0x0012b7bc..
    @

    1. I can't figure out what is at the location 0x0012b7bc. The first object I build (QApplication) is at location 0x0012ff50 (heap objects are somewhere in 0x09xxxxxx)
    2. There seems to be another exception first (access violation somewhere) but I don't know how to break on that one.

    It may not be Qt related, but I'm not sure.
    I'm completely stuck on that one! Any help or hint about where to look at will be appreciated
    thanks !

    1 Reply Last reply
    0
    • R Offline
      R Offline
      rtbo59
      wrote on last edited by
      #2

      // euhh (shame on me)

      I managed to break on the access violation (that wasn't so hard) and solved my problem.

      definitly not Qt related. Pure home brew bug ! (I had to tweak some parts of the code to make it compilable with msvc)
      sorry for the noise.

      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