Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Debugging a crash in libQtDeclarative (Qt 4.8.1)



  • Dear all,

    I'm in a desperate situation currently, trying to debug a crash of my application which is seemingly caused within the qt declarative module.
    The crash always happens at the same point, when relatively many C++-Models (ListModels, QList's and single property) trigger an update. Unfortunately I can not reliably trigger the crash, as it seems to happen after some initial interaction, often followed by some time (10-30mins) of inactivity.

    It would be fantastic if someone who had a similar problem could give my some hints on debugging the problem.

    At the moment, all I got is the following backtrace which seems useless:

    #0 0x00007f8f3ca38f1e in ?? () from [...]/libQtDeclarative.so.4
    #1 0x00007f8f3ca3a48c in ?? () from [...]/libQtDeclarative.so.4
    #2 0x00007f8f3ca3b48c in ?? () from [...]/libQtDeclarative.so.4
    #3 0x00007f8f3ca3bdbb in ?? () from [...]/libQtDeclarative.so.4
    #4 0x00007f8f3c05bc7e in ?? () from [...]/libQtScript.so.4
    #5 0x00007f8f3bf528e0 in ?? () from [...]/libQtScript.so.4
    #6 0x00007f8f3bf2cb17 in ?? () from [...]/libQtScript.so.4
    #7 0x00007f8f3433e330 in ?? ()
    #8 0x0000000000000002 in ?? () at gtest-1.6.0/include/gtest/gtest.h:172
    #9 0x00007f8f2e5f2d40 in ?? ()
    #10 0x00007f8f0000000b in ?? ()
    #11 0x00007f8f00000002 in ?? ()
    #12 0x000000000644c430 in ?? ()
    #13 0x000000000000000f in ?? () at gtest-1.6.0/include/gtest/internal/gtest-port.h:1350
    #14 0x0000000000000005 in ?? () at gtest-1.6.0/include/gtest/internal/gtest-port.h:1288
    #15 0x0000000000000000 in ?? ()

    Thanks in advance
    Sandro



  • I just wanted to inform you guys about the solution to my problem.

    In summary, the problem seemed to be a C++ / QML-engine interfacing and memory management issue:

    I was lucky enough to identify a small set of candidate revisions of the software which potentially caused the described behavior. In these changes, there was noticeable that in the QML/Javascript code there was a lot of manual fiddling with list models. For example, specific list-model entries (provided by the C++ core) were accessed via ListModel.get(), and they were in turn stored as static property values. I assumed that this is dangerous because as soon as the C++ core deletes the list model entries, it is not guaranteed that the references stored within the QML engine are properly cleared.

    Therefore, I modified this part of the implementation, and suddenly the application was running perfectly stable again.


Log in to reply