Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken Hills mine memory crash #63

Closed
gterror opened this issue Sep 12, 2020 · 7 comments
Closed

Broken Hills mine memory crash #63

gterror opened this issue Sep 12, 2020 · 7 comments

Comments

@gterror
Copy link

gterror commented Sep 12, 2020

SLOT09.zip
debug.log

Every time i enter the mine, the damage from the gas, which ticks, crashes the game to desktop. Using the latest rpu version with no alteration to sfall.

@burner1024
Copy link
Member

reporting crashes

@gterror
Copy link
Author

gterror commented Sep 13, 2020

It seems that when i take the script file from the original killap RP 2.3.3 and copy it to scripts folder, the crash will be gone. I thought that its not needed to install the original version?

@burner1024
Copy link
Member

I thought that its not needed to install the original version?

That is correct. It is likely a newly-introduced one.
I can reproduce the crash. For the time being, working around it with the old script should do fine, with no side effects.

@burner1024
Copy link
Member

I modified the script to get some debug: broken2.int.zip. For some reason, party_member_list_critters returns null pointers. I don't think it's supposed to do that.

procedure CauseDamage begin
   variable who;
   ndebug("test0");
   foreach who in party_member_list_critters begin
      ndebug("who is " + who);
      ndebug("dude is " + dude_obj);
      ndebug("who name is " + obj_name(who));
      if not wearing_protective_gear(who)
         and critter_kill_type(who) != KILL_TYPE_robot_kills
      then begin
         ndebug("test1");
         apply_radon_damage(who)
         ndebug("test2");
      end
   end
end
broken2: test0

broken2: who is 37695152

broken2: dude is 37695152

broken2: who name is Marcus

broken2: test1

broken2: test3
Loading sound file monitor.ACM...succeeded.

broken2: test4

broken2: test2

broken2: who is 0

broken2: dude is 37695152
Script Error: scripts\broken2.int: op_obj_name: obj is NULL
broken2: who name is Marcus

OPCODE ERROR: critter_inven_obj2() - argument #1 is null.
 > Script: scripts\broken2.int, procedure <couldn't find proc>.Script Error: scripts\broken2.int: op_obj_pid: obj is NULL
OPCODE ERROR: critter_inven_obj2() - argument #1 is null.
 > Script: scripts\broken2.int, procedure <couldn't find proc>.Script Error: scripts\broken2.int: op_obj_pid: obj is NULL
OPCODE ERROR: critter_inven_obj2() - argument #1 is null.
 > Script: scripts\broken2.int, procedure <couldn't find proc>.Script Error: scripts\broken2.int: op_obj_pid: obj is NULL
OPCODE ERROR: critter_inven_obj2() - argument #1 is null.
 > Script: scripts\broken2.int, procedure <couldn't find proc>.Script Error: scripts\broken2.int: op_obj_pid: obj is NULL
OPCODE ERROR: critter_inven_obj2() - argument #1 is null.
 > Script: scripts\broken2.int, procedure <couldn't find proc>.Script Error: scripts\broken2.int: op_obj_pid: obj is NULL

@FakelsHub @NovaRain any idea why that happens?

@NovaRain
Copy link

NovaRain commented Sep 14, 2020

The crash address 0x42D940 is in critter_kill_count_type_. If I remove the critter_kill_type(who) != KILL_TYPE_robot_kills check, the crash will be gone, but I also notice other party members don't receive any damage.

I tried to recreate the crash like this:

// The instruction at 0042d940 referenced memory at 00000064
// The memory could not be read from
foreach who in party_member_list_critters begin
   display_msg("Name is " + obj_name(who));
   display_msg("Kill type: " + critter_kill_type(who));
   critter_dmg(who, 2, DMG_normal_dam BWOR DMG_NOANIMATE BWOR DMG_BYPASS_ARMOR);
end

Removing the critter_dmg line: the name and kill type are displayed for everyone (I got Sulik, Vic, and Cassidy in party).
Removing the critter_kill_type line: only the player's name gets displayed and the player receives 2 point of damage.
Leaving only the critter_dmg line: only the player receives 2 point of damage.

EDIT: and this crash seems to happen on all reasonably available versions (tried old 3.6, 3.8.x, 4.x)

EDIT 2: another simple test:

key := [1, 2, 3, 4, 5];
foreach i in key begin
   display_msg("Number " + i);
   critter_dmg(dude_obj, i, DMG_normal_dam BWOR DMG_NOANIMATE BWOR DMG_BYPASS_ARMOR);
end

The loop works only for the first time; the rest of it are all zero. It seems there's some conflict between critter_dmg and looping through an array.

@burner1024
Copy link
Member

OK, it seems that the script isn't at fault then. I opened an issue in sfall repo.

@burner1024
Copy link
Member

should be fixed now, with latest sfall

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants