celu
11-11-2007, 09:27 AM
Hi..Im working on c++ in VS 2005.Both the debug and release build of my ray tracer was working fine until a couple of days back when I added a scene parser to the project.Now in debug mode the scenes are parsed fine and the image is rendered properly.But in release mode the program just crashes.Error Logs from the release build show that my newly added parser module was behaving wierdly.
I printed out a for loop variable from my parser module,
/* Tested Code */
for(int i=0;i < 100;i++)
{
/* Some code */
printf("%d",i);
/* Some code */
}
/* Output from Error Log */
In Debug mode, the output is fine
0
1
2
3
4
.
.
.
99
and in Release mode, I get wierd results
0
0
0
0
0
.
.
and the loop does not compete 100 itreations??!!
////////////////////////////////////
Then I found that,
- changing my release build configuration 'Basic Runtime Check' value from 'default' to 'both' (/RTC1, equiv. to /RTCsu).
- and changing the release build configuration 'Optimization' value from 'Maximize Speed' (/O2) to 'Disabled'(/Od).
made my release build to work fine just like my debug build.But it's very slow! :(
What are the possible things that I should check in my code to solve this problem?
why does turning off 'Basic Runtime Check' and enabling 'Maximize Speed' optimization make my release build crash?
Im really blinded by this problem...Pls Help!!
celu.
I printed out a for loop variable from my parser module,
/* Tested Code */
for(int i=0;i < 100;i++)
{
/* Some code */
printf("%d",i);
/* Some code */
}
/* Output from Error Log */
In Debug mode, the output is fine
0
1
2
3
4
.
.
.
99
and in Release mode, I get wierd results
0
0
0
0
0
.
.
and the loop does not compete 100 itreations??!!
////////////////////////////////////
Then I found that,
- changing my release build configuration 'Basic Runtime Check' value from 'default' to 'both' (/RTC1, equiv. to /RTCsu).
- and changing the release build configuration 'Optimization' value from 'Maximize Speed' (/O2) to 'Disabled'(/Od).
made my release build to work fine just like my debug build.But it's very slow! :(
What are the possible things that I should check in my code to solve this problem?
why does turning off 'Basic Runtime Check' and enabling 'Maximize Speed' optimization make my release build crash?
Im really blinded by this problem...Pls Help!!
celu.