$ g++ -g -std=c++11 foo.cpp
$ gdb -q ./a.out
Reading symbols from ./a.out...done.
(gdb) b 33
(gdb) run
Starting program: ./a.out
3
Program received signal SIGSEGV, Segmentation fault.
__memmove_ssse3_back () at ../sysdeps/x86_64/multiarch/memcpy-ssse3-back.S:1550
1550 ../sysdeps/x86_64/multiarch/memcpy-ssse3-back.S: No such file or directory.
(gdb) bt
#0 __memmove_ssse3_back () at ../sysdeps/x86_64/multiarch/memcpy-ssse3-back.S:1550
#1 0x0000000000402b05 in std::__copy_move<true, true, std::random_access_iterator_tag>::__copy_m<int> (__first=0x6180f4, __last=0x6180f0, __result=0x6180f0) at /usr/include/c++/5/bits/stl_algobase.h:384
#2 0x00000000004028cf in std::__copy_move_a<true, int*, int*> (__first=0x6180f4, __last=0x6180f0, __result=0x6180f0) at /usr/include/c++/5/bits/stl_algobase.h:402
#3 0x00000000004025c1 in std::__copy_move_a2<true, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > > > (
__first=0, __last=0, __result=0) at /usr/include/c++/5/bits/stl_algobase.h:438
#4 0x0000000000401f15 in std::move<__gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > >, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int> > > > (__first=0,
__last=0, __result=0) at /usr/include/c++/5/bits/stl_algobase.h:504
#5 0x00000000004017ef in std::vector<int, std::allocator<int> >::_M_erase (this=0x7fffffffdc40, __position=0) at /usr/include/c++/5/bits/vector.tcc:145
#6 0x000000000040124f in std::vector<int, std::allocator<int> >::erase (this=0x7fffffffdc40, __position=0) at /usr/include/c++/5/bits/stl_vector.h:1147
#7 0x0000000000400c43 in newv (vect=std::vector of length 1, capacity 1 = {...}, v=std::vector of length 0, capacity 1, n=3) at foo.cpp:11
#8 0x0000000000400c8a in newv (vect=std::vector of length 1, capacity 1 = {...}, v=std::vector of length 1, capacity 3 = {...}, n=3) at foo.cpp:15
#9 0x0000000000400c8a in newv (vect=std::vector of length 1, capacity 1 = {...}, v=std::vector of length 3, capacity 5 = {...}, n=4) at foo.cpp:15
#10 0x0000000000400d78 in alter (v=std::vector of length 5, capacity 5 = {...}, n=5) at foo.cpp:22
#11 0x0000000000400edf in main () at foo.cpp:32
(gdb)
|