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. Why is my QT Application breaking in disassembly code on debug start?
Forum Updated to NodeBB v4.3 + New Features

Why is my QT Application breaking in disassembly code on debug start?

Scheduled Pinned Locked Moved Unsolved General and Desktop
19 Posts 6 Posters 2.0k 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.
  • J Offline
    J Offline
    jabroni
    wrote on 22 Mar 2024, 05:08 last edited by jabroni
    #1

    My QT application has been running fine on my Windows 11 machine for almost two years since I took over development for it. Recently what's happened is that when I start the program in debug mode, it first breaks in disassembly code with the following exception trigger pop up message:

    The inferior stopped because it triggered an exception.
    Stopped in thread 0 by: Exception at 0x772a1fdf, code: 0xc0000005: read access violation at: 0xbaadf00c, flags=0x0 (first chance).
    

    The disassembler stops here:
    6d857f9b-5442-4049-b2a3-47d3b903389b-image.png

    Running the code after this exception is triggered launches the program, but the program will occasionally break in disassembler again and crash.

    I am compiling with MSVC and I've tried a number of different compilers and have tried QT versions 5.2.0, 5.14.1, and 5.15.2 and all produce the same error on Windows 11. I have also tried different combinations of Windows SDK packages, and all produce the same result. I have tried VS Build tools 2015, 2017, and 2019 with no change.

    I ended up installing Windows 10 on another machine and ran the setup with QT 5.14.1, MSVC compiler 15.9.28307.2094, and Windows 10 SDK 10.0.17763.132 where it runs as expected with no problems.

    This one has really confused me.

    QT Setup on my Win 11 machine:
    6d5548b2-4de3-4d90-baf0-9631b5e2d0d5-image.png

    J 1 Reply Last reply 22 Mar 2024, 16:13
    0
    • S Offline
      S Offline
      SamiV123
      wrote on 22 Mar 2024, 16:00 last edited by SamiV123
      #2

      Do you have global objects?

      Smells like an issue related to the construction of non local global objects which have undefined construction order. That typically manifests itself as a mysterious crash before your "main" is ever even called.

      1 Reply Last reply
      1
      • J jabroni
        22 Mar 2024, 05:08

        My QT application has been running fine on my Windows 11 machine for almost two years since I took over development for it. Recently what's happened is that when I start the program in debug mode, it first breaks in disassembly code with the following exception trigger pop up message:

        The inferior stopped because it triggered an exception.
        Stopped in thread 0 by: Exception at 0x772a1fdf, code: 0xc0000005: read access violation at: 0xbaadf00c, flags=0x0 (first chance).
        

        The disassembler stops here:
        6d857f9b-5442-4049-b2a3-47d3b903389b-image.png

        Running the code after this exception is triggered launches the program, but the program will occasionally break in disassembler again and crash.

        I am compiling with MSVC and I've tried a number of different compilers and have tried QT versions 5.2.0, 5.14.1, and 5.15.2 and all produce the same error on Windows 11. I have also tried different combinations of Windows SDK packages, and all produce the same result. I have tried VS Build tools 2015, 2017, and 2019 with no change.

        I ended up installing Windows 10 on another machine and ran the setup with QT 5.14.1, MSVC compiler 15.9.28307.2094, and Windows 10 SDK 10.0.17763.132 where it runs as expected with no problems.

        This one has really confused me.

        QT Setup on my Win 11 machine:
        6d5548b2-4de3-4d90-baf0-9631b5e2d0d5-image.png

        J Offline
        J Offline
        JoeCFD
        wrote on 22 Mar 2024, 16:13 last edited by
        #3

        @jabroni Are you using VS or Qt Creator? If Qt Creator, what is the version number?

        1 Reply Last reply
        0
        • J Offline
          J Offline
          jabroni
          wrote on 25 Mar 2024, 01:21 last edited by jabroni
          #4

          @SamiV123 @JoeCFD

          I am using QT Creator as my build and debug tool. This is not an issue with the code. I just created a new QT project with the base code that is provided by default, and that gives me the same error:

          #include "mainwindow.h"
          
          #include <QApplication>
          
          int main(int argc, char *argv[])
          {
              QApplication a(argc, argv);
              MainWindow w;
              w.show();
              return a.exec();
          }
          
          

          My QT Creator "about" window:
          c1418625-8217-4603-a8dc-7f62b7e83fb0-image.png

          1 Reply Last reply
          0
          • H Online
            H Online
            hskoglund
            wrote on 25 Mar 2024, 01:36 last edited by
            #5

            If you have an anti-virus app running, try disable it.

            J 1 Reply Last reply 25 Mar 2024, 01:49
            1
            • H hskoglund
              25 Mar 2024, 01:36

              If you have an anti-virus app running, try disable it.

              J Offline
              J Offline
              jabroni
              wrote on 25 Mar 2024, 01:49 last edited by
              #6

              @hskoglund Unfortunately no luck. I only have standard windows anti virus protection. I disabled firewall and all settings under "Virus & Threat Protection Settings", amongst other security settings.

              1 Reply Last reply
              0
              • H Online
                H Online
                hskoglund
                wrote on 25 Mar 2024, 02:02 last edited by
                #7

                And if you try another project, for example Application in Examples, I'm guessing you get the same crash?

                J 1 Reply Last reply 25 Mar 2024, 02:09
                0
                • H hskoglund
                  25 Mar 2024, 02:02

                  And if you try another project, for example Application in Examples, I'm guessing you get the same crash?

                  J Offline
                  J Offline
                  jabroni
                  wrote on 25 Mar 2024, 02:09 last edited by
                  #8

                  @hskoglund Yep - Just tried with QT 5.14.1 and 5.15.2 and both crashed.

                  C 1 Reply Last reply 25 Mar 2024, 02:43
                  0
                  • J jabroni
                    25 Mar 2024, 02:09

                    @hskoglund Yep - Just tried with QT 5.14.1 and 5.15.2 and both crashed.

                    C Offline
                    C Offline
                    ChrisW67
                    wrote on 25 Mar 2024, 02:43 last edited by
                    #9

                    @jabroni What is the stack backtrace when the failure occurs. The original error message is from attempting to access memory that does not belong to your process or accessing through a null pointer. In this case the address is in EAX and is 0xbaadf00c (which looks suspiciously like a common flag value 0xbaadf00d (bad food)).

                    If you put a breakpoint on the first line inside main() does the program get that far?

                    What non-Qt libraries, ActiveX controls etc are linked to your application?

                    J 1 Reply Last reply 25 Mar 2024, 03:15
                    0
                    • C ChrisW67
                      25 Mar 2024, 02:43

                      @jabroni What is the stack backtrace when the failure occurs. The original error message is from attempting to access memory that does not belong to your process or accessing through a null pointer. In this case the address is in EAX and is 0xbaadf00c (which looks suspiciously like a common flag value 0xbaadf00d (bad food)).

                      If you put a breakpoint on the first line inside main() does the program get that far?

                      What non-Qt libraries, ActiveX controls etc are linked to your application?

                      J Offline
                      J Offline
                      jabroni
                      wrote on 25 Mar 2024, 03:15 last edited by jabroni
                      #10

                      @ChrisW67 I'll just focus on the main.ccp file in the Applications example project now as that should be what everyone else has.

                      Just as my program, the "crash" occurrs once the .show() function is called. In this case it's mainWin.Show(). Stepping over/into that fails to disassembler:
                      5fb60916-90e6-4546-aa35-e2f959be7cc3-image.png

                      and this is the stack trace:
                      e9f1b151-067b-4bdc-9b22-d85dd2daa4e8-image.png

                      Also, in my main application I am developing, the only external library that is used is QWT 6.1.3 (as far as I am aware - please let me know if there's a way I can check this). However, even with the Application example project which is 80 lines of code the same error occurs.

                      1 Reply Last reply
                      0
                      • H Online
                        H Online
                        hskoglund
                        wrote on 25 Mar 2024, 03:25 last edited by
                        #11

                        Just guessing, but are you using OneDrive for running Qt?

                        J 1 Reply Last reply 25 Mar 2024, 03:30
                        0
                        • H hskoglund
                          25 Mar 2024, 03:25

                          Just guessing, but are you using OneDrive for running Qt?

                          J Offline
                          J Offline
                          jabroni
                          wrote on 25 Mar 2024, 03:30 last edited by
                          #12

                          @hskoglund I do have OneDrive enabled, however my QT application runs out of my local git folder, and QT is installed in C:\Qt.

                          1 Reply Last reply
                          0
                          • H Online
                            H Online
                            hskoglund
                            wrote on 25 Mar 2024, 03:35 last edited by
                            #13

                            Ok. And just to clarify, if you rebuild the Application example in Release mode it does not crash, it only crashes in Debug mode?

                            J 1 Reply Last reply 25 Mar 2024, 04:28
                            0
                            • H hskoglund
                              25 Mar 2024, 03:35

                              Ok. And just to clarify, if you rebuild the Application example in Release mode it does not crash, it only crashes in Debug mode?

                              J Offline
                              J Offline
                              jabroni
                              wrote on 25 Mar 2024, 04:28 last edited by jabroni
                              #14

                              @hskoglund So:

                              Release Mode
                              Start with debugging = same crash
                              Start with no debugging = no crash

                              Debug mode
                              Same as above

                              So it looks like debug run is the issue here I think.

                              And these are the buttons I am referring to when I say "start with debugging":
                              65760f3c-cf7d-460e-b2ba-eea4d69ace7d-image.png

                              1 Reply Last reply
                              0
                              • H Online
                                H Online
                                hskoglund
                                wrote on 25 Mar 2024, 05:10 last edited by
                                #15

                                Maybe you can just tick the checkbox to ignore those breakpoints:
                                Screenshot 2024-03-25 at 06.07.05.png

                                J 1 Reply Last reply 26 Mar 2024, 01:07
                                0
                                • H hskoglund
                                  25 Mar 2024, 05:10

                                  Maybe you can just tick the checkbox to ignore those breakpoints:
                                  Screenshot 2024-03-25 at 06.07.05.png

                                  J Offline
                                  J Offline
                                  jabroni
                                  wrote on 26 Mar 2024, 01:07 last edited by
                                  #16

                                  @hskoglund well okay that omits that error from startup haha. Which solves that problem, however if I enter a breakpoint during debug runtime of my application it breaks into disassembler code:

                                          ntdll!DbgBreakPoint:
                                  0x772c8c00                   int     3
                                  0x772c8c01  <+    1>         ret
                                  0x772c8c02  <+    2>         int     3
                                  
                                  J 1 Reply Last reply 26 Mar 2024, 23:15
                                  0
                                  • J jabroni
                                    26 Mar 2024, 01:07

                                    @hskoglund well okay that omits that error from startup haha. Which solves that problem, however if I enter a breakpoint during debug runtime of my application it breaks into disassembler code:

                                            ntdll!DbgBreakPoint:
                                    0x772c8c00                   int     3
                                    0x772c8c01  <+    1>         ret
                                    0x772c8c02  <+    2>         int     3
                                    
                                    J Offline
                                    J Offline
                                    jabroni
                                    wrote on 26 Mar 2024, 23:15 last edited by
                                    #17

                                    @jabroni anyone have anything extra on this? really not sure what my options are here :\

                                    1 Reply Last reply
                                    0
                                    • N Offline
                                      N Offline
                                      ngocanhnu
                                      wrote on 29 Mar 2024, 08:15 last edited by
                                      #18

                                      @jabroni Hi, I've met same issue with you.
                                      But not as your case, my code have a problem with "tr" function when using with static variable.
                                      I fix that follow the guide here https://forum.qt.io/topic/33568/qt-tr-not-working-if-i-am-using-in-static-member
                                      Hope it can help you.

                                      J 1 Reply Last reply 1 Apr 2024, 11:55
                                      0
                                      • N ngocanhnu
                                        29 Mar 2024, 08:15

                                        @jabroni Hi, I've met same issue with you.
                                        But not as your case, my code have a problem with "tr" function when using with static variable.
                                        I fix that follow the guide here https://forum.qt.io/topic/33568/qt-tr-not-working-if-i-am-using-in-static-member
                                        Hope it can help you.

                                        J Offline
                                        J Offline
                                        jabroni
                                        wrote on 1 Apr 2024, 11:55 last edited by
                                        #19

                                        @ngocanhnu I don't think that's quite the same problem, but thank you.

                                        1 Reply Last reply
                                        0

                                        1/19

                                        22 Mar 2024, 05:08

                                        • Login

                                        • Login or register to search.
                                        1 out of 19
                                        • First post
                                          1/19
                                          Last post
                                        0
                                        • Categories
                                        • Recent
                                        • Tags
                                        • Popular
                                        • Users
                                        • Groups
                                        • Search
                                        • Get Qt Extensions
                                        • Unsolved