Laserbrain Studios

Games Forum Blog Contact

Author Topic: Application crash  (Read 2847 times)

thenewguy

  • Newbie
  • *
  • Posts: 34
    • View Profile
Application crash
« on: October 04, 2012, 02:38:13 PM »
This bug is a tough one as it doesn't happen every time, but about 50% of the time.

Steps to reproduce bug:
1. Walk into building.
2. Pull out gun to scare away receptionist.
3. Loot locked office behind receptionist.
4. Walk to room with receptionist and fire shots, scaring, but not killing the receptionist.
5. Wait for armed guards to arrive in the lobby.
6. Game crashes about 50% of the time as the guards enter the room.

Output from crash:
The game window closes and the following text appears on the console:

An unhandled exception occurred at $0000000000550C0D :
ERangeError : Range check error
  $0000000000550C0D line 2105 of pathing.pas
  $00000000004562C4 line 1573 of hostile.pas
  $000000000048F9E1 line 8436 of hostile.pas


Platform:
Ubuntu 12.04 64-bit, running Hostile Takeover 0.1.2 for Linux 64-bit.

Christian Knudsen

  • Administrator
  • Ace
  • *****
  • Posts: 3014
    • View Profile
Re: Application crash
« Reply #1 on: October 04, 2012, 05:17:48 PM »
Yeah, this is a tough one. You wouldn't happen to have a game saved right before the guards run in to the room and crash the game? If you do, can you email it to me?

thenewguy

  • Newbie
  • *
  • Posts: 34
    • View Profile
Re: Application crash
« Reply #2 on: October 04, 2012, 05:46:49 PM »
I don't have a saved game at that point, but I will try to make one.
By the way, trying to load a saved game on my machine also causes a crash. Any attempt to load an existing game produces the following error:
An unhandled exception occurred at $0000000000472956 :
ERangeError : Range check error
  $0000000000472956 line 4805 of hostile.pas
  $000000000048F72D line 8389 of hostile.pas

Christian Knudsen

  • Administrator
  • Ace
  • *****
  • Posts: 3014
    • View Profile
Re: Application crash
« Reply #3 on: October 04, 2012, 05:58:35 PM »
Yikes! I feel like a Starship Trooper... Bugs everywhere!

When the game crashes after trying to load, does it say anything in the log.txt file? It almost sounds like there's no access to the save file.

thenewguy

  • Newbie
  • *
  • Posts: 34
    • View Profile
Re: Application crash
« Reply #4 on: October 04, 2012, 06:59:29 PM »
No, nothing in the log file. The last entry in the log file was
"Setting up framebuffer objects...
OK"

I checked the permissions on the save files and I have full read/write access and full access to the "saves" directory. For each saved game there are two files, a .sav and a .bmp file. I can open them using a text editor, or printing them to a terminal. When I'm in the game I can get to the Load Game screen and it shows there are games which I could (in theory) load. However, clicking on one of the games causes the game to shut down with the above exception error.

Christian Knudsen

  • Administrator
  • Ace
  • *****
  • Posts: 3014
    • View Profile
Re: Application crash
« Reply #5 on: October 04, 2012, 07:13:12 PM »
Hmm. Guess I'll have to go through the code with a fine comb, then.

Christian Knudsen

  • Administrator
  • Ace
  • *****
  • Posts: 3014
    • View Profile
Re: Application crash
« Reply #6 on: October 04, 2012, 07:53:15 PM »
If I comment out all the code that reads the save game information, I get the exact same crash. So for some reason, the save file isn't read correctly for you. Can I email you an executable that does some extra checks when opening the save file? Hopefully it should write to the log.txt file when the game crashes.

thenewguy

  • Newbie
  • *
  • Posts: 34
    • View Profile
Re: Application crash
« Reply #7 on: October 04, 2012, 08:13:00 PM »
Sure thing, I'd be happy to give it further testing. You can e-mail me at jessefrgsmith at yahoo.ca

By the way, I haven't managed to get a save file just before a crash, but I did encounter another crash which seems to be related to the AI. Once again, I was on the ground floor, shooting at people, trying get the guards to come down. One of the AI guards came down stairs, we met at the door to the washroom on the ground floor level. The output from the crash was

An unhandled exception occurred at $00000000004C2A89 :
ERangeError : Range check error
  $00000000004C2A89 line 1193 of ai.pas
  $00000000004D202A line 2160 of ai.pas
  $000000000048F9D2 line 8433 of hostile.pas

Christian Knudsen

  • Administrator
  • Ace
  • *****
  • Posts: 3014
    • View Profile
Re: Application crash
« Reply #8 on: October 04, 2012, 08:51:10 PM »
I've sent you an email with a new executable. If you can get the game to crash when loading and then paste what it says in the log.txt file here, that'd be great.

And thanks for posting that other crash as well. I've found what was causing it. When being blocked by you and spotting you at the same time, the guard's current order was removed twice instead of just once. So when the code tried to access the guard's current order, there wasn't any, since all orders had been removed instead of just the latest one. Crap. That wasn't it.
« Last Edit: October 04, 2012, 09:29:19 PM by Christian Knudsen »

Christian Knudsen

  • Administrator
  • Ace
  • *****
  • Posts: 3014
    • View Profile
Re: Application crash
« Reply #9 on: October 23, 2012, 03:57:58 PM »
This bug is a tough one as it doesn't happen every time, but about 50% of the time.

Steps to reproduce bug:
1. Walk into building.
2. Pull out gun to scare away receptionist.
3. Loot locked office behind receptionist.
4. Walk to room with receptionist and fire shots, scaring, but not killing the receptionist.
5. Wait for armed guards to arrive in the lobby.
6. Game crashes about 50% of the time as the guards enter the room.

Output from crash:
The game window closes and the following text appears on the console:

An unhandled exception occurred at $0000000000550C0D :
ERangeError : Range check error
  $0000000000550C0D line 2105 of pathing.pas
  $00000000004562C4 line 1573 of hostile.pas
  $000000000048F9E1 line 8436 of hostile.pas


Platform:
Ubuntu 12.04 64-bit, running Hostile Takeover 0.1.2 for Linux 64-bit.

In testing for some other bugs, I accidentally stumbled upon this one! The part of the code where it crashes is related to the character's pathfinding. Basically, the character's 'route' is empty when the code tries to fetch the next direction to walk in.

I've narrowed it down to being an issue of two characters sharing the same route number. So what happens is that one of the characters reaches a point where he has to calculate a new route for some reason, and in doing so resets the old route to zero (to clear it up for future use). And that leaves the other character with a route that's suddenly empty -- game crashes. I'm not entirely sure how this can happen, yet, but I'm sure some fine combing will reveal the answer...