Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-32747

QtCreator ASSERT SIGABRT on expression QList index out of range

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • Qt Creator 16.0.0
    • Debugger
    • None
    • Ubuntu 22.04.5
      Qt 6.8.3
      QtCreator 16.0.0
      gdb 12.1
    • Linux/X11

    Description

      While debugging, if an Expression evaluator has an out of range QList index, each step results in an ASSERT and SIGABRT popup.

      ASSERT failure in QList::operator[]: "index out of range", file /home/jsm/Qt/6.8.3/gcc_64/include/QtCore/qlist.h, line 458

      Example code:
      #include <QApplication>

      int main(int argc, char *argv[])
      {
      QList<int> testList;

      fprintf(stderr, "Size of list = %lld\n", testList.count()); // Set breakpoint on this line

      for (int x = 0; x < 5; x++)

      { testList.append(x); }

      for (int x = 0; x < 5; x++) {
      fprintf(stderr, "testList[x] = %d\n", testList[x]);
      }
      }
      Add expression evaluator:
      testList[2]

      Once you know what's actually going on, it is easy to resolve, but the first time I saw this I assumed there was a problem in my application code and I spent a number of hours being confused.

      Desired behaviour would be some indication that this is an expression problem, not the application, perhaps highlight it in red and ignore it?

      See also:
      https://forum.qt.io/topic/161612/qt-creator-crashes-sigabrt-on-expression-error

      Attachments

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

        Activity

          People

            hjk hjk
            jamesmurray jamesmurray
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes