<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Rant ^ 3 (Debug vs Release)</title>
	<atom:link href="http://www.gameproducer.net/2009/06/12/rant-3-debug-vs-release/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.gameproducer.net/2009/06/12/rant-3-debug-vs-release/</link>
	<description>I bake games. Indie style.</description>
	<lastBuildDate>Wed, 12 Jun 2013 15:09:19 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Lumooja</title>
		<link>http://www.gameproducer.net/2009/06/12/rant-3-debug-vs-release/comment-page-1/#comment-135142</link>
		<dc:creator>Lumooja</dc:creator>
		<pubDate>Mon, 15 Jun 2009 10:47:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.gameproducer.net/?p=3133#comment-135142</guid>
		<description>The only difference between Debug and Release mode in BlitzMax I am aware of is that BlitzMax calculates Floats with different accuracy in Debug and Release mode.
To fix this bug, don&#039;t use Floats, but Doubles (remember to put each constant number also as double, for example 9:Double, or 12.0:Double). They are also faster, as my various tests have shown.</description>
		<content:encoded><![CDATA[<p>The only difference between Debug and Release mode in BlitzMax I am aware of is that BlitzMax calculates Floats with different accuracy in Debug and Release mode.<br />
To fix this bug, don&#8217;t use Floats, but Doubles (remember to put each constant number also as double, for example 9:Double, or 12.0:Double). They are also faster, as my various tests have shown.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ASk</title>
		<link>http://www.gameproducer.net/2009/06/12/rant-3-debug-vs-release/comment-page-1/#comment-135134</link>
		<dc:creator>ASk</dc:creator>
		<pubDate>Sun, 14 Jun 2009 16:36:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.gameproducer.net/?p=3133#comment-135134</guid>
		<description>Seriously, any programmer who&#039;s worth something has to know how to debug code running in release mode. Whether that means reading -O3 assembly dumps or using printfs to their full capacity (beware of stack layout changes!) - one should do it.


Regardless, if your code works in debug mode but not in release mode, first, try to build in release mode without optimizations, and if it works then, somebody is playing not nice with memory, and that somebody is you.

Since you are on Windows, your only real option is CrtMemoryDebug or BoundsChecker.</description>
		<content:encoded><![CDATA[<p>Seriously, any programmer who&#8217;s worth something has to know how to debug code running in release mode. Whether that means reading -O3 assembly dumps or using printfs to their full capacity (beware of stack layout changes!) &#8211; one should do it.</p>
<p>Regardless, if your code works in debug mode but not in release mode, first, try to build in release mode without optimizations, and if it works then, somebody is playing not nice with memory, and that somebody is you.</p>
<p>Since you are on Windows, your only real option is CrtMemoryDebug or BoundsChecker.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ovogame</title>
		<link>http://www.gameproducer.net/2009/06/12/rant-3-debug-vs-release/comment-page-1/#comment-135133</link>
		<dc:creator>Ovogame</dc:creator>
		<pubDate>Sat, 13 Jun 2009 20:16:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.gameproducer.net/?p=3133#comment-135133</guid>
		<description>FYI, in release the machine code is optimize big time. This is why the code is completely different from the debug version. Like everybody said, it is 95% a certainty that you are doing something bad with memory. It could range from unitializade variable (debug set the memory to zero, release don&#039;t) to writing out of bounds. I&#039;m surprised you never seen this kind of problems before, it&#039;s pretty commun.

BTW, once (about 10 years ago) I had a bug in release mode that I couldn&#039;t identify in debug. Surprisingly it was the compiler (MSDEV) that was just creating bugged code in release. I was very lucky that it was happening in a very simple and short function, I was able to track it down in asm code. That was really surprising and scary... but it only happen once in 25 years programming.

JC</description>
		<content:encoded><![CDATA[<p>FYI, in release the machine code is optimize big time. This is why the code is completely different from the debug version. Like everybody said, it is 95% a certainty that you are doing something bad with memory. It could range from unitializade variable (debug set the memory to zero, release don&#8217;t) to writing out of bounds. I&#8217;m surprised you never seen this kind of problems before, it&#8217;s pretty commun.</p>
<p>BTW, once (about 10 years ago) I had a bug in release mode that I couldn&#8217;t identify in debug. Surprisingly it was the compiler (MSDEV) that was just creating bugged code in release. I was very lucky that it was happening in a very simple and short function, I was able to track it down in asm code. That was really surprising and scary&#8230; but it only happen once in 25 years programming.</p>
<p>JC</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anonymous</title>
		<link>http://www.gameproducer.net/2009/06/12/rant-3-debug-vs-release/comment-page-1/#comment-135128</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Fri, 12 Jun 2009 21:08:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.gameproducer.net/?p=3133#comment-135128</guid>
		<description>hi,

not so long ago i had your problem with a HUGE game (about 40 projects in visual studio, each project a considerable amount of code).
No warnings, no errors. Game just crashed  or worked weird in release and perfect in debug.
The biggest part of the problem is to identify the source.
From experience i can tell you that visual studio is somewhat more permissive with what it lets you to do with the memory in debug. For ex
in debug u can do this: memcpy(dest, source, size_of_source+1).
And it won&#039;t crash in debug. EVER :)
In release it will crash from time to time, depending where source+1 memory points at :).
So check your memory operations. 
If you use multithreading use one of intel&#039;s tool to find problems (i believe that this is not the case with your problem ). Most defenetly something that you do with the memory is bad :). That is my view about it at this moment now.</description>
		<content:encoded><![CDATA[<p>hi,</p>
<p>not so long ago i had your problem with a HUGE game (about 40 projects in visual studio, each project a considerable amount of code).<br />
No warnings, no errors. Game just crashed  or worked weird in release and perfect in debug.<br />
The biggest part of the problem is to identify the source.<br />
From experience i can tell you that visual studio is somewhat more permissive with what it lets you to do with the memory in debug. For ex<br />
in debug u can do this: memcpy(dest, source, size_of_source+1).<br />
And it won&#8217;t crash in debug. EVER :)<br />
In release it will crash from time to time, depending where source+1 memory points at :).<br />
So check your memory operations.<br />
If you use multithreading use one of intel&#8217;s tool to find problems (i believe that this is not the case with your problem ). Most defenetly something that you do with the memory is bad :). That is my view about it at this moment now.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jake Birkett</title>
		<link>http://www.gameproducer.net/2009/06/12/rant-3-debug-vs-release/comment-page-1/#comment-135124</link>
		<dc:creator>Jake Birkett</dc:creator>
		<pubDate>Fri, 12 Jun 2009 18:40:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.gameproducer.net/?p=3133#comment-135124</guid>
		<description>Can you get the source for the module and compile that with Print commands in it instead? (it&#039;s what I do with my framework, which is not a module yet)</description>
		<content:encoded><![CDATA[<p>Can you get the source for the module and compile that with Print commands in it instead? (it&#8217;s what I do with my framework, which is not a module yet)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Juuso</title>
		<link>http://www.gameproducer.net/2009/06/12/rant-3-debug-vs-release/comment-page-1/#comment-135123</link>
		<dc:creator>Juuso</dc:creator>
		<pubDate>Fri, 12 Jun 2009 17:51:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.gameproducer.net/?p=3133#comment-135123</guid>
		<description>Printf... (of course one problem with this is the fact that collision stuff also happens &quot;inside&quot; Leadwerks modules, so I have to do trial/error for various parts in my code).

@Marco: and to add... naturally I do stuff in chunks... but I always have tested only &quot;does it work without errors/warnings in debug mode&quot;. I guess that needs to change too...</description>
		<content:encoded><![CDATA[<p>Printf&#8230; (of course one problem with this is the fact that collision stuff also happens &#8220;inside&#8221; Leadwerks modules, so I have to do trial/error for various parts in my code).</p>
<p>@Marco: and to add&#8230; naturally I do stuff in chunks&#8230; but I always have tested only &#8220;does it work without errors/warnings in debug mode&#8221;. I guess that needs to change too&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Juuso</title>
		<link>http://www.gameproducer.net/2009/06/12/rant-3-debug-vs-release/comment-page-1/#comment-135122</link>
		<dc:creator>Juuso</dc:creator>
		<pubDate>Fri, 12 Jun 2009 17:49:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.gameproducer.net/?p=3133#comment-135122</guid>
		<description>Thanks guys for the support. Psycho&#039;s statement was especially inspiring: &quot;Let us know where the problem was. So we can laugh too… ;)&quot; 

:D

@Marco: To be honest, I had never known that debug &amp; release modes would work differently. (Oddly enough, I&#039;ve been doing debug/releases for like half a decade and had never heard anyone having problem like this)

Btw - I have no threads.

(And btw II, I&#039;m using Leadwerks with BlitzMax / Blide)</description>
		<content:encoded><![CDATA[<p>Thanks guys for the support. Psycho&#8217;s statement was especially inspiring: &#8220;Let us know where the problem was. So we can laugh too… ;)&#8221; </p>
<p>:D</p>
<p>@Marco: To be honest, I had never known that debug &#038; release modes would work differently. (Oddly enough, I&#8217;ve been doing debug/releases for like half a decade and had never heard anyone having problem like this)</p>
<p>Btw &#8211; I have no threads.</p>
<p>(And btw II, I&#8217;m using Leadwerks with BlitzMax / Blide)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Val</title>
		<link>http://www.gameproducer.net/2009/06/12/rant-3-debug-vs-release/comment-page-1/#comment-135121</link>
		<dc:creator>Val</dc:creator>
		<pubDate>Fri, 12 Jun 2009 16:55:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.gameproducer.net/?p=3133#comment-135121</guid>
		<description>long live printf debugging!</description>
		<content:encoded><![CDATA[<p>long live printf debugging!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brian 'Psychochild' Green</title>
		<link>http://www.gameproducer.net/2009/06/12/rant-3-debug-vs-release/comment-page-1/#comment-135117</link>
		<dc:creator>Brian 'Psychochild' Green</dc:creator>
		<pubDate>Fri, 12 Jun 2009 09:55:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.gameproducer.net/?p=3133#comment-135117</guid>
		<description>The way to find this type of problem is to go old-school: &quot;printf debugging&quot;.  It&#039;s ugly, but it often works to narrow down the problem.  Go to your collision code and have it spit out values relating to collision.  Figure out where your bad values are, then trace back to the source of the problem.  It&#039;ll probably be an uninitialized variable or out-of-bounds array reference.

If adding print statements seems to fix the problem, then you probably have a timing or threading issue, as people have mentioned above.

Hope that helps.  Sometimes the ugly method works. :)</description>
		<content:encoded><![CDATA[<p>The way to find this type of problem is to go old-school: &#8220;printf debugging&#8221;.  It&#8217;s ugly, but it often works to narrow down the problem.  Go to your collision code and have it spit out values relating to collision.  Figure out where your bad values are, then trace back to the source of the problem.  It&#8217;ll probably be an uninitialized variable or out-of-bounds array reference.</p>
<p>If adding print statements seems to fix the problem, then you probably have a timing or threading issue, as people have mentioned above.</p>
<p>Hope that helps.  Sometimes the ugly method works. :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: psycho</title>
		<link>http://www.gameproducer.net/2009/06/12/rant-3-debug-vs-release/comment-page-1/#comment-135115</link>
		<dc:creator>psycho</dc:creator>
		<pubDate>Fri, 12 Jun 2009 09:40:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.gameproducer.net/?p=3133#comment-135115</guid>
		<description>Unitialized variable, obviously.

The good news is that it always comes out, however hopeless you may feel.
I&#039;ve been through hundreds of these situations, but never it has remained hidden when I tried hard to find it.

Let us know where the problem was. So we can laugh too... ;)</description>
		<content:encoded><![CDATA[<p>Unitialized variable, obviously.</p>
<p>The good news is that it always comes out, however hopeless you may feel.<br />
I&#8217;ve been through hundreds of these situations, but never it has remained hidden when I tried hard to find it.</p>
<p>Let us know where the problem was. So we can laugh too&#8230; ;)</p>
]]></content:encoded>
	</item>
</channel>
</rss>
