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. can anybody suggest the way to find hang and Crash issue in auto start based qt application ?
Forum Updated to NodeBB v4.3 + New Features

can anybody suggest the way to find hang and Crash issue in auto start based qt application ?

Scheduled Pinned Locked Moved Solved General and Desktop
16 Posts 4 Posters 1.1k 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.
  • JonBJ JonB

    @Qt-embedded-developer said in can anybody suggest the way to find hang and Crash issue in auto start based qt application ?:

    @JoeCFD i have generated core dump file.

    You mean as I suggested you do but you didn't respond to?

    I don't know what command you are using to show the core dump file. A core dump file is a large binary file, usually named core. Once you have it you need to run

    gdb /path/to/your/executable /path/to/the/core/file
    

    and then type into gdb command bt to see the backtrace.

    In order to generate a usable core file in a known place you must Google for core dump against whatever distro of Linux you are using. In the old days it just put a core for you to use in the current directory, nowadays you potentially have to do all sorts of stuff to tell Linux you want it to save the file (e.g. see ulimit and /proc/sys/kernel/core_pattern or sysctl kernel.core_pattern).

    Q Offline
    Q Offline
    Qt embedded developer
    wrote on last edited by Qt embedded developer
    #6

    @JonB Thanks now i got understand. i will try to generate core dump file and after that i will follow your steps.

    i my log last line is :

    could not parse float to string NA;

    JonBJ 1 Reply Last reply
    0
    • Q Qt embedded developer

      @JonB Thanks now i got understand. i will try to generate core dump file and after that i will follow your steps.

      i my log last line is :

      could not parse float to string NA;

      JonBJ Online
      JonBJ Online
      JonB
      wrote on last edited by
      #7

      @Qt-embedded-developer
      So that looks the reason. You can look at the backtrace now from the core if you need to.

      could not parse float to string NA;

      Is that your own message? I cannot imagine this is a "proper" message. One does not "parse" floats, one parses strings. Sounds like something about a float/string is not in the right format.

      Q 1 Reply Last reply
      0
      • JonBJ JonB

        @Qt-embedded-developer
        So that looks the reason. You can look at the backtrace now from the core if you need to.

        could not parse float to string NA;

        Is that your own message? I cannot imagine this is a "proper" message. One does not "parse" floats, one parses strings. Sounds like something about a float/string is not in the right format.

        Q Offline
        Q Offline
        Qt embedded developer
        wrote on last edited by
        #8

        @JonB i am getting the below output when check back trace

        (gdb) bt
        #0  StatusController::slotPollingRequested (this=0x55fe909f49d0)
            at ../../appDir/appDirComponents/controllers/statuscontroller.cpp:516
        #1  0x000055fe8fe92047 in QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, bool (StatusController::*)()>::call(bool (StatusController::*)(), StatusController*, void**) (
            f=(bool (StatusController::*)(StatusController * const)) 0x55fe8fe72b7c <StatusController::slotPollingRequested()>, o=0x55fe909f49d0, arg=0x7ffc9a501b60)
            at /home/terumo/Qt5.15.8/5.15.8/gcc_64/include/QtCore/qobjectdefs_impl.h:152
        #2  0x000055fe8fe91bb4 in QtPrivate::FunctionPointer<bool (StatusController::*)()>::call<QtPrivate::List<>, void>(bool (StatusController::*)(), StatusController*, void**) (
            f=(bool (StatusController::*)(StatusController * const)) 0x55fe8fe72b7c <StatusController::slotPollingRequested()>, o=0x55fe909f49d0, arg=0x7ffc9a501b60)
            at /home/terumo/Qt5.15.8/5.15.8/gcc_64/include/QtCore/qobjectdefs_impl.h:185
        #3  0x000055fe8fe9107c in QtPrivate::QSlotObject<bool (StatusController::*)(), QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) (which=1, this_=0x55fe90a0c850, r=0x55fe909f49d0, a=0x7ffc9a501b60, 
            ret=0x0)
            at /home/terumo/Qt5.15.8/5.15.8/gcc_64/include/QtCore/qobjectdefs_impl.h:418
        
        JonBJ 1 Reply Last reply
        0
        • Q Qt embedded developer

          @JonB i am getting the below output when check back trace

          (gdb) bt
          #0  StatusController::slotPollingRequested (this=0x55fe909f49d0)
              at ../../appDir/appDirComponents/controllers/statuscontroller.cpp:516
          #1  0x000055fe8fe92047 in QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, bool (StatusController::*)()>::call(bool (StatusController::*)(), StatusController*, void**) (
              f=(bool (StatusController::*)(StatusController * const)) 0x55fe8fe72b7c <StatusController::slotPollingRequested()>, o=0x55fe909f49d0, arg=0x7ffc9a501b60)
              at /home/terumo/Qt5.15.8/5.15.8/gcc_64/include/QtCore/qobjectdefs_impl.h:152
          #2  0x000055fe8fe91bb4 in QtPrivate::FunctionPointer<bool (StatusController::*)()>::call<QtPrivate::List<>, void>(bool (StatusController::*)(), StatusController*, void**) (
              f=(bool (StatusController::*)(StatusController * const)) 0x55fe8fe72b7c <StatusController::slotPollingRequested()>, o=0x55fe909f49d0, arg=0x7ffc9a501b60)
              at /home/terumo/Qt5.15.8/5.15.8/gcc_64/include/QtCore/qobjectdefs_impl.h:185
          #3  0x000055fe8fe9107c in QtPrivate::QSlotObject<bool (StatusController::*)(), QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) (which=1, this_=0x55fe90a0c850, r=0x55fe909f49d0, a=0x7ffc9a501b60, 
              ret=0x0)
              at /home/terumo/Qt5.15.8/5.15.8/gcc_64/include/QtCore/qobjectdefs_impl.h:418
          
          JonBJ Online
          JonBJ Online
          JonB
          wrote on last edited by
          #9

          @Qt-embedded-developer
          And? It tells you the file and line number in your code where it crashes, so....

          Q 1 Reply Last reply
          0
          • Q Qt embedded developer has marked this topic as solved on
          • JonBJ JonB

            @Qt-embedded-developer
            And? It tells you the file and line number in your code where it crashes, so....

            Q Offline
            Q Offline
            Qt embedded developer
            wrote on last edited by
            #10

            @JonB i have resolved this above problem. but still app crash.

            and in this time bt shows nothing.

            i have check memory using top command and at that time remaining free memory was quiet low

            i.e. from 4000 mb, remaining free memory is 100 mb.

            So is there another way to find this type of crash ?

            jsulmJ 1 Reply Last reply
            0
            • Q Qt embedded developer

              @JonB i have resolved this above problem. but still app crash.

              and in this time bt shows nothing.

              i have check memory using top command and at that time remaining free memory was quiet low

              i.e. from 4000 mb, remaining free memory is 100 mb.

              So is there another way to find this type of crash ?

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on last edited by
              #11

              @Qt-embedded-developer said in can anybody suggest the way to find hang and Crash issue in auto start based qt application ?:

              So is there another way to find this type of crash ?

              If you suspect that you have a memory leak use Valgrind to analyse your app (QtCreator supports it).

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              Q 1 Reply Last reply
              1
              • jsulmJ jsulm

                @Qt-embedded-developer said in can anybody suggest the way to find hang and Crash issue in auto start based qt application ?:

                So is there another way to find this type of crash ?

                If you suspect that you have a memory leak use Valgrind to analyse your app (QtCreator supports it).

                Q Offline
                Q Offline
                Qt embedded developer
                wrote on last edited by Qt embedded developer
                #12

                @jsulm and @JonB i have used Valgrind tool but it not shows the any memory leak.

                JonBJ 1 Reply Last reply
                0
                • Q Qt embedded developer

                  @jsulm and @JonB i have used Valgrind tool but it not shows the any memory leak.

                  JonBJ Online
                  JonBJ Online
                  JonB
                  wrote on last edited by JonB
                  #13

                  @Qt-embedded-developer
                  Then maybe you don't have any memory leak, maybe your code (or other stuff on machine) uses up a lot of memory without a "leak". But that does not mean it has to use that much memory, valgrind etc. can only tell you if you leak, not that (perhaps, perhaps not) your algorithm might be improved....

                  In general, make sure you free objects as soon as you don't need them again. Just as an example: suppose you create some large images in memory. So long as valgrind does not detect you have "lost" the pointer to it, so you will still be able to free it later, it can't complain. But if you keep them all in memory at the same time you will be using a lot of room....

                  Q 1 Reply Last reply
                  2
                  • JonBJ JonB

                    @Qt-embedded-developer
                    Then maybe you don't have any memory leak, maybe your code (or other stuff on machine) uses up a lot of memory without a "leak". But that does not mean it has to use that much memory, valgrind etc. can only tell you if you leak, not that (perhaps, perhaps not) your algorithm might be improved....

                    In general, make sure you free objects as soon as you don't need them again. Just as an example: suppose you create some large images in memory. So long as valgrind does not detect you have "lost" the pointer to it, so you will still be able to free it later, it can't complain. But if you keep them all in memory at the same time you will be using a lot of room....

                    Q Offline
                    Q Offline
                    Qt embedded developer
                    wrote on last edited by Qt embedded developer
                    #14

                    @JonB may be yes because i also seen that memory is usually increase slowly with time on particular 2 screen

                    1] screen that update 42 parameters every 1 second using qAbstractlist model

                    2] screen that show live data on graph screen . where at a time in one thread 4 data get shown on graph screen.

                    JonBJ 1 Reply Last reply
                    0
                    • Q Qt embedded developer

                      @JonB may be yes because i also seen that memory is usually increase slowly with time on particular 2 screen

                      1] screen that update 42 parameters every 1 second using qAbstractlist model

                      2] screen that show live data on graph screen . where at a time in one thread 4 data get shown on graph screen.

                      JonBJ Online
                      JonBJ Online
                      JonB
                      wrote on last edited by JonB
                      #15

                      @Qt-embedded-developer
                      I appended an extra paragraph to my previous before I saw your reply.

                      Neither of what you mention is something we can tell you about. Qt in itself will not "leak" nor "hang onto things" which you have freed. Your own code and whether it behaves "best" is a different matter....

                      4 data get shown on graph screen

                      Whatever this means, for example if you plot enough points (millions? billions?) without removing some you will eventually keep using more and more memory....

                      Q 1 Reply Last reply
                      1
                      • JonBJ JonB

                        @Qt-embedded-developer
                        I appended an extra paragraph to my previous before I saw your reply.

                        Neither of what you mention is something we can tell you about. Qt in itself will not "leak" nor "hang onto things" which you have freed. Your own code and whether it behaves "best" is a different matter....

                        4 data get shown on graph screen

                        Whatever this means, for example if you plot enough points (millions? billions?) without removing some you will eventually keep using more and more memory....

                        Q Offline
                        Q Offline
                        Qt embedded developer
                        wrote on last edited by Qt embedded developer
                        #16

                        @JonB I have found that my code has issue due passing value using pointer.

                        so passing by value have resolved the Crash issue.

                        Now my error list is not passed by pointer its passed directly.

                        This issue identified by GDB. As well as valgrind tool also helps.

                        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