Details
-
Bug
-
Resolution: Unresolved
-
Not Evaluated
-
None
-
Qt Creator 16.0.0
-
None
-
Ubuntu 22.04.5
Qt 6.8.3
QtCreator 16.0.0
gdb 12.1
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