469,943 Members | 2,712 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,943 developers. It's quick & easy.

Difference in Release & Debug Mode

ss
Hi

I built an exe in console debug mode & Release mode . The console
debug mode -exe works fine ...but the release mode EXE starts well but
fails mid way .

The exe is being started as a service. So I need the Release mode EXE.
I've checked the dlls being used . they are working fine for other
services.

Plz Help.
cheers
Jul 22 '05 #1
6 3616
ss wrote:
I built an exe in console debug mode & Release mode . The console
debug mode -exe works fine ...but the release mode EXE starts well but
fails mid way .

The exe is being started as a service. So I need the Release mode EXE.
I've checked the dlls being used . they are working fine for other
services.


Edit the Release mode settings, and turn on debugging. Rebuild. Tap <F10>.

But you must take future questions about things like these to newsgroups
that cover VC++ or services. Your questions are too hard for this newsgroup!

--
Phlip
http://industrialxp.org/community/bi...UserInterfaces
Jul 22 '05 #2
On Thu, 10 Jun 2004 10:39:59 UTC, "Phlip" <ph*******@yahoo.com> wrote:
ss wrote:
I built an exe in console debug mode & Release mode . The console
debug mode -exe works fine ...but the release mode EXE starts well but
fails mid way .
How does it fail? The appropriate microsoft.* forums will have a few
more people knowledgeable on why this type of problem occurs.
The exe is being started as a service. So I need the Release mode EXE.
I've checked the dlls being used . they are working fine for other
services.

No. You need the Release verson because you can't release the Debug
version. A Debug version can run as a service.
Edit the Release mode settings, and turn on debugging. Rebuild. Tap <F10>.
This will likely cure the symptom, but definitely not the problem.
Your code has some serious problems. It may not appear to fail in the Debug
version, but it may in time.

There are any number of common mistakes programmers make. Turn on all
warnings and recompile all the code. Look for things like uninitialized
data.
There are more 'obscure' possibilities like timing, but its more likely that
you are seeing one of the dozen or so simple programming mistakes.
But you must take future questions about things like these to newsgroups
that cover VC++ or services. Your questions are too hard for this newsgroup!


David
Jul 22 '05 #3
"ss" <sa**********@citigroup.com> wrote :
I built an exe in console debug mode & Release mode . The console
debug mode -exe works fine ...but the release mode EXE starts well but
fails mid way .


Often when debug builds run fine and release builds fail uninitialized
variables are the cause of the problem. Compile at the maximum warning
level; a source code checker like PC lint may also be useful to track down
this problem.

Note that your question is not about the C++ language, so it is not really
topical here. You better ask this question in a group dedicated to the
development tool you are using (which I guess is Microsoft Visual Studio).
See also: http://www.slack.net/~shiva/welcome.txt

--
Peter van Merkerk
peter.van.merkerk(at)dse.nl
Jul 22 '05 #4
David wrote:
No. You need the Release verson because you can't release the Debug
version. A Debug version can run as a service.


And you can add __asm { int 3 }; to invoke a hard breakpoint.
Edit the Release mode settings, and turn on debugging. Rebuild. Tap <F10>.


This will likely cure the symptom, but definitely not the problem.


It won't cure nothing. It will open the debugger and show source
statements, not disassembly. But the opcodes are compiled in release
mode anyway. You can see what line broke, and what its differences
were with debug mode.

--
Phlip
Jul 22 '05 #5
Where does it fail ? You actually need to do
some work to find the location and the cause.
You can try to track down the location by the use
of printf & log files to hone in on the failure spot,
or use message_box() to track down the location
in release mode since the debugger doesn't help much.
Comment out sections of code if you can and see if that
has any effect on the failure.

Common causes of release mode failing :-
( assuming you are using microsoft vc++)

1. ASSERT() statements containing necessary code
statements being optmized/preprocssed out of the
release code. Use VERIFY() instead.

2. Memory is initialized with random patterns in release
mode, this might cause some unpredicted behavior.
Initialize all memory before use.

3. You are using some undefined behavior which behaves
differently in different modes.

4. Mixtures of DLLs for debug/release being used at runtime.
Use the DEPENDS tool to check what dll are being found.
Check the run-time environment when the service is being run
is what you expect it to be.

In years gone by, compiler bugs often were a cause but is
more rare these days, I should assume you have a bug and
not blame the compilers.

dave

"ss" <sa**********@citigroup.com> wrote in message
news:d1**************************@posting.google.c om...
Hi

I built an exe in console debug mode & Release mode . The console
debug mode -exe works fine ...but the release mode EXE starts well but
fails mid way .

The exe is being started as a service. So I need the Release mode EXE.
I've checked the dlls being used . they are working fine for other
services.

Plz Help.
cheers

Jul 22 '05 #6
sa**********@citigroup.com (ss) wrote in message news:<d1**************************@posting.google. com>...
Hi

I built an exe in console debug mode & Release mode . The console
debug mode -exe works fine ...but the release mode EXE starts well but
fails mid way .

The exe is being started as a service. So I need the Release mode EXE.
I've checked the dlls being used . they are working fine for other
services.

Plz Help.


"debug mode"??? "release mode"??? Standard C++ has no such things.

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
To iterate is human, to recurse divine.
-L. Peter Deutsch
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Jul 22 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by codymanix | last post: by
2 posts views Thread by Chris Pielak | last post: by
5 posts views Thread by Jonas Hallgren | last post: by
7 posts views Thread by news.microsoft.com | last post: by
reply views Thread by =?Utf-8?B?SmVmLnB0Yw==?= | last post: by
3 posts views Thread by =?Utf-8?B?bG10dGFn?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.