Original Post
Hello everybody!
I'm using ubuntu 10.10, with g++ 4.4.
When I run my game, I get:
This occurs whenever a unit tries to move somewhere after a wall has been drilled.
Here's the line in my code where it crashes:
That first snippet of code would be from the file, "EbClassUnit.cpp", line 822. Here's the entire file: http://code.google.c...ec=svn234&r=234
The most frustrating part is the crash is jumping around through my code.
At some points, it's when I try to "push_back()" into a vector, or "pop()" from a vector. Although, these crashes, regardless of where in the code they occur, only occur after a wall has been mined...
More info: Here's where nemiver stops tracing the call stack:
That snippet of code is in new_allocator.h
Here's a link to the google code repo for this game: http://code.google.c...rock-raiders-c/
Yes, I did a lot of debugging, but I just can't seem fix the error!
Many thanks in advance!
I'm using ubuntu 10.10, with g++ 4.4.
When I run my game, I get:
*** glibc detected *** /media/Ubuntu10.10Exten/programming/current-programs/c++/Games/orr/orr/ORR: free(): invalid next size (normal): 0x081af1a8 ***
======= Backtrace: =========
/lib/libc.so.6(+0x6c501)[0x3ee501]
/lib/libc.so.6(+0x6dd70)[0x3efd70]
/lib/libc.so.6(cfree+0x6d)[0x3f2e5d]
/usr/lib/libstdc++.so.6(_ZdlPv+0x21)[0x2ff441]
/media/Ubuntu10.10Exten/programming/current-programs/c++/Games/orr/orr/ORR[0x80578df]
/media/Ubuntu10.10Exten/programming/current-programs/c++/Games/orr/orr/ORR[0x8057405]
/media/Ubuntu10.10Exten/programming/current-programs/c++/Games/orr/orr/ORR[0x8056ab8]
/media/Ubuntu10.10Exten/programming/current-programs/c++/Games/orr/orr/ORR[0x8055b52]
/media/Ubuntu10.10Exten/programming/current-programs/c++/Games/orr/orr/ORR[0x80587a2]
/media/Ubuntu10.10Exten/programming/current-programs/c++/Games/orr/orr/ORR[0x8055b6a]
/media/Ubuntu10.10Exten/programming/current-programs/c++/Games/orr/orr/ORR[0x8055195]
/media/Ubuntu10.10Exten/programming/current-programs/c++/Games/orr/orr/ORR[0x80535d1]
/media/Ubuntu10.10Exten/programming/current-programs/c++/Games/orr/orr/ORR[0x8051c94]
/media/Ubuntu10.10Exten/programming/current-programs/c++/Games/orr/orr/ORR[0x80500f1]
/media/Ubuntu10.10Exten/programming/current-programs/c++/Games/orr/orr/ORR[0x804efca]
/media/Ubuntu10.10Exten/programming/current-programs/c++/Games/orr/orr/ORR[0x804f256]
/media/Ubuntu10.10Exten/programming/current-programs/c++/Games/orr/orr/ORR[0x804c9cd]
/media/Ubuntu10.10Exten/programming/current-programs/c++/Games/orr/orr/ORR[0x80673c9]
/media/Ubuntu10.10Exten/programming/current-programs/c++/Games/orr/orr/ORR[0x806222d]
/media/Ubuntu10.10Exten/programming/current-programs/c++/Games/orr/orr/ORR[0x804a29f]
/lib/libc.so.6(__libc_start_main+0xe7)[0x398ce7]
/media/Ubuntu10.10Exten/programming/current-programs/c++/Games/orr/orr/ORR[0x8049bb1]
======= Memory map: ========
00110000-0012c000 r-xp 00000000 08:06 2274 /lib/ld-2.12.1.so
0012c000-0012d000 r--p 0001b000 08:06 2274 /lib/ld-2.12.1.so
0012d000-0012e000 rw-p 0001c000 08:06 2274 /lib/ld-2.12.1.so
0012e000-0012f000 r-xp 00000000 00:00 0 [vdso]
0012f000-0018f000 r-xp 00000000 08:06 7236 /usr/lib/libSDL-1.2.so.0.11.3
0018f000-00190000 ---p 00060000 08:06 7236 /usr/lib/libSDL-1.2.so.0.11.3
00190000-00191000 r--p 00060000 08:06 7236 /usr/lib/libSDL-1.2.so.0.11.3
00191000-00192000 rw-p 00061000 08:06 7236 /usr/lib/libSDL-1.2.so.0.11.3
00192000-001bc000 rw-p 00000000 00:00 0
001bc000-001c7000 r-xp 00000000 08:06 107 /usr/lib/libSDL_image-1.2.so.0.8.2
001c7000-001c8000 r--p 0000a000 08:06 107 /usr/lib/libSDL_image-1.2.so.0.8.2
001c8000-001c9000 rw-p 0000b000 08:06 107 /usr/lib/libSDL_image-1.2.so.0.8.2
001c9000-001d9000 rw-p 00000000 00:00 0
001d9000-001de000 r-xp 00000000 08:06 5106 /usr/lib/libSDL_ttf-2.0.so.0.6.3
001de000-001df000 r--p 00004000 08:06 5106 /usr/lib/libSDL_ttf-2.0.so.0.6.3
001df000-001e0000 rw-p 00005000 08:06 5106 /usr/lib/libSDL_ttf-2.0.so.0.6.3
001e0000-00207000 r-xp 00000000 08:06 4253 /usr/lib/libSDL_mixer-1.2.so.0.2.6
00207000-00208000 r--p 00026000 08:06 4253 /usr/lib/libSDL_mixer-1.2.so.0.2.6
00208000-00211000 rw-p 00027000 08:06 4253 /usr/lib/libSDL_mixer-1.2.so.0.2.6
00211000-0023b000 rw-p 00000000 00:00 0
0023b000-00250000 r-xp 00000000 08:06 6167 /lib/libpthread-2.12.1.so
00250000-00251000 ---p 00015000 08:06 6167 /lib/libpthread-2.12.1.so
00251000-00252000 r--p 00015000 08:06 6167 /lib/libpthread-2.12.1.so
00252000-00253000 rw-p 00016000 08:06 6167 /lib/libpthread-2.12.1.so
00253000-00255000 rw-p 00000000 00:00 0
00255000-00334000 r-xp 00000000 08:06 863 /usr/lib/libstdc++.so.6.0.14
00334000-00338000 r--p 000de000 08:06 863 /usr/lib/libstdc++.so.6.0.14
00338000-00339000 rw-p 000e2000 08:06 863 /usr/lib/libstdc++.so.6.0.14
00339000-00340000 rw-p 00000000 00:00 0
00340000-00364000 r-xp 00000000 08:06 3643 /lib/libm-2.12.1.so
00364000-00365000 r--p 00023000 08:06 3643 /lib/libm-2.12.1.so
00365000-00366000 rw-p 00024000 08:06 3643 /lib/libm-2.12.1.so
00366000-00380000 r-xp 00000000 08:06 922 /lib/libgcc_s.so.1
00380000-00381000 r--p 00019000 08:06 922 /lib/libgcc_s.so.1
00381000-00382000 rw-p 0001a000 08:06 922 /lib/libgcc_s.so.1
00382000-004d9000 r-xp 00000000 08:06 2935 /lib/libc-2.12.1.so
004d9000-004db000 r--p 00157000 08:06 2935 /lib/libc-2.12.1.so
004db000-004dc000 rw-p 00159000 08:06 2935 /lib/libc-2.12.1.so
004dc000-004df000 rw-p 00000000 00:00 0
004df000-004e1000 r-xp 00000000 08:06 3369 /lib/libdl-2.12.1.so
004e1000-004e2000 r--p 00001000 08:06 3369 /lib/libdl-2.12.1.so
004e2000-004e3000 rw-p 00002000 08:06 3369 /lib/libdl-2.12.1.so
004e3000-004e6000 r-xp 00000000 08:06 4724 /usr/lib/libpulse-simple.so.0.0.3
004e6000-004e7000 r--p 00002000 08:06 4724 /usr/lib/libpulse-simple.so.0.0.3
004e7000-004e8000 rw-p 00003000 08:06 4724 /usr/lib/libpulse-simple.so.0.0.3
004e8000-00527000 r-xp 00000000 08:06 2782 /usr/lib/libpulse.so.0.12.2
00527000-00528000 ---p 0003f000 08:06 2782 /usr/lib/libpulse.so.0.12.2
00528000-00529000 r--p 0003f000 08:06 2782 /usr/lib/libpulse.so.0.12.2
00529000-0052a000 rw-p 00040000 08:06 2782 /usr/lib/libpulse.so.0.12.2
0052a000-00581000 r-xp 00000000 08:06 4868 /usr/lib/libtiff.so.4.3.3
00581000-00582000 ---p 00057000 08:06 4868 /usr/lib/libtiff.so.4.3.3
00582000-00584000 r--p 00057000 08:06 4868 /usr/lib/libtiff.so.4.3.3
00584000-00585000 rw-p 00059000 08:06 4868 /usr/lib/libtiff.so.4.3.3
00585000-005a4000 r-xp 00000000 08:06 4055 /usr/lib/libjpeg.so.62.0.0
005a4000-005a5000 r--p 0001e000 08:06 4055 /usr/lib/libjpeg.so.62.0.0
005a5000-005a6000 rw-p 0001f000 08:06 4055 /usr/lib/libjpeg.so.62.0.0
005a6000-005b9000 r-xp 00000000 08:06 861 /lib/libz.so.1.2.3.4
005b9000-005ba000 r--p 00012000 08:06 861 /lib/libz.so.1.2.3.4
005ba000-005bb000 rw-p 00013000 08:06 861 /lib/libz.so.1.2.3.4
005bb000-0062d000 r-xp 00000000 08:06 916 /usr/lib/libfreetype.so.6.6.0
0062d000-00631000 r--p 00071000 08:06 916 /usr/lib/libfreetype.so.6.6.0
00631000-00632000 rw-p 00075000 08:06 916 /usr/lib/libfreetype.so.6.6.0
00632000-0067b000 r-xp 00000000 08:06 3942 /usr/lib/libmikmod.so.2.0.4
0067b000-0067c000 r--p 00049000 08:06 3942 /usr/lib/libmikmod.so.2.0.4
0067c000-0067d000 rw-p 0004a000 08:06 3942 /usr/lib/libmikmod.so.2.0.4
0067d000-0067e000 rw-p 00000000 00:00 0
0067e000-00685000 r-xp 00000000 08:06 4565 /usr/lib/libvorbisfile.so.3.3.2
00685000-00686000 r--p 00006000 08:06 4565 /usr/lib/libvorbisfile.so.3.3.2
00686000-00687000 rw-p 00007000 08:06 4565 /usr/lib/libvorbisfile.so.3.3.2
00687000-006c2000 r-xp 00000000 08:06 5062 /usr/lib/libsmpeg-0.4.so.0.1.4
006c2000-006c3000 r--p 0003a000 08:06 5062 /usr/lib/libs
Program received signal SIGABRT, Aborted.
0x0012e416 in __kernel_vsyscall ()
(gdb) backtrace
#0 0x0012e416 in __kernel_vsyscall ()
#1 0x003ac941 in raise () from /lib/libc.so.6
#2 0x003afe42 in abort () from /lib/libc.so.6
#3 0x003e4305 in ?? () from /lib/libc.so.6
#4 0x003ee501 in ?? () from /lib/libc.so.6
#5 0x003efd70 in ?? () from /lib/libc.so.6
#6 0x003f2e5d in free () from /lib/libc.so.6
#7 0x002ff441 in operator delete(void*) () from /usr/lib/libstdc++.so.6
#8 0x080578df in __gnu_cxx::new_allocator<tool>::deallocate (this=0x81af0e8,
__p=0x81af1a8) at /usr/include/c++/4.4/ext/new_allocator.h:95
#9 0x08057405 in std::_Vector_base<tool, std::allocator<tool> >::_M_deallocate
(this=0x81af0e8, __p=0x81af1a8, __n=1)
at /usr/include/c++/4.4/bits/stl_vector.h:146
#10 0x08056ab8 in std::_Vector_base<tool, std::allocator<tool> >::~_Vector_base
(this=0x81af0e8, __in_chrg=<value optimized out>)
at /usr/include/c++/4.4/bits/stl_vector.h:132
#11 0x08055b52 in std::vector<tool, std::allocator<tool> >::~vector (
this=0x81af0e8, __in_chrg=<value optimized out>)
at /usr/include/c++/4.4/bits/stl_vector.h:313
#12 0x080587a2 in bClassUnit::~bClassUnit (this=0x81af080,
__in_chrg=<value optimized out>) at EObject.hpp:14
#13 0x08055b6a in std::_Destroy<bClassUnit> (__pointer=0x81af080)
at /usr/include/c++/4.4/bits/stl_construct.h:83
---Type <return> to continue, or q <return> to quit---
#14 0x08055195 in std::_Destroy_aux<false>::__destroy<__gnu_cxx::__normal_iterator<bClassUnit*, std::vector<bClassUnit, std::allocator<bClassUnit> > > > (
__first=..., __last=...) at /usr/include/c++/4.4/bits/stl_construct.h:93
#15 0x080535d1 in std::_Destroy<__gnu_cxx::__normal_iterator<bClassUnit*, std::vector<bClassUnit, std::allocator<bClassUnit> > > > (__first=..., __last=...)
at /usr/include/c++/4.4/bits/stl_construct.h:116
#16 0x08051c94 in std::_Destroy<__gnu_cxx::__normal_iterator<bClassUnit*, std::vector<bClassUnit, std::allocator<bClassUnit> > >, bClassUnit> (__first=...,
__last=...) at /usr/include/c++/4.4/bits/stl_construct.h:142
#17 0x080500f1 in std::vector<bClassUnit, std::allocator<bClassUnit> >::operator= (this=0xbfffecf4, __x=...) at /usr/include/c++/4.4/bits/vector.tcc:176
#18 0x0804efca in tile::operator= (this=0xbfffecd4) at EObject.hpp:258
#19 0x0804f256 in node::operator= (this=0xbfffecc8) at EbClassUnit.cpp:631
#20 0x0804c9cd in bClassUnit::calculate_path (this=0x81af380)
at EbClassUnit.cpp:822
#21 0x080673c9 in tile::update (this=0x82034f0) at terrain.cpp:105
#22 0x0806222d in update () at update.cpp:507
#23 0x0804a29f in main (argc=1, argv=0xbffff3f4) at main.cpp:97
This occurs whenever a unit tries to move somewhere after a wall has been drilled.
Here's the line in my code where it crashes:
n = examineSet.top(); // Get the best next nodeThat first snippet of code would be from the file, "EbClassUnit.cpp", line 822. Here's the entire file: http://code.google.c...ec=svn234&r=234
The most frustrating part is the crash is jumping around through my code.
At some points, it's when I try to "push_back()" into a vector, or "pop()" from a vector. Although, these crashes, regardless of where in the code they occur, only occur after a wall has been mined...
More info: Here's where nemiver stops tracing the call stack:
// __p is not permitted to be a null pointer.
void
deallocate(pointer __p, size_type)
{ ::operator delete(__p); }That snippet of code is in new_allocator.h
Here's a link to the google code repo for this game: http://code.google.c...rock-raiders-c/
Yes, I did a lot of debugging, but I just can't seem fix the error!
Many thanks in advance!