Debug alert in Release? Why? Topic is solved
-
- I live to help wx-kind
- Posts: 192
- Joined: Fri Dec 22, 2006 9:17 am
- Location: Germany
- Contact:
Debug alert in Release? Why?
Hi!
Got back to development with wxWidgets and created a small application i compiled and linked in Release-Version (MSVC10-Compiler and wx 2.93). Got a crash and a wxWidgets-Debug-Alert...why is it called debug-alert in Release-Version?
What could be the mistake? I'm using wx 2.93 and compiled it with the project-files provided in the download.
Thank you very much!!
Got back to development with wxWidgets and created a small application i compiled and linked in Release-Version (MSVC10-Compiler and wx 2.93). Got a crash and a wxWidgets-Debug-Alert...why is it called debug-alert in Release-Version?
What could be the mistake? I'm using wx 2.93 and compiled it with the project-files provided in the download.
Thank you very much!!
Re: Debug alert in Release? Why?
That's a new feature in wx 2.9.x, asserts are enabled in release mode by default. Bad decision IMHO...
If you don't want this, you have to change a setting in setup.h and rebuild wxWidgets.
Change to:
If you don't want this, you have to change a setting in setup.h and rebuild wxWidgets.
Code: Select all
// #ifdef NDEBUG
// #define wxDEBUG_LEVEL 0
// #else
// #define wxDEBUG_LEVEL 2
// #endif
Code: Select all
#ifdef NDEBUG
#define wxDEBUG_LEVEL 0
// #else
// #define wxDEBUG_LEVEL 2
#endif
Last edited by doublemax on Thu Mar 01, 2012 8:56 am, edited 1 time in total.
Use the source, Luke!
Re: Debug alert in Release? Why?
out of curiosity, why do you thing it's bad? It's usually better to be told "You're doing something wrong" than silently failingdoublemax wrote:That's a new feature in wx 2.9.x, asserts are enabled in debug mode by default. Bad decision IMHO...
"Keyboard not detected. Press F1 to continue"
-- Windows
-- Windows
Re: Debug alert in Release? Why?
Not in professional software development. The last thing i need is an error message popping up at a customer, that a) is totally meaningless to the user and b) is harmless in 99% of the cases.out of curiosity, why do you thing it's bad? It's usually better to be told "You're doing something wrong" than silently failing
That's what debug versions are for.
Use the source, Luke!
Re: Debug alert in Release? Why?
i agree with doublemax.
it appears, wxw also stores text strings containing e.g. my full project path.
it appears, wxw also stores text strings containing e.g. my full project path.
-
- I live to help wx-kind
- Posts: 192
- Joined: Fri Dec 22, 2006 9:17 am
- Location: Germany
- Contact:
Re: Debug alert in Release? Why?
Thanks! I totally agree...the Error-Message is not helpful for the customer. But why did they add a debug-error-message in a release-version? I want to make sure it's understood correctly by you. I'm not running a debug-exe, i'm running a release-exe.
Thank you for your answers!
Thank you for your answers!
Re: Debug alert in Release? Why?
When your app is built in release mode they are supposed to be suppressed. If they are not suppressed in release mode, you have a problem. Or maybe you ship debug builds?doublemax wrote:Not in professional software development. The last thing i need is an error message popping up at a customer, that a) is totally meaningless to the user and b) is harmless in 99% of the cases.out of curiosity, why do you thing it's bad? It's usually better to be told "You're doing something wrong" than silently failing
That's what debug versions are for.
"Keyboard not detected. Press F1 to continue"
-- Windows
-- Windows
-
- I live to help wx-kind
- Posts: 192
- Joined: Fri Dec 22, 2006 9:17 am
- Location: Germany
- Contact:
Re: Debug alert in Release? Why?
Hey! I'm sure i've built a release-app and also did not ship debug-builds to the testers.
The exe files are to small for a debug-build...i'm sure it's not a debug-build. Someone is into this problem with wxWidgets 2.93, too ? It's really a debug-error-message that pop ups. Please help...
Thank you!
The exe files are to small for a debug-build...i'm sure it's not a debug-build. Someone is into this problem with wxWidgets 2.93, too ? It's really a debug-error-message that pop ups. Please help...
Thank you!
Re: Debug alert in Release? Why?
It's like i said, since wx 2.9.x assert messages are enabled by default even in release builds. If you want to change this, do what i wrote in my first post.
Use the source, Luke!
Re: Debug alert in Release? Why?
I know that disagreeing with doublemax means I'm very likely wrong , but still ...
I just tried and wxASSERT does not produce any message nor is the expression inside the parenthesis evaluated in the Release mode (wxInfoMessageBox reports debug level = 1). wxWidgets 2.9.4 compiled with MSVC 2008 Express using default settings. I also couldn't find any information about changing the assert behaviour in wxWidgets changelog; in section "Changes in behaviour not resulting in compilation errors" or elsewhere. wxWidgets docs also state that asserts are disabled in release builds.
Are you sure the dialog that pops up is really a result from a failed wxASSERT*/wxFAIL* call? This is easy to verify. Where does it come from - from wxWidgets itself or from your code? Haven't you called wxSetDefaultAssertHandler somewhere? What is your debug level and have you really compiled the release build with NDEBUG defined? Last but not least: do you use WX_IMPLEMENT_APP, if not read here.
I just tried and wxASSERT does not produce any message nor is the expression inside the parenthesis evaluated in the Release mode (wxInfoMessageBox reports debug level = 1). wxWidgets 2.9.4 compiled with MSVC 2008 Express using default settings. I also couldn't find any information about changing the assert behaviour in wxWidgets changelog; in section "Changes in behaviour not resulting in compilation errors" or elsewhere. wxWidgets docs also state that asserts are disabled in release builds.
Are you sure the dialog that pops up is really a result from a failed wxASSERT*/wxFAIL* call? This is easy to verify. Where does it come from - from wxWidgets itself or from your code? Haven't you called wxSetDefaultAssertHandler somewhere? What is your debug level and have you really compiled the release build with NDEBUG defined? Last but not least: do you use WX_IMPLEMENT_APP, if not read here.
Last edited by PB on Wed Feb 29, 2012 4:53 pm, edited 1 time in total.
Re: Debug alert in Release? Why?
Use the source, Luke!
Re: Debug alert in Release? Why?
(emphasis mine)Starting with wxWidgets 2.9.1 debugging features are always available by default (and not only in a special "debug" build of the library) and you need to predefine wxDEBUG_LEVEL symbol as 0 when building both the library and your application to remove them completely from the generated object code. However the debugging features are disabled by default when the application itself is built with NDEBUG defined (i.e. in "release" or "production" mode) so there is no need to do this, unless the resources of the system your application will be running on are unusually constrained (notice that when asserts are disabled their condition is not even evaluated so the only run-time cost is a single condition check and the extra space taken by the asserts in the code).
I just assumed that people (or IDEs by default) do define NDEBUG in their release builds, so while asserts might get compiled in, debug alerts do not jump right into the faces of end users. My bad?
-
- I live to help wx-kind
- Posts: 192
- Joined: Fri Dec 22, 2006 9:17 am
- Location: Germany
- Contact:
Re: Debug alert in Release? Why?
Thank you! The information you provided was very helpful.
Thank you very much for your help! Have a nice evening...
Thank you very much for your help! Have a nice evening...
Re: Debug alert in Release? Why?
I don't think you did say that...doublemax wrote:It's like i said, since wx 2.9.x assert messages are enabled by default even in release builds.
Either I misunderstood (quite probable) or you should edit your first post for claritydoublemax wrote:That's a new feature in wx 2.9.x, asserts are enabled in debug mode by default.
edit: it's fixed now, future readers ignore this post
Last edited by JohnD on Thu Mar 01, 2012 8:59 am, edited 1 time in total.