cyberfish@cyberfish-desktop:/tmp$ g++ -g a.cpp
a.cpp: In function ‘int main()’:
a.cpp:31: warning: deprecated conversion from string constant to ‘char*’
cyberfish@cyberfish-desktop:/tmp$ gdb a.out
GNU gdb 6.8-debian
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
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"...
(gdb) r
Starting program: /tmp/a.out
*** glibc detected *** /tmp/a.out: munmap_chunk(): invalid pointer: 0x00007fe7092dc268 ***
======= Backtrace: =========
/lib/libc.so.6[0x7fe70884d938]
/usr/lib/libstdc++.so.6(_ZNSsD1Ev+0x3d)[0x7fe70908938d]
/tmp/a.out[0x400e6c]
/lib/libc.so.6(__libc_start_main+0xe6)[0x7fe7087f2466]
/tmp/a.out[0x400bc9]
======= Memory map: ========
00400000-00402000 r-xp 00000000 08:02 2130025 /tmp/a.out
00601000-00602000 r--p 00001000 08:02 2130025 /tmp/a.out
00602000-00603000 rw-p 00002000 08:02 2130025 /tmp/a.out
01ef2000-01f13000 rw-p 01ef2000 00:00 0 [heap]
7fe7087d4000-7fe70893d000 r-xp 00000000 08:02 8773670 /lib/libc-2.8.90.so
7fe70893d000-7fe708b3c000 ---p 00169000 08:02 8773670 /lib/libc-2.8.90.so
7fe708b3c000-7fe708b40000 r--p 00168000 08:02 8773670 /lib/libc-2.8.90.so
7fe708b40000-7fe708b41000 rw-p 0016c000 08:02 8773670 /lib/libc-2.8.90.so
7fe708b41000-7fe708b46000 rw-p 7fe708b41000 00:00 0
7fe708b46000-7fe708b5c000 r-xp 00000000 08:02 8773693 /lib/libgcc_s.so.1
7fe708b5c000-7fe708d5c000 ---p 00016000 08:02 8773693 /lib/libgcc_s.so.1
7fe708d5c000-7fe708d5d000 r--p 00016000 08:02 8773693 /lib/libgcc_s.so.1
7fe708d5d000-7fe708d5e000 rw-p 00017000 08:02 8773693 /lib/libgcc_s.so.1
7fe708d5e000-7fe708de2000 r-xp 00000000 08:02 8773704 /lib/libm-2.8.90.so
7fe708de2000-7fe708fe1000 ---p 00084000 08:02 8773704 /lib/libm-2.8.90.so
7fe708fe1000-7fe708fe2000 r--p 00083000 08:02 8773704 /lib/libm-2.8.90.so
7fe708fe2000-7fe708fe3000 rw-p 00084000 08:02 8773704 /lib/libm-2.8.90.so
7fe708fe3000-7fe7090d4000 r-xp 00000000 08:02 7630262 /usr/lib/libstdc++.so.6.0.10
7fe7090d4000-7fe7092d4000 ---p 000f1000 08:02 7630262 /usr/lib/libstdc++.so.6.0.10
7fe7092d4000-7fe7092db000 r--p 000f1000 08:02 7630262 /usr/lib/libstdc++.so.6.0.10
7fe7092db000-7fe7092dd000 rw-p 000f8000 08:02 7630262 /usr/lib/libstdc++.so.6.0.10
7fe7092dd000-7fe7092f0000 rw-p 7fe7092dd000 00:00 0
7fe7092f0000-7fe70930f000 r-xp 00000000 08:02 8773650 /lib/ld-2.8.90.so
7fe7094ee000-7fe7094f1000 rw-p 7fe7094ee000 00:00 0
7fe70950b000-7fe70950e000 rw-p 7fe70950b000 00:00 0
7fe70950e000-7fe70950f000 r--p 0001e000 08:02 8773650 /lib/ld-2.8.90.so
7fe70950f000-7fe709510000 rw-p 0001f000 08:02 8773650 /lib/ld-2.8.90.so
7fff114fb000-7fff11510000 rw-p 7ffffffea000 00:00 0 [stack]
7fff115ff000-7fff11600000 r-xp 7fff115ff000 00:00 0 [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]
Program received signal SIGABRT, Aborted.
0x00007fe708806fd5 in raise () from /lib/libc.so.6
(gdb) bt
#0 0x00007fe708806fd5 in raise () from /lib/libc.so.6
#1 0x00007fe708808b43 in abort () from /lib/libc.so.6
#2 0x00007fe708847fa8 in ?? () from /lib/libc.so.6
#3 0x00007fe70884d938 in ?? () from /lib/libc.so.6
#4 0x00007fe70908938d in std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string () from /usr/lib/libstdc++.so.6
#5 0x0000000000400e6c in main () at a.cpp:31
(gdb)