Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct


    Qt World Summit: Early-Bird Tickets

    Unsolved Release Mode Crashing but Debug with Debug mode working ? Why

    General and Desktop
    5
    5
    103
    Loading More Posts
    • 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
      RahibeMeryem last edited by

      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 ?

      JonB 1 Reply Last reply Reply Quote 0
      • Christian Ehrlicher
        Christian Ehrlicher Lifetime Qt Champion last edited by

        @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 has to stay free or it will die.

        1 Reply Last reply Reply Quote 0
        • JonB
          JonB @RahibeMeryem last edited by

          @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 Reply Quote 1
          • gde23
            gde23 last edited by

            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 Reply Quote 0
            • SGaist
              SGaist Lifetime Qt Champion last edited by

              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 Reply Quote 1
              • First post
                Last post