flareteam / flare-game

Fantasy action RPG using the FLARE engine
http://flarerpg.org/
Other
1.1k stars 235 forks source link

Aborted (core dumped) in Underworld Catacombs (from Hyperspace entrance) during attempt to exit (Bug with Slow spell?) #843

Closed jasonkhanlar closed 2 years ago

jasonkhanlar commented 2 years ago

I ran into Underworld Catacombs, and tried to run past all the mobs to get somewhere, but I went the wrong way, so I ran back to Hyperspace to exit before I died, but the game crashed.

/usr/include/c++/11.1.0/bits/stl_vector.h:1045: std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](std::vector<_Tp, _Alloc>::size_type) [with _Tp = std::vector<short unsigned int>; _Alloc = std::allocator<std::vector<short unsigned int> >; std::vector<_Tp, _Alloc>::reference = std::vector<short unsigned int>&; std::vector<_Tp, _Alloc>::size_type = long unsigned int]: Assertion '__n < this->size()' failed.
Aborted (core dumped)

I just tried to reproduce it and I was able to reproduce it much quicker! Same map, I went NorthEast to where the first set of enemies were, they started attacking me, and then I tried to exit back into Hyperspace and same crash.

I tested a few more times and it appears that the crash only happens if I get Slowed cast on me from a spider, and if I try to exit with the Slow still active, then the game crashes.

jasonkhanlar commented 2 years ago

gdb backtrace:

Thread 1 "flare" received signal SIGABRT, Aborted.
0x00007ffff7859d22 in raise () from /usr/lib/libc.so.6
(gdb) bt
#0  0x00007ffff7859d22 in raise () from /usr/lib/libc.so.6
#1  0x00007ffff7843862 in abort () from /usr/lib/libc.so.6
#2  0x00005555556dcb13 in std::__replacement_assert (__file=0x5555558e6eb0 "/usr/include/c++/11.1.0/bits/stl_vector.h", __line=1045, 
    __function=0x5555558e7018 "std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](std::vector<_Tp, _Alloc>::size_type) [with _Tp = std::vector<short unsigned int>; _Alloc = std::allocator<std::vector<short uns"..., __condition=0x5555558e6eda "__n < this->size()") at /usr/include/c++/11.1.0/x86_64-pc-linux-gnu/bits/c++config.h:504
#3  0x0000555555758d8a in std::vector<std::vector<unsigned short, std::allocator<unsigned short> >, std::allocator<std::vector<unsigned short, std::allocator<unsigned short> > > >::operator[] (this=0x555556948c40, __n=59) at /usr/include/c++/11.1.0/bits/stl_vector.h:1045
#4  0x00005555557ce6da in MapCollision::unblock (this=0x555556948c40, map_x=@0x5555573fcc6c: 59.5, map_y=@0x5555573fcc70: 40.7932281) at /usr/src/debug/flare-engine/src/MapCollision.cpp:520
#5  0x00005555558a9b56 in StatBlock::takeDamage (this=0x5555573fc958, dmg=130, crit=false, source_type=1) at /usr/src/debug/flare-engine/src/StatBlock.cpp:698
#6  0x00005555558ac3ed in StatBlock::removeSummons (this=0x55555734c388) at /usr/src/debug/flare-engine/src/StatBlock.cpp:1091
#7  0x00005555558ac5ba in StatBlock::removeFromSummons (this=0x55555734c388) at /usr/src/debug/flare-engine/src/StatBlock.cpp:1110
#8  0x00005555558a699e in StatBlock::~StatBlock (this=0x55555734c388, __in_chrg=<optimized out>) at /usr/src/debug/flare-engine/src/StatBlock.cpp:205
#9  0x0000555555741067 in Entity::~Entity (this=0x55555734c2e0, __in_chrg=<optimized out>) at /usr/src/debug/flare-engine/src/Entity.cpp:758
#10 0x00005555557410e0 in Entity::~Entity (this=0x55555734c2e0, __in_chrg=<optimized out>) at /usr/src/debug/flare-engine/src/Entity.cpp:758
#11 0x000055555574a714 in EntityManager::handleNewMap (this=0x555556b12b10) at /usr/src/debug/flare-engine/src/EntityManager.cpp:129
#12 0x000055555577dc0e in GameStatePlay::checkTeleport (this=0x5555567ecd60) at /usr/src/debug/flare-engine/src/GameStatePlay.cpp:364
#13 0x00005555557802c7 in GameStatePlay::logic (this=0x5555567ecd60) at /usr/src/debug/flare-engine/src/GameStatePlay.cpp:918
#14 0x0000555555789ce7 in GameSwitcher::logic (this=0x5555562fb170) at /usr/src/debug/flare-engine/src/GameSwitcher.cpp:204
#15 0x00005555558db463 in mainLoop () at /usr/src/debug/flare-engine/src/main.cpp:206
#16 0x00005555558dc374 in main (argc=1, argv=0x7fffffffdd28) at /usr/src/debug/flare-engine/src/main.cpp:442
jasonkhanlar commented 2 years ago

Actually, this looks like the exact same bug from https://github.com/flareteam/flare-game/issues/841 and fixed with https://github.com/dorkster/flare-engine/commit/6977871e3f857d2042d657e5e783eda79c2e187b so I'll close this I guess.