Re: debugging in release mode
- From: "Bill Brehm" <<don't want any spam>>
- Date: Mon, 5 Jun 2006 18:37:18 +0800
I have no doubt that it's a problem of mine and not of the compiler. My code
is new and relatively untested and the compiler has been tested for many
years. As long as the optimizing compiler is helping my bugs to appear, I
don't mind using it to help me find them. I don't really need optimization
for the sake of memory space or execution speed.
I will try your approach to this new mode. Is there a list anywhere that
shows the differences between the default debug mode and the default release
mode? The three things I am familiar with are debug info, optimization and
TRACE statements. I used to think that debug information was stored in the
executable and so the release mode was required send an executable without
source code inside. That misconception was corrected when i learned that
that the debug is stored in a separate (.pdb, I think) file.
I am not using threads on purpose. But there is a frame grabber hardware and
software library that is included in my project and I believe it is using a
thread to alert me when an image has been captured. But it does not use MFC
and the most I will do from inside the alert is invalidate a rectangle on
the dialog application to update an image.
I have found that one source of crash is when UpdateWindow() is called from
inside an OnTimer() call. It doesn't crash the first few times. But when it
does crash, I see the this pointer for the main dialog of the dialog
application has changed from a sensible value to 0x401.
Thanks,
Bill
"Joseph M. Newcomer" <newcomer@xxxxxxxxxxxx> wrote in message
news:eql082t9hv8gq8smh6hp7jhv8kdcbvohul@xxxxxxxxxx
See my essay on suriving the release version, on my MVP Tips site. 99% of
the time what
you are seeing are errors in your own code that got masked by the
unoptimized code of a
debug build; the code was always wrong, but the damage it did was
harmless. It has been
many years since I've seen a genuine optimizer bug in a Microsoft
compiler, although it is
always a remote possibility.
Don't create a new configuration from debug mode; create it from a release
configuration
and then turn off optimizations and turn on generation of debug
information (you can't use
compile-and-go option here). Note that if you don't see the bug, it can
also indicate
that errors in your program are again being masked by having no
optimizations.
Are you using threads? There are lots of bugs that can show up on
multithreaded optimized
code that don't show up in multithreaded debug code, because the optimizer
makes
single-thread assumptions which you can violate.
joe
On Fri, 2 Jun 2006 15:51:53 +0800, "Bill Brehm" <<don't want any spam>>
wrote:
I have a program that runs well in debug mode. when i switch to releaseJoseph M. Newcomer [MVP]
mode
i get access violations. but of course i am thrown into a disassembly view
that tells me almost nothing about where the problem is. I guess it has to
do with optimization and how my code interacts with that. I would like
some
tips on how to find and fix this type of problem.
As a test, I created a new mode and copied from debug mode and then went
in
and switched off debug information in the compiler and linker. what else
would i have to switch off to protect the executable from containing
anything of the source code that the end customer should not be seeing? If
i
can't solve the problem in release mode, i'm thinking that the
optimizations
are really not that important to me.
thanks...
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.
- Follow-Ups:
- Re: debugging in release mode
- From: Joseph M . Newcomer
- Re: debugging in release mode
- References:
- debugging in release mode
- From: Bill Brehm
- Re: debugging in release mode
- From: Joseph M . Newcomer
- debugging in release mode
- Prev by Date: how child window can fire user defined function of parent window.
- Next by Date: Re: how child window can fire user defined function of parent window.
- Previous by thread: Re: debugging in release mode
- Next by thread: Re: debugging in release mode
- Index(es):
Relevant Pages
|