Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.97a is out! (02/02/24); New blog post: Simulator Enhancements (03/13/24)

Pages: 1 [2]

Author Topic: Global.getSector().isInNewGameAdvance()  (Read 7804 times)

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: Global.getSector().isInNewGameAdvance()
« Reply #15 on: May 30, 2017, 11:47:03 AM »

Nope, whether it's Tutorial or not, it's just luck whether it crashes or not.
Logged
Please check out my SS projects :)
Xeno's Mod Pack

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Global.getSector().isInNewGameAdvance()
« Reply #16 on: May 30, 2017, 11:54:18 AM »

Created a new game a bunch of times with the requisite mods, no crashes. Both with tutorial on and off.

(Latest downloads of FX, Rebal A/B/C, EZ Faction, Explorer Society)

If there's no exception in the log and no hs_err file, that's... not great. Means a jvm crash serious enough that it couldn't generate its own crash log (the hs_err file). Probably worth taking a look at the windows event log, in the applications section - that may have some info.
Logged

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: Global.getSector().isInNewGameAdvance()
« Reply #17 on: May 30, 2017, 11:59:38 AM »

Wow, that's super-weird.  OK.
Logged
Please check out my SS projects :)
Xeno's Mod Pack

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: Global.getSector().isInNewGameAdvance()
« Reply #18 on: May 30, 2017, 02:03:56 PM »

OK... I've gotten home and tried some things out.

It locks very consistently here if you have FX Plugin installed and there's anything going on, combat-wise, on the screen. 

Pretty sure that's a clue, but you keep telling me there's no way the scripts are running, so I'm pretty confused as to what's going on.
Logged
Please check out my SS projects :)
Xeno's Mod Pack

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: Global.getSector().isInNewGameAdvance()
« Reply #19 on: May 30, 2017, 03:30:14 PM »

I've looked at the Event Log:
Code
Log Name:      Application
Source:        Application Hang
Date:          5/30/2017 4:48:17 PM
Event ID:      1002
Task Category: (101)
Level:         Error
Keywords:      Classic
User:          N/A
Computer:      x-2
Description:
The program java.exe version 7.0.790.15 stopped interacting with Windows and was closed. To see if more information about the problem is available, check the problem history in the Security and Maintenance control panel.
 Process ID: 40b0
 Start Time: 01d2d985a888bb32
 Termination Time: 6
 Application Path: D:\Program Files (x86)\Fractal Softworks\Starsector\jre\bin\java.exe
 Report Id: ef6c25a2-a061-4314-8a63-6284228c3b96
 Faulting package full name:
 Faulting package-relative application ID:

Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name="Application Hang" />
    <EventID Qualifiers="0">1002</EventID>
    <Level>2</Level>
    <Task>101</Task>
    <Keywords>0x80000000000000</Keywords>
    <TimeCreated SystemTime="2017-05-30T20:48:17.901517600Z" />
    <EventRecordID>1283</EventRecordID>
    <Channel>Application</Channel>
    <Computer>x-2</Computer>
    <Security />
  </System>
  <EventData>
    <Data>java.exe</Data>
    <Data>7.0.790.15</Data>
    <Data>40b0</Data>
    <Data>01d2d985a888bb32</Data>
    <Data>6</Data>
    <Data>D:\Program Files (x86)\Fractal Softworks\Starsector\jre\bin\java.exe</Data>
    <Data>ef6c25a2-a061-4314-8a63-6284228c3b96</Data>
    <Data>
    </Data>
    <Data>
    </Data>
    <Binary>55006E006B006E006F0077006E0000000000</Binary>
  </EventData>
</Event>
« Last Edit: May 30, 2017, 03:31:46 PM by xenoargh »
Logged
Please check out my SS projects :)
Xeno's Mod Pack

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: Global.getSector().isInNewGameAdvance()
« Reply #20 on: May 30, 2017, 04:12:13 PM »

OK, here are things:

I've noticed that every "day" simulated adds nearly 20MB to the game's RAM allocation.  This memory is assigned, but is never released, so far as I can tell.  This might be a problem.

Starting multiple New Games just keeps expanding the number.  The initial New Game ends up at very near 2048MB; clearly, this is why I was having problems with 32-bit the minute I added any mods.

I tried this out in vmparams:
Code
-XgcPrio:pausetime

That resulted in a lot more starts before the crash, suggesting that garbage collection might be an issue. 

But when I had a ship on the screen that had been firing as of the moment I clicked "start game", boom, dead again.

So, I tried a line of code in each of the advance() things causing problems...
Code
if(!engine.isInCampaign() && !engine.isInCampaignSim() && !engine.isMission()) return;

And, wow!  I had FX mod images on the screen, but the game finished the "days" sequence.  Five times in a row. 

Sooooo... there's something.  But from what you've told me, that something is impossible?
Logged
Please check out my SS projects :)
Xeno's Mod Pack

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Global.getSector().isInNewGameAdvance()
« Reply #21 on: May 30, 2017, 05:19:05 PM »

I'd be careful about drawing conclusions re: memory allocation - depending on what tools you're using to check it, the apparent results may be super misleading. I.E. if you're using task manager, that's worse than useless.

Quote
That resulted in a lot more starts before the crash, suggesting that garbage collection might be an issue.

(From personal experience: when something weird makes it look like garbage collection is an issue, it's probably not garbage collection.)

But when I had a ship on the screen that had been firing as of the moment I clicked "start game", boom, dead again.

Huh - tried the same thing, pressing "start game" with a ship firing. I see the firing animation flicker during the game creation process (due to buffer switching, not the script actually being called), but there's no crash.

So, I tried a line of code in each of the advance() things causing problems...
Code
if(!engine.isInCampaign() && !engine.isInCampaignSim() && !engine.isMission()) return;

And, wow!  I had FX mod images on the screen, but the game finished the "days" sequence.  Five times in a row. 

Sooooo... there's something.  But from what you've told me, that something is impossible?

Well, those plugins could still be responsible somehow. It'd just have to be something they do before the game creation process starts. If you have the source somewhere, I could take a quick look to see if anything jumps out.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Global.getSector().isInNewGameAdvance()
« Reply #22 on: May 30, 2017, 07:53:51 PM »

One more note: if the issue was running out of memory, then you'd definitely get an exception in the log.

When you say "crash", does the game terminate or just hang? Asking because the windows event from your earlier post mentions that it "stopped responding", which is indicative of a hang. If it's a hang, then the most likely cause is an infinite loop somewhere in new game creation. Say, placing markets for explorer society or something like that.
Logged

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: Global.getSector().isInNewGameAdvance()
« Reply #23 on: May 30, 2017, 08:54:21 PM »

Absolutely.  The source is in the mods' /scripts directory.

Quote
When you say "crash", does the game terminate or just hang?
It hangs, I think.

Quote
Say, placing markets for explorer society or something like that.
I know it's not related to the Market stuff.  That happens a lot earlier in the sequence.

Moreover, it happens when it's just FX / Rebal (both have EveryFrameCombatScripts). 

Infinite recursion seems pretty unlikely, but I can't rule that out without going over all the situations; pretty sure that's not it, though; the scripts are just essentially big iterators that operate once per frame.
Logged
Please check out my SS projects :)
Xeno's Mod Pack

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Global.getSector().isInNewGameAdvance()
« Reply #24 on: May 30, 2017, 09:34:09 PM »

Infinite recursion would generate an exception of the stack overflow variety, so that's probably not it.

If you connect to the jvm using jvisualvm, get it to hang, and then to a thread dump, that would tell us what it's doing when it's hanging - that's probably the best way to track this down. jvisualvm should already be on your computer if you've got JDK 7 installer (JDK, not JRE), in the bin/ folder.
Logged

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: Global.getSector().isInNewGameAdvance()
« Reply #25 on: May 30, 2017, 10:48:21 PM »

I'll take a look tomorrow.

Is there a chance that CombatEngineAPIs being created because of the Fleets that get generated during the "days"?   Is that remotely possible?

The logs are full of calls to com.fs.starfarer.api.impl.campaign.fleets.BaseLimitedFleetManager and com.fs.starfarer.api.impl.campaign.shared.StarSystemActivityTracker right before it hangs.

I've seen another crash, even after these changes.  It's just not happening quite as... frequently.
Logged
Please check out my SS projects :)
Xeno's Mod Pack

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: Global.getSector().isInNewGameAdvance()
« Reply #26 on: May 31, 2017, 08:46:08 AM »

Is there a chance that CombatEngineAPIs being created because of the Fleets that get generated during the "days"?   Is that remotely possible?

Well, it's not entirely impossible that one might get created due to a bug somewhere, but it's not going to be advance()-ing. And, anyway, that should be fairly simple to test by adding some logging to the combat plugins.

The logs are full of calls to com.fs.starfarer.api.impl.campaign.fleets.BaseLimitedFleetManager and com.fs.starfarer.api.impl.campaign.shared.StarSystemActivityTracker right before it hangs.

That stuff just logs a lot, so doesn't necessarily mean much.
Logged

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: Global.getSector().isInNewGameAdvance()
« Reply #27 on: May 31, 2017, 09:26:50 AM »

I'll test that theory out by doing some logging.  It's about the only scenario that makes sense.  Perhaps what's going on is that there's an uninitialized variable or something that's causing calls to renderInWorldCoords()... that might explain the FX bug.
Logged
Please check out my SS projects :)
Xeno's Mod Pack
Pages: 1 [2]