Release Mode Crashing but Debug with Debug mode working ? Why
-
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 ?
-
@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.
-
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 ?
@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. -
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) -
Hi,
The usual suspect in that kind of case is: uninitialised pointers. Check them all.