Skip to content

Segmentation Fault while casting Lightning Bolt on Ghost in the Graveyard #12

Description

@kamiccolo

Casting Lightning Bolt on a Ghost in the Graveyard causes Segmentation Fault.

Backtrace:

#0  0x000000000041a752 in Surface::SetPixel4 (this=0x9750a0 <Display::Get()::inside>, x=-342, y=0, color=65535)
    at /home/zilvinas/Compile/fheroes2enh/src/engine/surface.cpp:509
#1  0x000000000041a990 in Surface::SetPixel (this=0x9750a0 <Display::Get()::inside>, x=-342, y=0, pixel=65535)
    at /home/zilvinas/Compile/fheroes2enh/src/engine/surface.cpp:552
#2  0x000000000041d7ac in Surface::DrawLine (this=0x9750a0 <Display::Get()::inside>, p1=..., p2=..., color=...)
    at /home/zilvinas/Compile/fheroes2enh/src/engine/surface.cpp:1207
#3  0x00000000004c7e9d in RedrawSparksEffects (src=..., dst=...) at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/battle/battle_interface.cpp:4205
#4  0x00000000004c8158 in Battle::Interface::RedrawTroopWithFrameAnimation (this=0xb07150, b=..., icn=599, m82=126, pain=true)
    at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/battle/battle_interface.cpp:4256
#5  0x00000000004c4c9e in Battle::Interface::RedrawActionLightningBoltSpell (this=0xb07150, target=...)
    at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/battle/battle_interface.cpp:3513
#6  0x00000000004c161c in Battle::Interface::RedrawActionSpellCastPart1 (this=0xb07150, spell=..., dst=54, caster=0xd6caf0, name="Ranloo", targets=...)
    at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/battle/battle_interface.cpp:2915
#7  0x0000000000482b62 in Battle::Arena::ApplyActionSpellDefaults (this=0x7fffffffd4d0, cmd=..., spell=...)
    at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/battle/battle_action.cpp:697
#8  0x000000000048059d in Battle::Arena::ApplyActionSpellCast (this=0x7fffffffd4d0, cmd=...) at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/battle/battle_action.cpp:168
#9  0x0000000000480364 in Battle::Arena::ApplyAction (this=0x7fffffffd4d0, cmd=...) at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/battle/battle_action.cpp:95
#10 0x0000000000488cfd in Battle::Arena::TurnTroop (this=0x7fffffffd4d0, current_troop=0xad80d0)
    at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/battle/battle_arena.cpp:358
#11 0x000000000048939c in Battle::Arena::Turns (this=0x7fffffffd4d0) at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/battle/battle_arena.cpp:446
#12 0x00000000004cec44 in Battle::Loader (army1=..., army2=..., mapsindex=1699) at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/battle/battle_main.cpp:79
#13 0x00000000005a7813 in BattleHeroWithMonster (hero=..., army=..., dst_index=1699) at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/heroes/heroes_action.cpp:778
#14 0x00000000005b3bd8 in ActionToCaptureObject (hero=..., obj=192, dst_index=1699) at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/heroes/heroes_action.cpp:2334
#15 0x00000000005b32c9 in ActionToAbandoneMine (hero=..., obj=192, dst_index=1699) at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/heroes/heroes_action.cpp:2249
#16 0x00000000005a7452 in Heroes::Action (this=0xd6caf0, dst_index=1699) at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/heroes/heroes_action.cpp:652
#17 0x00000000005ce2c4 in Heroes::MoveStep (hero=..., index_from=1698, index_to=1699, newpos=true)
    at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/heroes/heroes_move.cpp:489
#18 0x00000000005ce557 in Heroes::MoveStep (this=0xd6caf0, fast=false) at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/heroes/heroes_move.cpp:533
#19 0x00000000005cf792 in Heroes::Move (this=0xd6caf0, fast=false) at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/heroes/heroes_move.cpp:849
#20 0x000000000057763b in Interface::Basic::HumanTurn (this=0x9759a0 <Interface::Basic::Get()::basic>, isload=true)
    at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/game/game_startgame.cpp:912
#21 0x000000000057624e in Interface::Basic::StartGame (this=0x9759a0 <Interface::Basic::Get()::basic>)
    at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/game/game_startgame.cpp:585
#22 0x00000000005737ec in Game::StartGame () at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/game/game_startgame.cpp:72
#23 0x000000000055935e in main (argc=1, argv=0x7fffffffe128) at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/game/fheroes2.cpp:291

Yet, another backtrace from casting Lightning Bolt on Dwarves:

#0  0x00007ffff666c428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54
#1  0x00007ffff666e02a in __GI_abort () at abort.c:89
#2  0x00007ffff6faf84d in __gnu_cxx::__verbose_terminate_handler() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#3  0x00007ffff6fad6b6 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#4  0x00007ffff6fad701 in std::terminate() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#5  0x00007ffff6fad919 in __cxa_throw () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#6  0x000000000040e6cd in Error::Except (func=0x67ddf0 <Surface::SetPixel(int, int, unsigned int) const::__FUNCTION__> "SetPixel", 
    message=0x19fba50 "out of range: x: 800, y: 462, width: 800, height: 600") at /home/zilvinas/Compile/fheroes2enh/src/engine/error.cpp:29
#7  0x000000000041aaab in Surface::SetPixel (this=0x9750a0 <Display::Get()::inside>, x=800, y=462, pixel=65535)
    at /home/zilvinas/Compile/fheroes2enh/src/engine/surface.cpp:562
#8  0x000000000041d7ac in Surface::DrawLine (this=0x9750a0 <Display::Get()::inside>, p1=..., p2=..., color=...)
    at /home/zilvinas/Compile/fheroes2enh/src/engine/surface.cpp:1207
#9  0x00000000004c7e9d in RedrawSparksEffects (src=..., dst=...) at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/battle/battle_interface.cpp:4205
#10 0x00000000004c8158 in Battle::Interface::RedrawTroopWithFrameAnimation (this=0x1639fd0, b=..., icn=599, m82=126, pain=true)
    at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/battle/battle_interface.cpp:4256
#11 0x00000000004c4c9e in Battle::Interface::RedrawActionLightningBoltSpell (this=0x1639fd0, target=...)
    at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/battle/battle_interface.cpp:3513
#12 0x00000000004c161c in Battle::Interface::RedrawActionSpellCastPart1 (this=0x1639fd0, spell=..., dst=54, caster=0xd6cad0, name="Ranloo", targets=...)
    at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/battle/battle_interface.cpp:2915
#13 0x0000000000482b62 in Battle::Arena::ApplyActionSpellDefaults (this=0x7fffffffd660, cmd=..., spell=...)
    at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/battle/battle_action.cpp:697
#14 0x000000000048059d in Battle::Arena::ApplyActionSpellCast (this=0x7fffffffd660, cmd=...) at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/battle/battle_action.cpp:168
#15 0x0000000000480364 in Battle::Arena::ApplyAction (this=0x7fffffffd660, cmd=...) at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/battle/battle_action.cpp:95
#16 0x0000000000488cfd in Battle::Arena::TurnTroop (this=0x7fffffffd660, current_troop=0x160d7c0)
    at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/battle/battle_arena.cpp:358
#17 0x000000000048939c in Battle::Arena::Turns (this=0x7fffffffd660) at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/battle/battle_arena.cpp:446
#18 0x00000000004cec44 in Battle::Loader (army1=..., army2=..., mapsindex=1185) at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/battle/battle_main.cpp:79
#19 0x00000000005a7813 in BattleHeroWithMonster (hero=..., army=..., dst_index=1185) at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/heroes/heroes_action.cpp:778
#20 0x00000000005a82b7 in ActionToMonster (hero=..., obj=152, dst_index=1185) at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/heroes/heroes_action.cpp:883
#21 0x00000000005a7151 in Heroes::Action (this=0xd6cad0, dst_index=1185) at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/heroes/heroes_action.cpp:506
#22 0x000000000059b74d in RedrawGameAreaAndHeroAttackMonster (hero=..., dst=1185) at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/heroes/heroes.cpp:1504
#23 0x000000000059b881 in Heroes::ActionNewPosition (this=0xd6cad0) at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/heroes/heroes.cpp:1523
#24 0x000000000059bef1 in Heroes::Move2Dest (this=0xd6cad0, dst_index=@0x7fffffffdce0: 1258, skip_action=false)
    at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/heroes/heroes.cpp:1640
#25 0x00000000005ce24b in Heroes::MoveStep (hero=..., index_from=1259, index_to=1258, newpos=true)
    at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/heroes/heroes_move.cpp:481
#26 0x00000000005ce557 in Heroes::MoveStep (this=0xd6cad0, fast=false) at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/heroes/heroes_move.cpp:533
#27 0x00000000005cf792 in Heroes::Move (this=0xd6cad0, fast=false) at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/heroes/heroes_move.cpp:849
#28 0x000000000057763b in Interface::Basic::HumanTurn (this=0x9759a0 <Interface::Basic::Get()::basic>, isload=false)
    at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/game/game_startgame.cpp:912
#29 0x000000000057624e in Interface::Basic::StartGame (this=0x9759a0 <Interface::Basic::Get()::basic>)
    at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/game/game_startgame.cpp:585
#30 0x00000000005737ec in Game::StartGame () at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/game/game_startgame.cpp:72
#31 0x000000000055935e in main (argc=1, argv=0x7fffffffe128) at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/game/fheroes2.cpp:291

Also, save file next to the graveyard. To reproduce, enter it and cast lightning bolt:
https://drive.google.com/open?id=1jBq8fS8rjBBoCSIQ3F3_46EL9F_QpDnW

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions