title: C++ basic program segmentation fault
body: <p>here is my CPP program </p>
  
  <pre><code>#include &lt;iostream&gt;
  
  int main(int argc, char *argv[]){
       return 0;
  }
  </code></pre>
  
  <p>compiling and executing this, causes a seg fault:</p>
  
  <pre><code>[18:08 ~] &gt; g++ test.cpp
  [18:09 ~] &gt; ./a.out
  Segmentation fault
  </code></pre>
  
  <p>Does anybody have an idea about this issue please? 
  Thanks a lot for your help.</p>
  
  <p>Here are some details that might be useful:</p>
  
  <pre><code>[18:13 ~] &gt; ldd a.out
   linux-vdso.so.1 =&gt;  (0x00007fff3fdff000)
   libstdc++.so.6 =&gt; /usr/lib/gcc/x86_64-redhat-linux/3.4.6/libstdc++.so.6 (0x00007fc8f4a53000)
   libm.so.6 =&gt; /lib64/libm.so.6 (0x00007fc8f47ce000)
   libgcc_s.so.1 =&gt; /lib64/libgcc_s.so.1 (0x00007fc8f45b8000)
   libc.so.6 =&gt; /lib64/libc.so.6 (0x00007fc8f4225000)
   /lib64/ld-linux-x86-64.so.2 (0x00007fc8f4ca5000)
  </code></pre>
  
  <p>and also gdb:</p>
  
  <pre><code>[18:15 ~] &gt; gdb ./a.out
  GNU gdb (GDB) Red Hat Enterprise Linux (7.2-60.el6)
  Copyright (C) 2010 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-redhat-linux-gnu".
  For bug reporting instructions, please see:
  &lt;http://www.gnu.org/software/gdb/bugs/&gt;...
  Reading symbols from ...done.
  (gdb) run
  Starting program: a.out
  
  Program received signal SIGSEGV, Segmentation fault.
  0x00007ffff7bd48ec in std::ios_base::Init::Init() () from /usr/lib/gcc/x86_64-redhat-linux/3.4.6/libstdc++.so.6
  Missing separate debuginfos, use: debuginfo-install glibc-2.12-1.107.el6.x86_64 libgcc-4.4.7-3.el6.x86_64
  (gdb) bt
  #0  0x00007ffff7bd48ec in std::ios_base::Init::Init() () from /usr/lib/gcc/x86_64-redhat-linux/3.4.6/libstdc++.so.6
  #1  0x0000000000400831 in __static_initialization_and_destruction_0 (__initialize_p=1, __priority=65535) at /usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../include/c++/3.4.6/iostream:77
  #2  0x0000000000400873 in global constructors keyed to main() () at test.cpp:7
  #3  0x0000000000400976 in __do_global_ctors_aux ()
  #4  0x00000000004005a3 in _init ()
  #5  0x00007fffffffe448 in ?? ()
  #6  0x0000000000400905 in __libc_csu_init ()
  #7  0x00007ffff7385c70 in __libc_start_main () from /lib64/libc.so.6
  #8  0x0000000000400659 in _start ()
  (gdb)
  </code></pre>
  
  <p>g++</p>
  
  <pre><code>[10:14 ~] &gt; g++ -v
  Reading specs from /usr/lib/gcc/x86_64-redhat-linux/3.4.6/specs
  Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-languages=c,c++,f77 --disable-libgcj --host=x86_64-redhat-linux
  Thread model: posix
  gcc version 3.4.6 20060404 (Red Hat 3.4.6-19.el6)
  </code></pre>
  
  <p>and last thing</p>
  
  <pre><code>[10:25 ~] &gt; ls /usr/lib/gcc/x86_64-redhat-linux
  3.4.6
  </code></pre>
  
  <p>Thank you.</p>