project-navigation
Personal tools

Author Topic: Crash/Freeze when killing last enemy  (Read 13127 times)

Offline dekster

  • Rookie
  • ***
  • Posts: 11
    • View Profile
Re: Crash/Freeze when killing last enemy
« Reply #15 on: April 19, 2011, 07:24:30 am »
Look at screen!
System: WinXP/32 bit
Command for logging: logfile 2
Game ver.:ufoai-2.4-dev-1301086950-Debug-pentium3-O1-sse-7z-full-win32.exe
The error appears when I press to finish a course after murder of last enemy.
« Last Edit: April 19, 2011, 07:45:18 am by dekster »

Offline Destructavator

  • Combination Multiple Specialty Developer
  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 1908
  • Creater of Scorchcrafter, knows the zarakites...
    • View Profile
Re: Crash/Freeze when killing last enemy
« Reply #16 on: April 19, 2011, 08:13:12 am »
OK, confirmed in a recent compile on Windows (NOT Muton's last build that IIRC is ~ a month old).

Pressing the "end turn" key right after killing the last alien, but before any resolution-type of screen comes up, freezes the game.

I could do this by simply starting a skirmish that only had one alien to start with.

Offline OmniscientQ

  • Rookie
  • ***
  • Posts: 18
    • View Profile
Re: Crash/Freeze when killing last enemy
« Reply #17 on: April 20, 2011, 06:33:58 pm »
I'll toss in my experience with this bug as well. I'm running Vista and 2.4-dev. I installed the game using http://ufoai.ninex.info/snapshots/ufoai-latest-win32.exe , and updated just the binaries on April 11 with http://ufoai.ninex.info/snapshots/ufoai-latest-win32.zip .

You can actually issue commands after the last alien is killed, but only for a brief moment. The freeze occurs if you try to take action while the game is adding up experience points for that mission, which starts ~1 second after the last kill. As a workaround, I've started opening up the console after a few kills to see if it's running the experience totals. That's where the delay between the last kill and the victory screen comes from.

I can share my ufoconsole.log if needed. I just intentionally froze the game and the log file has no error messages. It cuts off with the experience points it had totaled when I told one of my soldiers to move, that's it. It occurs reliably in campaign and skirmish mode.

Offline Destructavator

  • Combination Multiple Specialty Developer
  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 1908
  • Creater of Scorchcrafter, knows the zarakites...
    • View Profile
Re: Crash/Freeze when killing last enemy
« Reply #18 on: April 20, 2011, 07:09:35 pm »
OK, it might be time to dust off ye olde GNU debugger.  I admit I haven't done so in quite some time, I'll have to see if I can get it (the debugger) working again.

Does anyone running a NON-Windows OS have this issue, if they follow the steps mentioned?

I also use *buntu Linux on some of my systems, but I don't have UFO: AI set up on them at the moment.

Offline OmniscientQ

  • Rookie
  • ***
  • Posts: 18
    • View Profile
Re: Crash/Freeze when killing last enemy
« Reply #19 on: April 26, 2011, 07:02:06 pm »
Having just made the transition from playing UFO on Windows Vista to playing it on Fedora, I noticed that the experience points are calculated almost instantly under Fedora. The total time between the last alien dying and the victory screen appearing is around two seconds, and virtually none of it is from the experience points. In Windows, it could take upwards of 10 seconds to total the experience. If most of our developers are using Linux to play the game, then this might explain why they have trouble reproducing the bug for themselves.

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: Crash/Freeze when killing last enemy
« Reply #20 on: April 26, 2011, 09:33:01 pm »
check this out dodon provided an explanation. we just need a windows coder who is able to fix it

Offline Kobura

  • Rookie
  • ***
  • Posts: 31
    • View Profile
Re: Crash/Freeze when killing last enemy
« Reply #21 on: April 29, 2011, 12:31:32 pm »
My temporary "hotfix" is every time I kill an alien after 2-3 (fighters and scouts) or 4-5 (harvesters and up) go get a sandwich. If the game is still running there's at least one more.

I can move the mouse usually, though, without a crash. Are these seperate issues? (game taking up to a minute or so to register all enemies dead [not up to incapacitation yet so can't offer insight] and end mission?)

Offline GIJOE317

  • Rookie
  • ***
  • Posts: 56
    • View Profile
Re: Crash/Freeze when killing last enemy
« Reply #22 on: April 29, 2011, 07:06:18 pm »
I had a similar issue when killing the last enemy.
The round ended abruptly, and the Firebird went back to base to refuel.
No bonus, no promotions, and no ship acquired.

Offline jo0ls

  • Cannon Fodder
  • **
  • Posts: 1
    • View Profile
Re: Crash/Freeze when killing last enemy
« Reply #23 on: May 07, 2011, 02:00:35 am »
I got this bug. I messed with SendNotifyMessage to fix it, then found tlh2000s patch which is ok so far. I manually applied the patch as I've not figured out git yet. I've done about 5 missions and gone a tad crazy at the controls after killing the last alien. It's much faster counting up the stats and exiting.

Hmm, maybe I spoke too soon. I now occasionally get this lot when the mission ends:

Code: [Select]
======start======
Date: 2011-05-07
Windows version 6.1 (Build 7601) Service Pack 1
Win32 RELEASE

0x4c5213 : C:\msysgit\ufoai\ufo.exe : C:/msysgit/ufoai/src/common/dbuffer.c (291) : in function (dbuffer_add)
0x4e773e : C:\msysgit\ufoai\ufo.exe : C:/msysgit/ufoai/src/server/sv_log.c (54) : in function (SV_LogAdd)
0x4e6ddc : C:\msysgit\ufoai\ufo.exe : C:/msysgit/ufoai/src/server/sv_game.c (45) : in function (SV_dprintf)
0x6b4592df : C:\msysgit\ufoai\base\game.dll : C:/msysgit/ufoai/src/game/g_utils.c (252) : in function (G_PrintStats)
0x6b4524e5 : C:\msysgit\ufoai\base\game.dll : C:/msysgit/ufoai/src/game/g_match.c (141) : in function (G_UpdateCharacterSkills)
0x6b4527cc : C:\msysgit\ufoai\base\game.dll : C:/msysgit/ufoai/src/game/g_match.c (225) : in function (G_MatchSendResults)
0x6b452b73 : C:\msysgit\ufoai\base\game.dll : C:/msysgit/ufoai/src/game/g_match.c (312) : in function (G_MatchDoEnd)
0x6b451f92 : C:\msysgit\ufoai\base\game.dll : C:/msysgit/ufoai/src/game/g_main.c (442) : in function (G_RunFrame)
0x4e60fd : C:\msysgit\ufoai\ufo.exe : C:/msysgit/ufoai/src/server/sv_game.c (566) : in function (SV_RunGameFrame)
0x4e6e20 : C:\msysgit\ufoai\ufo.exe : C:/msysgit/ufoai/src/server/sv_game.c (552) : in function (SV_RunGameFrameThread)
Failed to get file flags from (C:\development\codeblocks\MinGW\bin\SDL.dll) File in wrong format
0x6810a4ac : C:\development\codeblocks\MinGW\bin\SDL.dll : SDL_strtod
Failed to get file flags from (C:\development\codeblocks\MinGW\bin\SDL.dll) File in wrong format
0x6813ee09 : C:\development\codeblocks\MinGW\bin\SDL.dll : SDL_SemPost
Failed to get file flags from (C:\Windows\syswow64\msvcrt.dll) File in wrong format
0x76b61287 : C:\Windows\syswow64\msvcrt.dll : itow_s
Failed to get file flags from (C:\Windows\syswow64\msvcrt.dll) File in wrong format
0x76b61328 : C:\Windows\syswow64\msvcrt.dll : endthreadex
Failed to get file flags from (C:\Windows\syswow64\kernel32.dll) File in wrong format
0x764a33ca : C:\Windows\syswow64\kernel32.dll : BaseThreadInitThunk
Failed to get file flags from (C:\Windows\SysWOW64\ntdll.dll) File in wrong format
0x774f9ed2 : C:\Windows\SysWOW64\ntdll.dll : RtlInitializeExceptionChain
Failed to get file flags from (C:\Windows\SysWOW64\ntdll.dll) File in wrong format
0x774f9ea5 : C:\Windows\SysWOW64\ntdll.dll : RtlInitializeExceptionChain
======end========

Code: [Select]
#0 00000000 0x004c5213 in dbuffer_add(buf=0x1fc2297c, data=0x173ff925 "nts in skill #1 (total experience: 857) (C:\msysgit\ufoai\src\common\dbuffer.c:291)
#1 004E773E SV_LogAdd(format=0x6b48dfe7 "[STATS] %s\n", ap=0x173ffd24 "@\022Sk") (C:\msysgit\ufoai\src\server\sv_log.c:53)
#2 004E6DDC SV_dprintf(fmt=0x6b48dfe7 "[STATS] %s\n") (C:\msysgit\ufoai\src\server\sv_game.c:43)
#3 00000000 0x6b4592df in G_PrintStats(buffer=0x6b531240 "Soldier Oksana Seidl earned 49 experience points in skill #1 (total experience: 857) (C:\msysgit\ufoai\src\game\g_utils.c:251)
#4 6B4524E5 G_UpdateCharacterSkills(chr=0x100628d8) (C:\msysgit\ufoai\src\game\g_match.c:149)
#5 6B4527CC G_MatchSendResults(team=1) (C:\msysgit\ufoai\src\game\g_match.c:225)
#6 6B452B73 G_MatchDoEnd() (C:\msysgit\ufoai\src\game\g_match.c:311)
#7 6B451F92 G_RunFrame() (C:\msysgit\ufoai\src\game\g_main.c:442)
#8 004E60FD SV_RunGameFrame() (C:\msysgit\ufoai\src\server\sv_game.c:566)
#9 004E6E20 SV_RunGameFrameThread(data=0x0) (C:\msysgit\ufoai\src\server\sv_game.c:551)
#10 6810A4AC SDL_strtod() (c:\development\codeblocks\MinGW\bin\SDL.dll:??)
#11 00000000 0x0867a8f8 in ??() (??:??)

« Last Edit: May 07, 2011, 03:39:31 am by jo0ls »

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: Crash/Freeze when killing last enemy
« Reply #24 on: May 07, 2011, 08:03:46 am »
yes the dbuffer is not yet locked - this is a todo comment in latest revision

can you send a patch for your SendNotifyMessage solution?

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: Crash/Freeze when killing last enemy
« Reply #25 on: May 07, 2011, 10:23:45 am »
the lock is now in our git repo - please retry and report any remaining problems

Offline Kobura

  • Rookie
  • ***
  • Posts: 31
    • View Profile
Re: Crash/Freeze when killing last enemy
« Reply #26 on: May 08, 2011, 12:37:48 am »
How is this applied? (Let's start with assuming I know nothing about coding but advanced general computer use) This bug is my #1 enemy recently.

Offline Muton

  • Sergeant
  • *****
  • Posts: 496
    • View Profile
Re: Crash/Freeze when killing last enemy
« Reply #27 on: May 08, 2011, 08:38:35 am »
@Mattn

The bug is fixed!
A patch is available in the "Win32 Development Binary Installer Links" topic ....

---------------------------------

git checkout .
reverse your mods (they are lost)

git checkout master
if you are not on the master branch

git fetch
to get all updates

git pull --rebase
to apply fetched updates to your current branch

but thats the wrong forum to ask
do it there


Offline Kobura

  • Rookie
  • ***
  • Posts: 31
    • View Profile
Re: Crash/Freeze when killing last enemy
« Reply #28 on: May 09, 2011, 04:06:15 am »
Fix appears to break in-base radar

*EDIT* Fix appears to permanently break all the in-base radar in the savefile the first time a UFO wanders out of radar range, and also seems to remove the ability to find missions as they're happening. Definitely still losing aircraft though.
« Last Edit: May 09, 2011, 05:44:31 am by Kobura »