<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Why doesn't HeapValidate detect corruption in the managed heap?</title><link>http://blogs.msdn.com/b/oldnewthing/archive/2013/01/30/10389330.aspx</link><description>Understanding limits in context.</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>re: Why doesn't HeapValidate detect corruption in the managed heap?</title><link>http://blogs.msdn.com/b/oldnewthing/archive/2013/01/30/10389330.aspx#10390998</link><pubDate>Mon, 04 Feb 2013 20:24:04 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10390998</guid><dc:creator>640k</dc:creator><description>&lt;p&gt;Everyone that doesn&amp;#39;t understand that this is a .NET issue, raise your hand.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10390998" width="1" height="1"&gt;</description></item><item><title>re: Why doesn't HeapValidate detect corruption in the managed heap?</title><link>http://blogs.msdn.com/b/oldnewthing/archive/2013/01/30/10389330.aspx#10390102</link><pubDate>Thu, 31 Jan 2013 23:16:27 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10390102</guid><dc:creator>Silly</dc:creator><description>&lt;p&gt;@ErikF. From what I now understand (after taking off my unmanaged glasses), is the original question is more like &amp;quot;My SQL database is showing corruption, but Oracle shows no problems! Why?&amp;quot;&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10390102" width="1" height="1"&gt;</description></item><item><title>re: Why doesn't HeapValidate detect corruption in the managed heap?</title><link>http://blogs.msdn.com/b/oldnewthing/archive/2013/01/30/10389330.aspx#10390093</link><pubDate>Thu, 31 Jan 2013 22:45:34 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10390093</guid><dc:creator>ErikF</dc:creator><description>&lt;p&gt;@Smitty: The original question, as asked, was similar to &amp;quot;My SQL database is showing corruption, but fsck shows no problems! Why?&amp;quot;&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10390093" width="1" height="1"&gt;</description></item><item><title>re: Why doesn't HeapValidate detect corruption in the managed heap?</title><link>http://blogs.msdn.com/b/oldnewthing/archive/2013/01/30/10389330.aspx#10389982</link><pubDate>Thu, 31 Jan 2013 16:35:26 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10389982</guid><dc:creator>ChrisR</dc:creator><description>&lt;p&gt;@Smitty: &amp;nbsp;I guess you missed the part where Raymond wrote that the customer misused a P/Invoke to corrupt the managed heap themselves.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10389982" width="1" height="1"&gt;</description></item><item><title>re: Why doesn't HeapValidate detect corruption in the managed heap?</title><link>http://blogs.msdn.com/b/oldnewthing/archive/2013/01/30/10389330.aspx#10389978</link><pubDate>Thu, 31 Jan 2013 16:26:04 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10389978</guid><dc:creator>Smitty</dc:creator><description>&lt;p&gt;@ChrisR: &amp;nbsp;If the -NET runtime uses the heap, it should know how to use it correctly. &amp;nbsp;I agree totally with @HiTechHiTouch, this issue hasn&amp;#39;t really been addressed by Raymond, and in fact smacks a little of the elitism, or snobbery that I expect to find on a Solaris forum.&lt;/p&gt;
&lt;div class="post"&gt;[&lt;em&gt;The point is that the .NET runtime &lt;span style="text-decoration:underline;"&gt;doesn&amp;#39;t use the heap&lt;/span&gt; (or more precisely, does not use a heap created by &lt;code&gt;Heap&amp;shy;Create&lt;/code&gt;), so using a tool for debugging corruption in heaps created by &lt;code&gt;Heap&amp;shy;Create&lt;/code&gt; is useless if the corruption is not in a heap created by &lt;code&gt;Heap&amp;shy;Create&lt;/code&gt;. -Raymond&lt;/em&gt;]&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10389978" width="1" height="1"&gt;</description></item><item><title>re: Why doesn't HeapValidate detect corruption in the managed heap?</title><link>http://blogs.msdn.com/b/oldnewthing/archive/2013/01/30/10389330.aspx#10389746</link><pubDate>Thu, 31 Jan 2013 02:11:36 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10389746</guid><dc:creator>Matt</dc:creator><description>&lt;p&gt;@Mike: &amp;quot;The halting problem is totally solvable given deterministic transitions and non infinite memory&amp;quot;.&lt;/p&gt;
&lt;p&gt;Sure. Using an algorithm provably not faster than O(2^n) where n is the number of bits of memory.&lt;/p&gt;
&lt;p&gt;You don&amp;#39;t need a very big N before the difference between &amp;quot;takes O(2^N) operations&amp;quot; and &amp;quot;takes infinite time&amp;quot; is just a matter of academic semantics.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10389746" width="1" height="1"&gt;</description></item><item><title>re: Why doesn't HeapValidate detect corruption in the managed heap?</title><link>http://blogs.msdn.com/b/oldnewthing/archive/2013/01/30/10389330.aspx#10389679</link><pubDate>Wed, 30 Jan 2013 22:39:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10389679</guid><dc:creator>ChrisR</dc:creator><description>&lt;p&gt;@HiTechHiTouch: &amp;nbsp;The customer is a programmer, presumably professional. &amp;nbsp;It&amp;#39;s reasonable to expect them to understand that the .NET runtime may or may not use the heap that GFlags can set options for. &amp;nbsp;It isn&amp;#39;t necessarily a case of kernel-colored glasses for GFlags; in fact I&amp;#39;d say it&amp;#39;s more likely a lazy and/or ignorant programmer asking the question.&lt;/p&gt;
&lt;p&gt;Or would you suggest that text be added to the GFlags documentation listing all the different heaps that it can&amp;#39;t help debug?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10389679" width="1" height="1"&gt;</description></item><item><title>re: Why doesn't HeapValidate detect corruption in the managed heap?</title><link>http://blogs.msdn.com/b/oldnewthing/archive/2013/01/30/10389330.aspx#10389672</link><pubDate>Wed, 30 Jan 2013 22:14:38 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10389672</guid><dc:creator>Mike</dc:creator><description>&lt;p&gt;Althought the halting problem is totally solvable given deterministic transitions (which we presumably have) and non infinite memory (which unless MS Research are punching above their weight we can also assume).&lt;/p&gt;
&lt;p&gt;Just sayin&amp;#39;&lt;/p&gt;
&lt;p&gt;Sorry.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10389672" width="1" height="1"&gt;</description></item><item><title>re: Why doesn't HeapValidate detect corruption in the managed heap?</title><link>http://blogs.msdn.com/b/oldnewthing/archive/2013/01/30/10389330.aspx#10389670</link><pubDate>Wed, 30 Jan 2013 22:08:42 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10389670</guid><dc:creator>HiTechHiTouch</dc:creator><description>&lt;p&gt;I&amp;#39;m confused.&lt;/p&gt;
&lt;p&gt;The problem statement said &amp;quot;managed heap&amp;quot; and &amp;quot;CLR&amp;quot;. &amp;nbsp;I immediately assumed that the customer was talking about .NET and that the heap was being created/used by the language environment. &amp;nbsp;Since this comes from Microsoft, one might think the MS debug tools would assist with this problem.&lt;/p&gt;
&lt;p&gt;What I think must be happening is that there is a Kernel provided heap (debugged with GFlags settings), which is not the same heap provided by .NET/runtime. &amp;nbsp;This would make the problem be one of &amp;quot;kernel colored glasses&amp;quot;. (Follow-up: why doesn&amp;#39;t .NET/rt use a kernel created heap?)&lt;/p&gt;
&lt;p&gt;A useful response would be information about debugging the runtime heap provided/used by .NET and the language environment.&lt;/p&gt;
&lt;p&gt;Nowhere in the problem statement did the customer say they were doing an explicit VirualAlloc and carving sub-allocations, i.e. using a custom heap implementation. &amp;nbsp;Thus most of Raymond&amp;#39;s comments, while true, seem mis-addressed.&lt;/p&gt;
&lt;div class="post"&gt;[&lt;em&gt;The CLR is one example of a custom heap implementation that calls VirtualAlloc and carves out sub-allocations. (This should be obvious since the CLR uses a moving GC.) The customer was using a tool designed for HeapCreate heaps and expecting it to work for non-HeapCreate heaps. -Raymond&lt;/em&gt;]&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10389670" width="1" height="1"&gt;</description></item><item><title>re: Why doesn't HeapValidate detect corruption in the managed heap?</title><link>http://blogs.msdn.com/b/oldnewthing/archive/2013/01/30/10389330.aspx#10389650</link><pubDate>Wed, 30 Jan 2013 21:26:08 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10389650</guid><dc:creator>JDP</dc:creator><description>&lt;p&gt;As explained in the very next sentence!&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10389650" width="1" height="1"&gt;</description></item></channel></rss>