Qt World Summit: Submit your Presentation

Debug and release run mode strange behavior same code?

  • Hi

    I am using openblas math library for face detection.
    I am changing my laptop to lenovo73 .

    My simple detection code is working when run with the debug button and marking faces.

    Hovewer whi in release mode its working without error and I can see the video on the gui but no detection.

    What could be the difference ?

  • Moderators

    @RahibeMeryem said in Debug and release run mode strange behavior same code?:

    What could be the difference ?

    Maybe you're using memory after it was free'd or going past array boundaries. If that's the case, you will get a crash in release mode, eventually.

    Run your application in valgrind, or with address sanitizer - they will tell you whether you have memory leaks and exactly where they are.

  • @RahibeMeryem Release and debug gives different behaviours might due to the compiler optimization, default initialize value of variable...It is hard to know the reason without code.

    But the problem is you are testing the same app in different environments and with the different input.
    So I think you should replace the input from the camera to video, which you can use QMediaRecorder stream the video when the app(debug) can correctly detect the face, then using the same video to test the release version.

  • @sierdzio @arkceajin

    I am using same video same app.

    When I click debug button its working and detecting faces.

    But in release mode its working showing the video but not detecting faces.

    is any library missing due to environment shouldt it give an error ?

  • Lifetime Qt Champion


    As @sierdzio suggested, did you check all your membre variables initialisation ?

Log in to reply