title: gdb seg faults when reading symbols
body: <p>When trying to run gdb with a program, it seg faults while reading symbols. </p>
  
  <p>When I run:</p>
  
  <p><code>gdb /home/user/path/to/program.exe</code></p>
  
  <p>I get:</p>
  
  <pre><code>GNU gdb (Ubuntu 7.7-0ubuntu3.1) 7.7
  Copyright (C) 2014 Free Software Foundation, Inc.
  License GPLv3+: GNU GPL version 3 or later &lt;http://gnu.org/licenses/gpl.html&gt;
  This is free software: you are free to change and redistribute it.
  There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
  and "show warranty" for details.
  This GDB was configured as "x86_64-linux-gnu".
  Type "show configuration" for configuration details.
  For bug reporting instructions, please see:
  &lt;http://www.gnu.org/software/gdb/bugs/&gt;.
  Find the GDB manual and other documentation resources online at:
  &lt;http://www.gnu.org/software/gdb/documentation/&gt;.
  For help, type "help".
  Type "apropos word" to search for commands related to "word"...
  Reading symbols from /home/user/path/to/program.exe...Segmentation fault (core dumped)
  </code></pre>
  
  <p>I suspect that the binary might be too large for gdb to load into memory. This error only occurs when I compile with -g (debug flag). Here's the difference in size of the binaries:</p>
  
  <p>Compiled with </p>
  
  <p><code>-release flag: 405 MB</code></p>
  
  <p><code>-debug flag:  862 MB</code></p>
  
  <p>Any ideas on other culprits of this segmentation fault? Or is there a way to increase the memory allowed for gdb? This turns out to be a very challenging problem to google.</p>