title: Unable to create a core file for my crashed program
body: <p>I am using Ubuntu 12.04 LTS. I wrote a simple program as follows to create crash</p>
  
  <pre><code>// null.c
  #include&lt;stdio.h&gt;
  
  int main()
  {
     int *p = NULL;
     int k=*p;
     printf("%d",sizeof(0));
     return 0;
  }
  </code></pre>
  
  <p>Now I run with "gcc -g null.c"
  and then "./a.out" and the output is as expected.</p>
  
  <pre><code>Segmentation fault (core dumped)
  </code></pre>
  
  <p>Now I want to see the core dump file using gdb. I did the following things</p>
  
  <ol>
  <li>I checked the current directory, there is no core dump file</li>
  <li>I tried tried to change the /proc/sys/kernel/core_pattern with the content "core.%e.%p". But i am not able to write into the file. It is saying "Fsync Failed".</li>
  <li>I used the "sudo vi /proc/sys/kernel/core_pattern". Still can't write into the file.</li>
  </ol>
  
  <p>I want to create the core dump in my current directory. What to do now?</p>