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. Windows Desktop GUI App crashes when release mode is run. But does not crash when debug mode is run.
QtWS25 Last Chance

Windows Desktop GUI App crashes when release mode is run. But does not crash when debug mode is run.

Scheduled Pinned Locked Moved General and Desktop
windowsreleasedesktopguiwindows releasecrash
6 Posts 4 Posters 4.9k 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.
  • M Offline
    M Offline
    mrjextreme6
    wrote on last edited by
    #1

    I have this strange problem where running the release version of my GUI on Windows crashes at startup and prints out the following [abridged] output:

    Starting C:........\build-WindowsUI-Desktop_Qt_5_4_0_MSVC2010_OpenGL_32bit-Release\release\WindowsUI.exe...
    The program has unexpectedly finished.
    C:.............\build-WindowsUI-Desktop_Qt_5_4_0_MSVC2010_OpenGL_32bit-Release\release\WindowsUI.exe crashed

    There is no other information given. Compiler output seems normal and no crash detailed information is printed. When I run the debug version: everything is fine. The GUI runs normally and no problems encountered.

    Has anyone else encountered something like this before? I'm stuck here.

    simowS S 2 Replies Last reply
    0
    • M mrjextreme6

      I have this strange problem where running the release version of my GUI on Windows crashes at startup and prints out the following [abridged] output:

      Starting C:........\build-WindowsUI-Desktop_Qt_5_4_0_MSVC2010_OpenGL_32bit-Release\release\WindowsUI.exe...
      The program has unexpectedly finished.
      C:.............\build-WindowsUI-Desktop_Qt_5_4_0_MSVC2010_OpenGL_32bit-Release\release\WindowsUI.exe crashed

      There is no other information given. Compiler output seems normal and no crash detailed information is printed. When I run the debug version: everything is fine. The GUI runs normally and no problems encountered.

      Has anyone else encountered something like this before? I'm stuck here.

      simowS Offline
      simowS Offline
      simow
      wrote on last edited by simow
      #2

      @mrjextreme6 Hi, I would suggest taking the conventional approach to insert qDebug() << "..."; markers so that you can find out how far your program proceeds.
      Also a good candidate for this behaviour could be un-initialized class members.
      Don't forget to enable console output on windows by adding CONFIG += console to your pro file.

      Let's Try To Negotiate!

      1 Reply Last reply
      0
      • idlefrogI Offline
        idlefrogI Offline
        idlefrog
        wrote on last edited by
        #3

        When I get that kind of behaviour I always suspect I've used a deleted an uninitialized pointer.
        OR perhaps double deleted something.

        You may wish to consider using QScopedPointer to handle the deletion of pointers.

        If you are really stuck as you say, then be ready to to use lots of qDebug!
        Check your constructors set ALL your pointers to NULL/nullptr if they are not initialized.
        When you delete a pointer, set it to NULL/nullptr afterwards.

        Alternatively, perhaps, make a simple test program.
        You can run the debugger on the release build... but its not easy going.

        1 Reply Last reply
        0
        • M mrjextreme6

          I have this strange problem where running the release version of my GUI on Windows crashes at startup and prints out the following [abridged] output:

          Starting C:........\build-WindowsUI-Desktop_Qt_5_4_0_MSVC2010_OpenGL_32bit-Release\release\WindowsUI.exe...
          The program has unexpectedly finished.
          C:.............\build-WindowsUI-Desktop_Qt_5_4_0_MSVC2010_OpenGL_32bit-Release\release\WindowsUI.exe crashed

          There is no other information given. Compiler output seems normal and no crash detailed information is printed. When I run the debug version: everything is fine. The GUI runs normally and no problems encountered.

          Has anyone else encountered something like this before? I'm stuck here.

          S Offline
          S Offline
          SysTech
          wrote on last edited by SysTech
          #4

          @mrjextreme6

          The above suggestions are spot on. One thing... Are you "running" your app straight from Windows or from Qt development environment?

          The reason I ask is that when I was first deploying my app I got the same behavior. It just crashed unfortunately I was at the client and just trying to get it working. I didn't have much time to liter more qdebug stuff. (I did after).

          What I found was I was missing a number of key DLLs in the path. The symptom was just a total crash rather than some message. I had run dependency checker and thought I had what was needed. Nope...

          To solve the immediate problem and get the app up and running I ended up downloading and installing VS2013 community edition which installed the right runtimes that were needed and it just started to work. (my compiler is VS2013)

          After that experience and sweat I created a generic Windows 7 VM and did install after install until I could get the app to run. Before I deploy any new version I repeat the process checking that I have everything needed.

          Hope the above hints and this help!

          simowS 1 Reply Last reply
          0
          • S SysTech

            @mrjextreme6

            The above suggestions are spot on. One thing... Are you "running" your app straight from Windows or from Qt development environment?

            The reason I ask is that when I was first deploying my app I got the same behavior. It just crashed unfortunately I was at the client and just trying to get it working. I didn't have much time to liter more qdebug stuff. (I did after).

            What I found was I was missing a number of key DLLs in the path. The symptom was just a total crash rather than some message. I had run dependency checker and thought I had what was needed. Nope...

            To solve the immediate problem and get the app up and running I ended up downloading and installing VS2013 community edition which installed the right runtimes that were needed and it just started to work. (my compiler is VS2013)

            After that experience and sweat I created a generic Windows 7 VM and did install after install until I could get the app to run. Before I deploy any new version I repeat the process checking that I have everything needed.

            Hope the above hints and this help!

            simowS Offline
            simowS Offline
            simow
            wrote on last edited by
            #5

            @SysTech said:

            After that experience and sweat I created a generic Windows 7 VM and did install after install until I could get the app to run. Before I deploy any new version I repeat the process checking that I have everything needed.

            Indeed a very good hint that in my opinion everyone should follow! I once fell for the plugins issue: Running the application on a Windows system with Qt SDK installed ran fine, on the target system not because of the missing qwindows.dll plugin. Admittingly that was before I found the excellent deployment documentation on the wiki...

            Let's Try To Negotiate!

            1 Reply Last reply
            0
            • M Offline
              M Offline
              mrjextreme6
              wrote on last edited by
              #6

              Thank you everyone :)

              I followed simow and SysTech's suggestions and used QDebug to find the problem. I found my program crashed when entering a certain set of libraries so I ran the release executable through the debugger. The stack trace of the assembly revealed that my code was using the debug versions of my third party dlls even though I thought I specified my project to not use them in the release version. I modified the .pro file in qtcreator and now everything works properly. Thanks!!!

              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