SOLVED - Release Code malfunctioning vs Debug Code

Started by
14 comments, last by antareus 18 years, 9 months ago
I wrote a chess engine in VS 2005 .NET beta 2 I can run Debug and Release mode from within the IDE, and Debug from outside. However, in the middle of my Release mode program ran from outside, an error comes up. I was wondering if this is due to optimizations? It is really difficult to track this bug, since it only shows up in Release Mode. Anyone have any ideas? [Edited by - Sagar_Indurkhya on July 17, 2005 2:04:59 PM]
Advertisement
i once had that problem because debug mode initialized variables for me, while release mode didn't.
Check for buffer overflows, and compile under /W4 and either fix every warning or make sure that you know why you're ignoring the warning.
Your best bet is to implement some sort of logging system to detect where abouts the error might be occurring.

There's a good chance that you might just be using a variable without having initialized it first though. Hope your code isn't too long ;P

This is why it's good to build a release version every once in a while just to make sure everything's still okay.

Happy hunting =D

Edit: Bugger, always too slow.
Quote:Original post by Sagar_Indurkhya
I wrote a chess engine in VS 2005 .NET beta 2

I can run Debug and Release mode from within the IDE, and Debug from outside. However, in the middle of my Release mode program ran from outside, an error comes up. I was wondering if this is due to optimizations?

It is really difficult to track this bug, since it only shows up in Release Mode.

Anyone have any ideas?


Can you use (temporary) message boxes to pop up values for you?

// variable "int x" is giving you problems?char problemString[500];sprintf(problemString,"Value of variable x = %d",x);MessageBox(0,problemString,"HI", MB_OK);

my_life:          nop          jmp my_life
[ Keep track of your TDD cycle using "The Death Star" ] [ Verge Video Editor Support Forums ] [ Principles of Verg-o-nomics ] [ "t00t-orials" ]
Thanks guys, I think that is the problem. I remember that under W4, these overly obsessive warnings came along, and I was like, I don't need those. Guess I paid for my actions.
Quote:Original post by Sagar_Indurkhya
Thanks guys, I think that is the problem. I remember that under W4, these overly obsessive warnings came along, and I was like, I don't need those. Guess I paid for my actions.


Why is it that people always react like that to warnings? I always crank the warning level up as high as possible and always strive to have a clean build, it's a bit of work at first but you'll soon get better habits and the code base is healtier from it and it has the added benefit of other people not having to get worried over all those warnings produced by your code if someone else ever tries to use it.
HardDrop - hard link shell extension."Tread softly because you tread on my dreams" - Yeats
Quote:Original post by DigitalDelusion
I always crank the warning level up as high as possible and always strive to have a clean build....

Here's a fun exercise; try compiling your code under gcc with: -Wall -ansi -pedantic -Weffc++ -Wabi -Wold-style-cast
I have a question:

In my class, I have a member like this:

bool *WhiteSafeMap;

which in my constructor, I initialize like this:

WhiteSafeMap = new bool[64];

now when I was going through in debug mode, it was automatically initialized to all true values. Will the same thing happen in release mode?

[Edited by - Sagar_Indurkhya on July 17, 2005 10:13:03 AM]
Does anyone know if there is a list by Microsoft on the things that debug mode does for you, and Release mode doesn't?

This topic is closed to new replies.

Advertisement