UFO: Alien Invasion Issue Tracker
UFO: Alien Invasion
Go to the previous open issue
Go to the previous issue (open or closed)
star_faded.png
Please log in to bookmark issues
icon_project.png UFO: Alien Invasion / Closed Bug report #3143 Game crashes when alien commences reaction fire
Go to the next issue (open or closed)
Go to the next open issue
This issue has been closed with status "Closed" and resolution "RESOLVED".
Issue basics
  • Type of issue
    Bug report
  • Category
    Battlescape
  • Targetted for
    Not determined
  • Status
    Closed
  • Progress
  • Priority
    4. Useful
User pain
  • Type of bug
    Not triaged
  • Likelihood
    Not triaged
  • Effect
    Not triaged
Affected by this issue (0)
There are no items
People involved
Times and dates
  • Posted at
  • Last updated
  • Estimated time
    Not estimated
  • Time spent
    2 days, 400 hours
    Click here to see time logged against this issue
Issue details
  • Resolution
    RESOLVED
  • Reproducability
    Not determined
  • Severity
    Not determined
  • Complexity
    Not determined
  • Platform
    Not determined
  • Architecture
    Not determined
Attachments (0)
There is nothing attached to this issue
Duplicate issues (0)
This issue does not have any duplicates
Description
[http://sourceforge.net/p/ufoai/bugs/3143 Item 3143] imported from sourceforge.net tracker on 2013-01-28 20:02:17

While one of my soldiers was moving, the game crashed with an error message:

ufo: src/game/g_actor.c:148: G_ActorGetTUForReactionFire: Assertion `invlistWeapon' failed.
Error: Received signal 6.

Up-to-date master, latest commit:

commit c36167dfbc6cc4f0e15d4757dd7b995866a3fb10
Author: mcr2010 <mcr2010@users.sourceforge.net>
Date: Thu Feb 9 23:32:46 2012 +0100

Will proceed with gdb debugging. Attaching ufoconsole.log first.

===== Comments Ported from Sourceforge =====

====== *anonymous (2012-02-10 13:40:05) ======

ufoconsole.log
====== *anonymous (2012-02-10 13:40:32) ======

backtrace
====== *anonymous (2012-02-10 13:41:06) ======

Finally managed to reproduce while running gdb. Backtrace attached.
====== astraljava (2012-02-10 14:46:54) ======

Made a mistake of reporting this bug while logged in with my openID, which wasn&#039;t yet linked to my real account. So the user hasn&#039;t actually gone away, just that account has.
====== aduke1 (2012-02-10 20:31:46) ======

what kind of weapon did the alien have ?
what can *I* do to reproduce it ?
====== astraljava (2012-02-11 00:39:26) ======

I am not sure, but I think it was plasma pistol(s). I can try to reproduce it again tomorrow, and pay attention to the weaponry.

I did nothing special. Just moved my soldier in front of the aliens, and seemed like one of them got triggered with the reaction fire. At this point, unfortunately, I can&#039;t give better info.
====== tlh2000 (2012-02-13 07:32:57) ======

found crashdumps for 2.3.1 and 2.4 - so it looks like this bug is older.

0x767167bc : C:\Windows\syswow64\msvcrt.dll : assert
0xebb154f : C:\Program Files (x86)\UFOAI-2.3.1\base\game.dll : G_ActorGetTUForReactionFire
0xebc8009 : C:\Program Files (x86)\UFOAI-2.3.1\base\game.dll : G_ReactionFireSettingsReserveTUs
0xebc857c : C:\Program Files (x86)\UFOAI-2.3.1\base\game.dll : G_ReactionFireOnMovement
0xebc6e32 : C:\Program Files (x86)\UFOAI-2.3.1\base\game.dll : G_ClientMove
0xebb8fe3 : C:\Program Files (x86)\UFOAI-2.3.1\base\game.dll : G_ClientAction
0x50a47a : C:\Program Files (x86)\UFOAI-2.3.1\ufo.exe : /home/users/mattn/localslave/src-master/src/src/server/sv_user.c (276) : in function (SV_ExecuteClientMessage)

0x6a601503 : C:\Users\Public\UFOAI-2.4-dev\base\game.dll : C:\UFOAIwin32BUILDenv\MinGW\ufoai/src/game/g_actor.c (149) : in function (G_ActorGetTUForReactionFire)
0x6a6130b9 : C:\Users\Public\UFOAI-2.4-dev\base\game.dll : C:\UFOAIwin32BUILDenv\MinGW\ufoai/src/game/g_reaction.c (472) : in function (G_ReactionFireTargetsUpdateAll)
0x6a613539 : C:\Users\Public\UFOAI-2.4-dev\base\game.dll : C:\UFOAIwin32BUILDenv\MinGW\ufoai/src/game/g_reaction.c (653) : in function (G_ReactionFireOnMovement)
0x6a612388 : C:\Users\Public\UFOAI-2.4-dev\base\game.dll : C:\UFOAIwin32BUILDenv\MinGW\ufoai/src/game/g_move.c (444) : in function (G_ClientMove)
0x6a607d2d : C:\Users\Public\UFOAI-2.4-dev\base\game.dll : C:\UFOAIwin32BUILDenv\MinGW\ufoai/src/game/g_client.c (665) : in function (G_ClientAction)
====== tlh2000 (2012-02-13 07:38:55) ======

i think the problem is in G_ReactionFireTargetsUpdateAll

it does not check for a valid reaction fire setting at all (e.g. the hand, or whether the actor in question has a weapon in that hand)
====== tlh2000 (2012-02-13 07:41:04) ======

a call to G_ActorHasWorkingFireModeSet before calling G_ActorGetTUForReactionFire should fix the issue imo
====== tlh2000 (2012-02-13 07:47:04) ======

maybe the G_ActorHasWorkingFireModeSet call should also be added to G_ReactionFireIsPossible.
====== aduke1 (2012-02-13 23:53:15) ======

Janne,
any news on how to reproduce ?
====== astraljava (2012-02-14 05:06:27) ======

Unfortunately not. It seems to be completely random, but I&#039;m sure it&#039;s not. All I can think of, also partly from Martin&#039;s investigations, is that perhaps the alien wants to reaction-shoot with a hand that doesn&#039;t have a weapon. I vaguely seem to remember that in one possible case, the alien in question had one plasma pistol, but am not sure whether there was anything in the other hand.

I haven&#039;t had time to try this for a couple of days, but I&#039;ll try to do so tonight (Tue, UTC+2 time).
====== aduke1 (2012-02-14 23:33:25) ======

I applied a fix today (2006ca4ee4869da87ba0fecfbe1bc761c323d894) using the STATE_REACTION in the hope that this state is maintained properly.

Please continue trying to reproduce and report.
====== accumulator (2012-02-15 20:40:08) ======

commit 2006ca4ee4869da87ba0fecfbe1bc761c323d894 won&#039;t solve it, since the same G_IsReaction check is done in G_ReactionFireIsPossible

I&#039;m testing a patch now, that performs a check on the assert condition in G_ReactionFireIsPossible and denies the actor from doing reaction fire (so avoiding the assert), but the root cause is probably that the chrFiremodeSettings_t struct isn&#039;t reset (fmIdx? hand?) when the actor somehow drops weapon, or switches to a hand having no weapon.

====== accumulator (2012-02-15 21:39:08) ======

applied 214b7e5567be804bfb9cf0c6baee4f4f0ce166e6

it should avoid triggering the assert, but a "Reaction fire enabled but no weapon for hand" in the console indicates it would have..

====== shipit (2012-02-18 10:55:46) ======

After some days off I rebuilt the whole game yesterday. While testing some map-tile today the game crashed.

2012/02/18 11:24:12 Team 1&#039;s round started!
2012/02/18 11:24:15 ********************
2012/02/18 11:24:15 ERROR: Game Error: Reaction fire enabled but no weapon for hand
2012/02/18 11:24:15 ********************
2012/02/18 11:24:15 Shutdown server: Server crashed.


====== shipit (2012-02-18 10:57:26) ======


====== accumulator (2012-02-18 11:41:06) ======

Ah it seems gi.Error exits the game, I&#039;ll replace it with some (more detailed) logging that doesn&#039;t kill the game :)


====== accumulator (2012-02-18 12:39:45) ======

applied 4f8f8c26616721ffef05f09391cefd8b3c6dea81

Now it shouldn&#039;t &#039;crash&#039; the game, and print more detailed output of the character name, its reaction fire mode and hand.
====== shipit (2012-02-18 14:03:47) ======

Did not yet update the game after that last commit. But it happend twice since my last report, each time the alien was holding a plasma blade.

Short explanation : When testing new map tiles I use an &#039;alien-container&#039; to keep the alien on its place. It can see, but not shoot through the walls. As it could not move, the sheevar tried to throw his plasma blade, leaving him with no weapon for the next turn.
====== shipit (2012-02-18 15:35:24) ======

Now up-to-date master, game does not &#039;crash&#039; anymore. Confirmed plasma blade as described before. Attached ufoconsole.log.
====== shipit (2012-02-18 15:36:06) ======


====== accumulator (2012-02-18 16:42:37) ======

nice find, with the throwing! I think the root cause is that the reaction fire state isn&#039;t reset when an alien throws its weapon. Or the hand isn&#039;t switched to the hand which still has a weapon.

So a possibe improvement would be to check for the other hand if the active hand has no weapon, although I don&#039;t know if that&#039;s intended, RF with the non-active hand..




====== shipit (2012-02-19 11:57:36) ======

I forgot to mention that I can easily reproduce this. If such a map is needed, just tell me.
====== accumulator (2012-02-19 12:25:44) ======

thanks shipit.

For now I will leave this bug marked as &#039;Fixed&#039; & &#039;Pending&#039;. It shouldn&#039;t make trouble in the game anymore, but we can mark it Closed once the reaction fire state is properly updated in case an alien throws its weapon.
====== aduke1 (2012-09-20 21:21:17.811000) ======

- **status**: pending --> open
Steps to reproduce this issue
Nothing entered.
Todos (0 / 0)
Issue created
footer_logo.png The Bug Genie 4.3.1 | Support | Feedback spinning_16.gif