title: understanding stack trace of a segmentation fault
body: <p>I am doing an <code>snprintf</code> and getting a seg fault.</p>
  
  <p>when I loaded the core file on gdb like this: <code>gdb my_executable core</code> ; and did <code>bt</code> to get the backtrace, I got following:</p>
  
  <pre><code>Program terminated with signal 11, Segmentation fault.
  #0  0x88207fc2 in memcpy () from /usr/lib/libc.so.6
  (gdb) bt
  #0  0x88207fc2 in memcpy () from /usr/lib/libc.so.6
  #1  0x88205eb6 in __sfvwrite () from /usr/lib/libc.so.6
  #2  0x881fbc95 in strchr () from /usr/lib/libc.so.6
  #3  0xbfbe6c14 in ?? ()
  #4  0xbfbe69d8 in ?? ()
  #5  0x881ed91e in localeconv () from /usr/lib/libc.so.6
  #6  0x881fec05 in __vfprintf () from /usr/lib/libc.so.6
  #7  0x881f7d80 in snprintf () from /usr/lib/libc.so.6  
  #8  0x08052b64 in my_function (files=0xbfbed710, filename=&lt;value optimized out&gt;) at myfile.c:1102
  #9  0x08053bfb in main (argc=4, argv=0xbfbedd90) at myfile.c:225
  </code></pre>
  
  <p>I see such stack many times in case of seg fault but never understood correctly.</p>
  
  <p>Just looking the calls in trace, can we tell what is going wrong? </p>
  
  <p>NOTE: Please do not ask for more code. My motive is simply understand what the stack-trace like this means - irrespective of code. I see that on the top "memcpy" is failing. I want to understand when that can happen in this situation. </p>