title: After buf = malloc(1) with full page heap, why is the guard page exception not thrown until buf[16] is being overwritten?
body: <ol>
  <li><p>Code in a bug</p>
  
  <pre><code>int main()
  {
      void *ptr = 0;    
      int overrun = 1;
      ptr = malloc(overrun);
      while(overrun++)
      {
          if(!ptr)
              while(1) Sleep(500);
          *((char*)ptr + (overrun+1)) = 'a';
          printf("\n%d\n",overrun);
      }
      return 0;
  }
  </code></pre></li>
  <li><p>From project menu of visual studio 2010 made sure the build is "Release" and "x64" (machine is x64)</p></li>
  <li><p>Enable FULL PAGE HEAP</p>
  
  <pre><code>gflags /p /enable test.exe /full
  </code></pre></li>
  <li><p>Make windbg default debugger</p>
  
  <pre><code>E:\installed\Debugging Tools for Windows (x64)&gt;windbg -I
  </code></pre></li>
  <li><p>Run the code as separate exe from <code>cmd</code> without debugger</p>
  
  <p>Output:</p>
  
  <pre><code>2
  3
  4
  5
  6
  7
  8
  9
  10
  11
  12
  13
  14
  </code></pre>
  
  <p>after which windbg is seen catching the corruption. And I thought full page heap is suppose to catch corruptions instantly.</p>
  
  <p>Any comments as to why full page heap sucks?</p></li>
  </ol>