Important: Please read the Qt Code of Conduct -

application abort: stacktrace shows only Qt/qml programs with much optimized out

  • hey guys,

    I have an abort from the application we are developing where the stack trace shows none of our own programs, only Qt and Qml methods and calls. Also a lot of the variables are optimized out. I understand I need to override the optimization with -O0 or -O1, but I have not found a clue how to do that.

    The abort occurs only when I delete certain objects from the canvas. I have the following questions:

    1. How do I unset optimization, if possible platform independent, i.e. for Linux, Windows and MacX?
    2. If none of my own projects classes and methods are in the stacktrace, does that automatically make this a bug?
    3. How can I analyse the problem if I see only Qt/Qml classes and methods in the stack trace?

    At the end of the stack trace I did find the following warnings right after registration of 2 of my classes DataControl and PluginControl, but I do not know what the implication is.

    Any ideas?

    warning: can't find linker symbol for virtual table for QEventLoop' value warning: foundQQmlDebugServer::QQmlDebugServer()::{lambda()#2}::operator()() const::qstring_literal' instead

  • Moderators

    Ad 1.


    More info: link.

    Ad 2.
    No, this does not automatically become Qt bug (although it might be, of course). You will get similar situation if you - for example - try to access QList at invalid index. It will assert, and the stack trace will be quite misleading. But it is your bug, not Qt.

    Ad 3.
    Run your app through valgrind memory analyzer - it shows much better stack traces that the OS usually does.

  • @sierdzio Thank you. I needed that info. The weirdest thing though ....
    I compiled with -O0 and the abort magically disappeared. So I need to do some thorough checking to find out what the cause is.

    Need to do some more testing before I understand what is going on. The use of valgrind is really good advice!
    For some reason using it from QtCreator I don't understand, so I use it from the command line.

    P.S. I used QMAKE_CXXFLAGS_DEBUG instead.

Log in to reply