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. QFatal where is the problem

QFatal where is the problem

Scheduled Pinned Locked Moved General and Desktop
10 Posts 3 Posters 2.7k 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.
  • G Offline
    G Offline
    grastvei
    wrote on last edited by
    #1

    I've got a software that suddenly gives me a qFatal from qlist::at but there is no stacktrace that tell me what caused it. Is there a god method to get the stacktrace or similar from the crash?

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      Run in debug mode if possible.

      A shot in the dark (but ion case of QList it's really very possible) is that somebody is trying to access an index outside of the list (index > QList::size()). Normally that crashes with a failed assertion.

      (Z(:^

      1 Reply Last reply
      0
      • G Offline
        G Offline
        grastvei
        wrote on last edited by
        #3

        I run in debug, and I know something is trying to access outside the list. But it is hard to detect from where this call is.

        1 Reply Last reply
        0
        • sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #4

          No stacktrace in debug mode? Have you compiled Qt yourself only in release mode, perhaps?

          (Z(:^

          1 Reply Last reply
          0
          • G Offline
            G Offline
            grastvei
            wrote on last edited by
            #5

            It is qt5.1 for mingw.
            When i recive qFatal the application keeps running in the background, but it is not possible to interact with it anymore.

            1 Reply Last reply
            0
            • G Offline
              G Offline
              grastvei
              wrote on last edited by
              #6

              The solution for me is to use: qInstallMessageHandler
              Install a new handler and break when the qFatal occurs.

              1 Reply Last reply
              0
              • JeroentjehomeJ Offline
                JeroentjehomeJ Offline
                Jeroentjehome
                wrote on last edited by
                #7

                Hi, just for your information, but a QList index is size() - 1 as maximum. It works like arrays in C, so with index 0, not 1!
                That might explain a crash.

                Greetz, Jeroen

                1 Reply Last reply
                0
                • G Offline
                  G Offline
                  grastvei
                  wrote on last edited by
                  #8

                  The crash was QString::number sometimes convert a double incorrectly. It work maybe a million times and the suddenly dropped everything after the decimal, and coursed the a split operation to fail.

                  1 Reply Last reply
                  0
                  • G Offline
                    G Offline
                    grastvei
                    wrote on last edited by
                    #9

                    When we first are writing error handlers to capture errors. Is there an easy way to capture a stack trace? That would make it easier to debug a crash that is done by a customer.

                    1 Reply Last reply
                    0
                    • JeroentjehomeJ Offline
                      JeroentjehomeJ Offline
                      Jeroentjehome
                      wrote on last edited by
                      #10

                      Hi,
                      In Qt5 you are able to install an event message handler. There your are able to store any data into a errorLog file etc before the crash really aborts the program (qFatal).
                      Maybe that would add functionality to your program for debugging.

                      Greetz, Jeroen

                      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