Fractal Softworks Forum

Please login or register.

Login with username, password and session length

Author Topic: Crash immediately after loading save [0.9.1a-RC8]  (Read 1452 times)

Fanofgaming

  • Ensign
  • *
  • Posts: 2
    • View Profile
Crash immediately after loading save [0.9.1a-RC8]
« on: August 30, 2019, 08:39:22 AM »

After several hours playing my heavily modded campaign with no problems at all, I saved and quit. Unfortunately, now when I try to re-load the save, the game loads up, flashes the screen where I was when I saved, and then immediately crashes before I can do anything. I get the following error log:

Spoiler
122021 [Thread-4] ERROR com.fs.starfarer.combat.CombatMain  - java.lang.NullPointerException
java.lang.NullPointerException
   at com.fs.starfarer.api.impl.combat.CRPluginImpl.applyMaxCRCrewModifiers(CRPluginImpl.java:48)
   at com.fs.starfarer.campaign.fleet.FleetMember.updateStatsBasedOnCrew(Unknown Source)
   at com.fs.starfarer.campaign.fleet.FleetMember.updateOnlyStatsThatCanRelyOnCROrCre w(Unknown Source)
   at com.fs.starfarer.campaign.fleet.FleetData.syncIfNeeded(Unknown Source)
   at com.fs.starfarer.campaign.fleet.FleetData.getMembers(Unknown Source)
   at com.fs.starfarer.campaign.fleet.FleetData.getMembersInPriorityOrder(Unknown Source)
   at data.scripts.campaign.II_MarketRiggerScript.advance(II_MarketRiggerScript.java:110)
   at com.fs.starfarer.campaign.CampaignEngine.advance(Unknown Source)
   at com.fs.starfarer.campaign.CampaignState.advance(Unknown Source)
   at com.fs.starfarer.BaseGameState.traverse(Unknown Source)
   at com.fs.state.AppDriver.begin(Unknown Source)
   at com.fs.starfarer.combat.CombatMain.main(Unknown Source)
   at com.fs.starfarer.StarfarerLauncher$1.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)
[close]

I am nearly certain that it's not a memory problem, as I have 24 GB of RAM on this computer and I have allocated 8 GB to Starsector. I have the following mods installed, and I believe all of them should be up to date:

Spoiler
$$$ Lightshow 1.40
$$$ Trailer Moments 0.7
Autosave 1.1

Blackrock Drive Yards 0.9.5
Celestial Mount Circle 1.2
Combat Analytics & Detailed Combat Results 4.3
Combat Chatter 1.9.2d
Common Radar 2.5

Dassault Mikoyan Engineering 1.0
Diable Avionics 2.04
Foundation of Borken 0.2.4-RC3
Hazard Mining Incorporated 0.2.1f
Interstellar Imperium 2.1.0
Kadur Remnant 3.0.3
LazyLib 2.4e
Leading Pip 1.8.3

Legacy of Arkgneisis v1.4.2
Luddic Enhancement 0.1.0c
MagicLib 0.27
Neutrino Corporation 1.85-RC4.1
Nexerelin 0.9.3b
Outer Rim Alliance 0.86
Portrait Pack v1.2.3
Ruthless Sector 1.2.1

Scy Nation 1.56
Shadowyards 0.8.7RC2
SkilledUp 1.1
SpeedUp 0.5.2

Starship Legends 1.2.1
Sylphon RnD 0.9.5d
Tyrador Safeguard Coalition 1.6.1c
Unknown Skies 0.42
Upgraded Rotary Weapons 1.41

Vayra's Sector 3.0.3
Vayra's Ship Pack 1.0.2
Vesperon Combine 1.2.0
ZZ Audio Plus 1.1.1
ZZ GraphicsLib 1.4.0
ZZ Safety Override mod v1.01

In bold are mods which I have tried removing in order to circumvent the crash. None of them worked. I tried removing other mods as well, but they just gave me different crashes due to them not being possible to remove from existing saves, I presume.
[close]

Although I can't remember exactly what I was doing when I made the save, I am very close to what I believe is a small Interstellar Imperium colony with one small patrol fleet nearby. I think the sector that I am in is called Kym? It's a core world system in which I was storing all of my contraband stockpiles.

I'm able to start a new campaign with no problems. This particular save, though, has been going really well for me and I would like to recover it if at all possible. If not, I'd at least like to know what the problem is so I don't run into it on a future save. Any help is greatly appreciated.
« Last Edit: August 30, 2019, 08:41:18 AM by Fanofgaming »
Logged

Sundog

  • Admiral
  • *****
  • Posts: 1727
    • View Profile
Re: Crash immediately after loading save [0.9.1a-RC8]
« Reply #1 on: August 30, 2019, 01:52:02 PM »

This looks like it has the same root cause as the issue reported here, which I've been trying to find a solution to for a few days now. The developer (Alex) has agreed to take a look through an affected save file, so would you be so kind as to send it to him at fractalsoftworks [at] gmail [dot] com?
(Edit: He'll need a zipped copy of your "mods" folder as well)
(Edit 2: I was too slow  ::))
« Last Edit: August 30, 2019, 01:56:57 PM by Sundog »
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24157
    • View Profile
Re: Crash immediately after loading save [0.9.1a-RC8]
« Reply #2 on: August 30, 2019, 01:55:47 PM »

(I'd need to mods/ folder as well, btw, if that's at all possible.)
Logged

Fyrmir

  • Ensign
  • *
  • Posts: 1
    • View Profile
Re: Crash immediately after loading save [0.9.1a-RC8]
« Reply #3 on: August 30, 2019, 02:04:06 PM »

Hello,

I experienced the same problem with exactly the same error log. I also tried loading backup saves (which i made about 1 minute earlier) but it gives the same result. The game dont crash immediately but about a 1 second after loading. Can i also send save files with mod folder?
« Last Edit: August 30, 2019, 02:05:39 PM by Fyrmir »
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24157
    • View Profile
Re: Crash immediately after loading save [0.9.1a-RC8]
« Reply #4 on: August 30, 2019, 02:10:09 PM »

Yes, please - I'd really appreciate it!
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24157
    • View Profile
Re: Crash immediately after loading save [0.9.1a-RC8]
« Reply #5 on: August 30, 2019, 04:02:46 PM »

Thank you for sending the save! Tracked it down; looks like the culprit is Vayra's Ship Pack. I'm not sure as to there being a workaround in the case of your save - if you disable the mod, ships will be missing (though that *may* work? the game should put in Nebula-class liners in place of missing ships). So I guess that's worth a shot. (Edit: ah, tried it, doesn't work because the mod also supplies weapons, and the game can't handle those being missing. Never mind.)

Details of problem follow:

In the mod's data.scripts.hullmods.VayraLootedTpc class, it's calling:
member.setVariant(Global.getSettings().getVariant(member.getHullId() + VARIANT), false, true);

In this case, for whatever reason, that ends up being null - there's no such variant. The hull this is happening for is "vayra_mudskipper_xiv_Hull".

Furthermore, that hullmod class has the following static data member:
public static HashMap<FleetMemberAPI, Boolean> ALREADY_SET = new HashMap<>();

That's more than likely a memory leak. This data member is static, meaning it persists across save-game reloads. FleetMemberAPIs reference other stuff so this looks like a full-campaign leak, probably possibly for it to happen multiple times over per session.

Repeating myself a bit, but, right: do not put stuff into static data members, it is very bad and is asking for a memory leak. You really need to know what you're doing and even then it's risky. If there's *any* uncertainty, don't do it. (If there's no uncertainty, also don't do it, because complete certainty is a warning sign in and of itself.)

I didn't check other hullmods or classes in the mod to see if they may cause similar issues.
Logged

Sundog

  • Admiral
  • *****
  • Posts: 1727
    • View Profile
Re: Crash immediately after loading save [0.9.1a-RC8]
« Reply #6 on: August 30, 2019, 04:07:45 PM »

Thank you so much for looking into this Alex! It was driving me crazy...

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24157
    • View Profile
Re: Crash immediately after loading save [0.9.1a-RC8]
« Reply #7 on: August 30, 2019, 04:16:41 PM »

No problem! Yeah, I bet - it was a pretty tough one to track down even with full access to the core code.
Logged

Vayra

  • Admiral
  • *****
  • Posts: 627
  • jangala delenda est
    • View Profile
Re: Crash immediately after loading save [0.9.1a-RC8]
« Reply #8 on: August 30, 2019, 07:49:35 PM »

Sorry everyone! That's already been fixed to non-static in the current version, and I just added a null check for the non-static version in the next version. Hope that solves it! <3
Logged
Kadur Remnant: http://fractalsoftworks.com/forum/index.php?topic=6649
Vayra's Sector: http://fractalsoftworks.com/forum/index.php?topic=16058
Vayra's Ship Pack: http://fractalsoftworks.com/forum/index.php?topic=16059

im gonna push jangala into the sun i swear to god im gonna do it

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24157
    • View Profile
Re: Crash immediately after loading save [0.9.1a-RC8]
« Reply #9 on: August 30, 2019, 07:54:56 PM »

(Sorry if I came off a bit harsh there, btw. Reading it back, I... probably did.)
Logged

Fanofgaming

  • Ensign
  • *
  • Posts: 2
    • View Profile
Re: Crash immediately after loading save [0.9.1a-RC8]
« Reply #10 on: August 31, 2019, 10:32:49 AM »

Thanks for the help! I'm glad I wasn't the only person with this issue and I'm really glad that it was able to be tracked down. Much obliged!
Logged