title: Killed process by SIGKILL
body: <p>I have a process that get killed immediately after executing the program. This is the code of the compiled executable, and it is a small program that reads several graphs represented by numbers from standard input (a descriptive file usually) and finds the minimum spanning tree for every graph using the Prim's algorithm (it does not show the results yet, it just find the solution).</p>
  
  <pre><code>#include &lt;stdlib.h&gt;  
  #include &lt;iostream&gt;  
  
  using namespace std;
  
  const int MAX_NODOS = 20000;
  const int infinito = 10000;
  
  int nnodos;
  int nAristas;
  int G[MAX_NODOS][MAX_NODOS]; 
  int solucion[MAX_NODOS][MAX_NODOS];
  int menorCoste[MAX_NODOS];
  int masCercano[MAX_NODOS];
  
  
  
  void leeGrafo(){
      if (nnodos&lt;0 || nnodos&gt;MAX_NODOS) {
          cerr &lt;&lt; "Numero de nodos (" &lt;&lt; nnodos &lt;&lt; ") no valido\n";
          exit(0);
      }  
      for (int i=0; i&lt;nnodos ; i++)
          for (int j=0; j&lt;nnodos ; j++)
              G[i][j] = infinito; 
      int A,B,P;
      for(int i=0;i&lt;nAristas;i++){
          cin &gt;&gt; A &gt;&gt; B &gt;&gt; P; 
          G[A][B] = P;
          G[B][A] = P;
      }   
  }
  
  
  void prepararEstructuras(){
      // Grafo de salida
      for(int i=0;i&lt;nnodos;i++)
          for(int j=0;j&lt;nnodos;j++)
              solucion[i][j] = infinito;
      // el mas cercaano 
      for(int i=1;i&lt;nnodos;i++){
          masCercano[i]=0;
          // menor coste
          menorCoste[i]=G[0][i];
      }           
  }
  
  void prim(){
      prepararEstructuras();
      int min,k;  
      for(int i=1;i&lt;nnodos;i++){
          min = menorCoste[1];
          k = 1;
          for(int j=2;i&lt;nnodos;j++){
              if(menorCoste[j] &lt; min){
                  min = menorCoste[j];
                  k = j;
              }
          }
          solucion[k][masCercano[k]] = G[k][masCercano[k]];
          menorCoste[k] = infinito;
          for(int j=1;j&lt;nnodos;j++){
              if(G[k][j] &lt; menorCoste[j] &amp;&amp; menorCoste[j]!=infinito){
                  menorCoste[j] = G[k][j];
                  masCercano[j] = k;
              }       
          }           
      }
  }
  
  void output(){
      for(int i=0;i&lt;nnodos;i++){
          for(int j=0;j&lt;nnodos;j++)
              cout &lt;&lt; G[i][j] &lt;&lt; ' ';
          cout &lt;&lt; endl;
      }
  }
  
  int main (){
      while(true){
          cin &gt;&gt; nnodos;
          cin &gt;&gt; nAristas;
          if((nnodos==0)&amp;&amp;(nAristas==0)) break;
          else{
              leeGrafo();
              output();
              prim(); 
          }
      }   
  }
  </code></pre>
  
  <p>I have learned that i must use strace to find what is going on, and this is what i get :</p>
  
  <pre><code>execve("./412", ["./412"], [/* 38 vars */] &lt;unfinished ...&gt;
  +++ killed by SIGKILL +++
  Killed
  </code></pre>
  
  <p>I am runing ubuntu and this is the first time i get this type of errors. The program is supposed to stop after reading two zeros in a row from the input wich i can guarantee that i have in my graphs descriptive file. Also the problem happens even if i execute the program without doing an input redirection to my graphs file. </p>