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. Release Mode Crashing but Debug with Debug mode working ? Why
Forum Update on Monday, May 27th 2025

Release Mode Crashing but Debug with Debug mode working ? Why

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 5 Posters 288 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.
  • R Offline
    R Offline
    RahibeMeryem
    wrote on 6 Feb 2021, 21:26 last edited by
    #1

    Hi,

    I have AI models ncnn / mnn etc. It is crashing Release mode.

    But same project working at Debug mode in QtCreator.

    What will be the problem ?

    I try to run Release mode with clean env same result.

    any experince on this ?

    J 1 Reply Last reply 7 Feb 2021, 08:41
    0
    • C Online
      C Online
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on 7 Feb 2021, 08:40 last edited by
      #2

      @RahibeMeryem said in Release Mode Crashing but Debug with Debug mode working ? Why:

      What will be the problem ?

      Your program contains an error.

      Compile in release with debug info and debug this. Or add some debug output.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      0
      • R RahibeMeryem
        6 Feb 2021, 21:26

        Hi,

        I have AI models ncnn / mnn etc. It is crashing Release mode.

        But same project working at Debug mode in QtCreator.

        What will be the problem ?

        I try to run Release mode with clean env same result.

        any experince on this ?

        J Offline
        J Offline
        JonB
        wrote on 7 Feb 2021, 08:41 last edited by
        #3

        @RahibeMeryem said in Release Mode Crashing but Debug with Debug mode working ? Why:

        any experince on this ?

        Of course! Hundreds of programs/pieces of code can behave differently in Release vs Debug mode, largely because of different values in uninitialized memory if your code incorrectly accesses outside of allocated memory, which is often the cause.

        Run Release mode code from Creator's Debug run button. When it "crashes" look at the stack view window to see what you can glean.

        If you really cannot discover anything about the fault in Release-only build, you can resort to judicious placing of qDebug() statements instead.

        1 Reply Last reply
        1
        • G Offline
          G Offline
          gde23
          wrote on 7 Feb 2021, 14:15 last edited by
          #4

          The most probable reason (at least from my experience) is that you are writing over the end of some array/vector.
          One way to find where exactly the error comes from is to comment out parts of the code and see if you can get it to work that way.
          Also you can e.g. use valgrind to find memory issues (or similar programs if you are on windows)

          1 Reply Last reply
          0
          • S Offline
            S Offline
            SGaist
            Lifetime Qt Champion
            wrote on 7 Feb 2021, 17:58 last edited by
            #5

            Hi,

            The usual suspect in that kind of case is: uninitialised pointers. Check them all.

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            1

            1/5

            6 Feb 2021, 21:26

            • Login

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