[Solved] Application does not crash when required to!
-
wrote on 22 Apr 2013, 10:18 last edited by
Hi,
I am having serious problems with my application developed with Qt 4.8.1 on Win7 64 bit M/c with the default MinGw 32 bit compiler.
When I run in Debug or Release mode the application does not crash for obvious bugs (one nasty one was when I was delete ing an array even though its memory was not allocated).
I have observed that at random it shows me bugs for code which I had developed a month ago. When I solve that bug then it shows bug for much older code.
I think Qt somehow corrects the bugs internally with its MOC but that's irritating me because the application only shows the most recent bugs & only when those bugs are solved it shows much older bugs than that. Hence I have to revisit the code of which I dont remember much.
So I wanted to ask whether there was any option/flag which when specified the Application would run very strictly & crash at the smallest of bug.I am irritated because I done know how many bugs are hiding behind the many months of work that I have done on my Application.
Thank You. -
wrote on 22 Apr 2013, 10:44 last edited by
Qt definitely does not solve any bugs automatically...although that would be a phenomenal feature! ;)
If you're new to development, it often happens that fixing a bug uncovers other issues you were unaware of or even introduces new ones. That's the whole point of regression testing.
Without code to review, there isn't much more to say. However, please remember that there are many instances where errors in C++ code cause undefined behaviour. Although this often results in the application crashing, it doesn't always (hence the undefined).
You could set your compiler warning flag to its highest possible setting. That will not expose flaws in your logic, but is useful in finding uninitialised variables, etc (often the cause of weird behaviour).
-
Switching to clang can also increase the amount of useful warnings you will get.
In the end, though, just like goblincoding said - most probably the errors were there all the time, only you are uncovering them one by one as you fix other stuff. That happens :) The prose of coding life. Using unit/ regression testing and taking care to write solid code are the way to go.
1/3