title: How to fix "A debugging check in this application failed" codeblocks?
body: <p>I was working on a project in Codeblocks, but at one point when I wanted to Run it, the Debug window just remained empty.I thought that it was just an infinite thing, but while I was looking at it, it showed <a href="https://i.stack.imgur.com/n4DM1.png" rel="nofollow noreferrer">this</a>, sayng that &quot;A debugging check in this application failed&quot;.If I pressed &quot;Continue&quot; it would let me go and it would give me the result, but when I tried to debug the code, it said the same thing, and afterwards it wouldn't let me debug.
  Here is the code:</p>
  <pre><code>#include &lt;fstream&gt;
  using namespace std;
  ifstream fin(&quot;forta.in&quot;);
  ofstream fout(&quot;forta.out&quot;);
  int main()
  {
      int p,n,maxx=0;
      long long x,minn=2000000000;
      fin&gt;&gt;p&gt;&gt;n;
      if(p==1)
      {
          for(int i=0; i&lt;n; i++)
          {
              fin&gt;&gt;x;
              long long divt=1,p,cx=x,m=0;
              long long frp[x+1], prim[x+1];
              frp[0]=0;
              frp[1]=0;
              for(int i=2; i&lt;=x; i++)
                  frp[i]=1;
              for(int i=2; i&lt;=x; i++)
              {
                  if(frp[i]==1)
                  {
                      prim[m++] =i; ///stochez nr prime
                      for(int j=i+i; j&lt;=x; j=j+i)
                          frp[j]=0;
                  }
              }
              for(int i=0; i&lt;m ; i++) ///  sirul de nr prime
              {
                  p=0;
  
                  while(x%prim[i]==0)
                  {
                      p++;
                      x=x/prim[i];
                  }
                  divt=divt*(p+1);
  
              }
              if(divt&gt;maxx)
              {
                  maxx=divt;
                  minn=cx;
              }
              else if(divt==maxx)
              {
                  if(cx&lt;minn)
                      minn=cx;
              }
          }
          fout&lt;&lt;minn;
      }
      if(p==2)
      {
          int fr[20000]= {0}, maxx=0;
          for(int i=0; i&lt;n; i++)
          {
              fin&gt;&gt;x;
              long long divt=1,p,cx=x,m=0;
              long long frp[x+1], prim[x+1];
              frp[0]=0;
              frp[1]=0;
              for(int i=2; i&lt;=x; i++)
                  frp[i]=1;
              for(int i=2; i&lt;=x; i++)
              {
                  if(frp[i]==1)
                  {
                      prim[++m] =i; ///stochez nr prime
                      for(int j=i+i; j&lt;=x; j=j+i)
                          frp[j]=0;
                  }
              }
              for(int i=0; i&lt;m ; i++) ///  sirul de nr prime
              {
                  p=0;
  
                  while(x%prim[i]==0)
                  {
                      p++;
                      x=x/prim[i];
                  }
                  divt=divt*(p+1);
  
              }
              fr[divt]++; /// frecventa pe nr de div
              if(maxx&lt;fr[divt])
                  maxx=fr[divt];
          }
          fout&lt;&lt;maxx;
      }
      return 0;
  }
  </code></pre>
  <p>It all goes well until &quot;fout&lt;&lt;minn;&quot;(line 54)
  I wonder what caused that error and how to fix it.</p>
  <p>P.S.
  Here is the debug log:</p>
  <pre><code>    Active debugger config: GDB/CDB debugger:Default
      Building to ensure sources are up-to-date
      Selecting target: 
      Debug
      Adding source dir: C:\Users\Tudor\CodeBlocks\OJI_2020_A6-A_forta\
      Adding source dir: C:\Users\Tudor\CodeBlocks\OJI_2020_A6-A_forta\
      Adding file: C:\Users\Tudor\CodeBlocks\OJI_2020_A6-A_forta\bin\Debug\OJI_2020_A6-A_forta.exe
      Changing directory to: C:/Users/TT/CodeBlocks/OJI_2020_A6-A_forta/.
      Set variable: PATH=.;C:\Program Files\CodeBlocks\MinGW\bin;C:\Program Files\CodeBlocks\MinGW;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Users\TT\AppData\Local\Programs\Python\Python37\Scripts;C:\Users\TT\AppData\Local\Programs\Python\Python37
      
      [debug]Command-line: C:\Program Files\CodeBlocks\MINGW\bin\gdb.exe -nx -fullname -quiet  -args C:/Users/TT/CodeBlocks/OJI_2020_A6-A_forta/bin/Debug/OJI_2020_A6-A_forta.exe
      [debug]Working dir : C:\Users\TT\CodeBlocks\OJI_2020_A6-A_forta
      
      Starting debugger: C:\Program Files\CodeBlocks\MINGW\bin\gdb.exe -nx -fullname -quiet  -args C:/Users/TT/CodeBlocks/OJI_2020_A6-A_forta/bin/Debug/OJI_2020_A6-A_forta.exe
      done
      
      [debug]Reading symbols from C:/Users/TT/CodeBlocks/OJI_2020_A6-A_forta/bin/Debug/OJI_2020_A6-A_forta.exe...
      [debug]done.
      [debug](gdb) 
      [debug]&gt; set prompt &gt;&gt;&gt;&gt;&gt;&gt;cb_gdb:
      
      Setting breakpoints
      
      [debug]&gt;&gt;&gt;&gt;&gt;&gt;cb_gdb:
      [debug]&gt; show version
      [debug]GNU gdb (GDB) 8.1
      [debug]Copyright (C) 2018 Free Software Foundation, Inc.
      [debug]License GPLv3+: GNU GPL version 3 or later &lt;http://gnu.org/licenses/gpl.html&gt;
      [debug]This is free software: you are free to change and redistribute it.
      [debug]There is NO WARRANTY, to the extent permitted by law.  Type &quot;show copying&quot;
      [debug]and &quot;show warranty&quot; for details.
      [debug]This GDB was configured as &quot;x86_64-w64-mingw32&quot;.
      [debug]Type &quot;show configuration&quot; for configuration details.
      [debug]For bug reporting instructions, please see:
      [debug]&lt;http://www.gnu.org/software/gdb/bugs/&gt;.
      [debug]Find the GDB manual and other documentation resources online at:
      [debug]&lt;http://www.gnu.org/software/gdb/documentation/&gt;.
      [debug]For help, type &quot;help&quot;.
      [debug]Type &quot;apropos word&quot; to search for commands related to &quot;word&quot;.
      [debug]&gt;&gt;&gt;&gt;&gt;&gt;cb_gdb:
      [debug]&gt; set confirm off
      
      Debugger name and version: GNU gdb (GDB) 8.1
      
      [debug]&gt;&gt;&gt;&gt;&gt;&gt;cb_gdb:
      [debug]&gt; set width 0
      [debug]&gt;&gt;&gt;&gt;&gt;&gt;cb_gdb:
      [debug]&gt; set height 0
      [debug]&gt;&gt;&gt;&gt;&gt;&gt;cb_gdb:
      [debug]&gt; set breakpoint pending on
      [debug]&gt;&gt;&gt;&gt;&gt;&gt;cb_gdb:
      [debug]&gt; set print asm-demangle on
      [debug]&gt;&gt;&gt;&gt;&gt;&gt;cb_gdb:
      [debug]&gt; set unwindonsignal on
      [debug]&gt;&gt;&gt;&gt;&gt;&gt;cb_gdb:
      [debug]&gt; set print elements 200
      [debug]&gt;&gt;&gt;&gt;&gt;&gt;cb_gdb:
      [debug]&gt; set new-console on
      [debug]&gt;&gt;&gt;&gt;&gt;&gt;cb_gdb:
      [debug]&gt; set disassembly-flavor att
      [debug]&gt;&gt;&gt;&gt;&gt;&gt;cb_gdb:
      [debug]&gt; catch throw
      [debug]Catchpoint 1 (throw)
      [debug]&gt;&gt;&gt;&gt;&gt;&gt;cb_gdb:
      [debug]&gt; directory C:/Users/TT/CodeBlocks/OJI_2020_A6-A_forta/
      [debug]Source directories searched: C:/Users/Tudor/CodeBlocks/OJI_2020_A6-A_forta;$cdir;$cwd
      [debug]&gt;&gt;&gt;&gt;&gt;&gt;cb_gdb:
      [debug]&gt; break &quot;C:/Users/TT/CodeBlocks/OJI_2020_A6-A_forta/main2.cpp:54&quot;
      [debug]Breakpoint 2 at 0x401925: file C:\Users\TT\CodeBlocks\OJI_2020_A6-A_forta\main2.cpp, line 54.
      [debug]&gt;&gt;&gt;&gt;&gt;&gt;cb_gdb:
      [debug]&gt; run
      [debug]Starting program: C:\Users\TT\CodeBlocks\OJI_2020_A6-A_forta\bin\Debug\OJI_2020_A6-A_forta.exe 
  
  Child process PID: 6060
  
  [debug][New Thread 6060.0x1624]
  </code></pre>