I’m writing the bot in C++ and almost always gets an error similar to the following:
Standard Error Stream:
*** Error in /tmp/Answer': malloc(): memory corruption: 0x0000000000613d90 *** Aborted. at raise.c. function __GI_raise (sig=sig@entry=6) on line 56 at abort.c. function __GI_abort () on line 89 at libc_fatal.c. function __libc_message (do_abort=do_abort@entry=1, fmt=fmt@entry=0x7ffff6b1bc60 "*** Error in
%s’: %s: 0x%s ***\n") on line 175
at malloc.c.
function malloc_printerr (action=1, str=0x7ffff6b17d9f “malloc():
memory corruption”, ptr=) on line 4996
at malloc.c. function _int_malloc (av=0x7ffff6d59620 <main_arena>, bytes=8) on line 3447
at malloc.c. function __GI___libc_malloc (bytes=8) on line 2891
at new_allocator.h. function __gnu_cxx::new_allocator::allocate ( this=0x7fffffffe8a0, __n=2) on line 104
at alloc_traits.h. function std::allocator_traits<std::allocator >::allocate (__a=…, __n=2) on line 357
at stl_vector.h. function std::_Vector_base<int, std::allocator >::_M_allocate (this=0x7fffffffe8a0, __n=2) on line 170
It may happen on games with number of zones as low as 20. My program typically crashes at the end of the game.
I’m not manually managing memory. I’m using vector. Why is this happening?