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. How to debug "Exception Triggered: The inferior stopped because it triggered an exception"?
Forum Updated to NodeBB v4.3 + New Features

How to debug "Exception Triggered: The inferior stopped because it triggered an exception"?

Scheduled Pinned Locked Moved Solved General and Desktop
qt 5.5exceptiondebuggingmsvc2017
4 Posts 3 Posters 3.8k 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.
  • E Offline
    E Offline
    elsa
    wrote on last edited by elsa
    #1

    Hello everyone,
    i have been having a lot of unexpected complications in my program for some time now. First I wanted to use QtBluetooth on Windows, so I had to change the compiler to MSCV. This resulted in some linker errors that are also resolved now.
    I thought now I should have a functioning program again with the new compiler, but no! No it builds without problems, but when running/debugging I get the following exception:
    0_1535099990491_error exception.PNG

    I would think that read access violation comes when I try to access memory/variables that are not initialized etc. But this is not the case here, until now I couldn't make sense of the problem. So my question is how can you debug an exception like this one?
    Note: The screenshot is from the constructor of my subclass for QApplication and _ready is a member variable.
    Note 2: I tried commenting out the line and the exception just appears somewhere else, and then I disable this line and so on, until the exception just shows on the last bracket of the constructor:
    0_1535101570087_error exception end.PNG
    Note 3: In some cases, when I leave out some lines the debugger starts and never finishes and doesn't show any messages, and then there is apparently some instance still running in the background that I cannot access (not visible in the task manager). To be able to run the program again I have to restart the computer..
    Note 4: The program was and still is working fine with the MinGW compiler! That's why I am so confused.

    I would be very thankful for any guidance to make sense of this.. and some ideas to solve it.
    Thanks in advance!

    jsulmJ JonBJ 2 Replies Last reply
    0
    • E elsa

      Hello everyone,
      i have been having a lot of unexpected complications in my program for some time now. First I wanted to use QtBluetooth on Windows, so I had to change the compiler to MSCV. This resulted in some linker errors that are also resolved now.
      I thought now I should have a functioning program again with the new compiler, but no! No it builds without problems, but when running/debugging I get the following exception:
      0_1535099990491_error exception.PNG

      I would think that read access violation comes when I try to access memory/variables that are not initialized etc. But this is not the case here, until now I couldn't make sense of the problem. So my question is how can you debug an exception like this one?
      Note: The screenshot is from the constructor of my subclass for QApplication and _ready is a member variable.
      Note 2: I tried commenting out the line and the exception just appears somewhere else, and then I disable this line and so on, until the exception just shows on the last bracket of the constructor:
      0_1535101570087_error exception end.PNG
      Note 3: In some cases, when I leave out some lines the debugger starts and never finishes and doesn't show any messages, and then there is apparently some instance still running in the background that I cannot access (not visible in the task manager). To be able to run the program again I have to restart the computer..
      Note 4: The program was and still is working fine with the MinGW compiler! That's why I am so confused.

      I would be very thankful for any guidance to make sense of this.. and some ideas to solve it.
      Thanks in advance!

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

      @elsa My guess is that window3d() returns a nullptr. You should check this first.

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

      1 Reply Last reply
      5
      • E elsa

        Hello everyone,
        i have been having a lot of unexpected complications in my program for some time now. First I wanted to use QtBluetooth on Windows, so I had to change the compiler to MSCV. This resulted in some linker errors that are also resolved now.
        I thought now I should have a functioning program again with the new compiler, but no! No it builds without problems, but when running/debugging I get the following exception:
        0_1535099990491_error exception.PNG

        I would think that read access violation comes when I try to access memory/variables that are not initialized etc. But this is not the case here, until now I couldn't make sense of the problem. So my question is how can you debug an exception like this one?
        Note: The screenshot is from the constructor of my subclass for QApplication and _ready is a member variable.
        Note 2: I tried commenting out the line and the exception just appears somewhere else, and then I disable this line and so on, until the exception just shows on the last bracket of the constructor:
        0_1535101570087_error exception end.PNG
        Note 3: In some cases, when I leave out some lines the debugger starts and never finishes and doesn't show any messages, and then there is apparently some instance still running in the background that I cannot access (not visible in the task manager). To be able to run the program again I have to restart the computer..
        Note 4: The program was and still is working fine with the MinGW compiler! That's why I am so confused.

        I would be very thankful for any guidance to make sense of this.. and some ideas to solve it.
        Thanks in advance!

        JonBJ Offline
        JonBJ Offline
        JonB
        wrote on last edited by JonB
        #3

        @elsa

        Note 2: I tried commenting out the line and the exception just appears somewhere else, and then I disable this line and so on, until the exception just shows on the last bracket of the constructor:

        You commented out every line and it still errors?? That would negate @jsulm 's suggestion....

        One thing: there is nothing wrong with it per se, but you're sure your RTLSDisplayException constructor/call takes a int &argc, as opposed to the int argc you can see QApplication base constructor is called with? There's a big difference between int and int &, it's "unusual" to have a C++ program passed an int &argc. And if it is a int &, what is reference "pointing to", and particularly what is that variable's value? Having a huge argc value could have start-up code marching all over the place through your argv....

        1 Reply Last reply
        1
        • E Offline
          E Offline
          elsa
          wrote on last edited by
          #4

          @jsulm there was in fact a problem with window3d() that MinGW didnt complain about! Thanks!
          @JonB no I had commented out only up to the second screenshot, so that's why this was the problem.
          And about the second issue, to be honest I adapted the constructor from an older version of the application and it also had &argc. At one point I also noticed it and now I tried out both and both work.

          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