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)

Author Topic: [0.9.1a] IllegalArgumentException when opening intel screen  (Read 774 times)

Histidine

  • Admiral
  • *****
  • Posts: 4661
    • View Profile
    • GitHub profile
[0.9.1a] IllegalArgumentException when opening intel screen
« on: September 21, 2020, 05:40:51 AM »

Code
145863 [Thread-6] ERROR com.fs.starfarer.combat.CombatMain  - java.lang.IllegalArgumentException: Comparison method violates its general contract!
java.lang.IllegalArgumentException: Comparison method violates its general contract!
at java.util.TimSort.mergeHi(Unknown Source)
at java.util.TimSort.mergeAt(Unknown Source)
at java.util.TimSort.mergeCollapse(Unknown Source)
at java.util.TimSort.sort(Unknown Source)
at java.util.TimSort.sort(Unknown Source)
at java.util.Arrays.sort(Unknown Source)
at java.util.Collections.sort(Unknown Source)
at com.fs.starfarer.campaign.ui.intel.SortablePlanetList.recreateList(Unknown Source)
at com.fs.starfarer.campaign.ui.intel.SortablePlanetList.actionPerformed(Unknown Source)
at com.fs.starfarer.campaign.ui.intel.SortablePlanetList.<init>(Unknown Source)
at com.fs.starfarer.campaign.ui.intel.B.for.if(Unknown Source)
at com.fs.starfarer.campaign.ui.intel.B.sizeChanged(Unknown Source)
at com.fs.starfarer.ui.for.setSize(Unknown Source)
at com.fs.starfarer.campaign.comms.return.this.void(Unknown Source)
at com.fs.starfarer.campaign.comms.return.sizeChanged(Unknown Source)
at com.fs.starfarer.ui.for.setSize(Unknown Source)
at com.fs.starfarer.ui.o00OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO.setSize(Unknown Source)
at com.fs.starfarer.ui.newui.O0oO$7.actionPerformed(Unknown Source)
at com.fs.starfarer.ui.newnew.buttonPressed(Unknown Source)
at com.fs.starfarer.ui.I.?00000(Unknown Source)
at com.fs.starfarer.ui.I.processInput(Unknown Source)
at com.fs.starfarer.ui.newnew.processInputImpl(Unknown Source)
at com.fs.starfarer.ui.o00OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO.processInput(Unknown Source)
at com.fs.starfarer.ui.v.dispatchEventsToChildren(Unknown Source)
at com.fs.starfarer.ui.v.processInputImpl(Unknown Source)
at com.fs.starfarer.ui.o00OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO.processInput(Unknown Source)
at com.fs.starfarer.ui.v.dispatchEventsToChildren(Unknown Source)
at com.fs.starfarer.ui.v.processInputImpl(Unknown Source)
at com.fs.starfarer.ui.N.processInputImpl(Unknown Source)
at com.fs.starfarer.ui.newui.O0oO.processInputImpl(Unknown Source)
at com.fs.starfarer.ui.o00OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO.processInput(Unknown Source)
at com.fs.starfarer.ui.v.dispatchEventsToChildren(Unknown Source)
at com.fs.starfarer.ui.v.processInputImpl(Unknown Source)
at com.fs.starfarer.ui.o00OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO.processInput(Unknown Source)
at com.fs.starfarer.campaign.CampaignState.processInput(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)
I narrowed this down to a bunch of marines I had stored on a station-only market.
- Opening intel screen when not in same system as that market: crash
- Opening intel screen when in same system as that market: no crash
- Opening faction doctrine/custom production screen doesn't cause the crash
- Taking out the marines fixes the issue (EDIT: Nope, still happens)
- Storing crew instead causes the crash to happen again, but apparently other commodities (tried supplies, fuel, heavy machinery, domestic/luxury goods, heavy armaments, AI cores) don't
« Last Edit: September 21, 2020, 05:47:41 AM by Histidine »
Logged

Histidine

  • Admiral
  • *****
  • Posts: 4661
    • View Profile
    • GitHub profile
Re: [0.9.1a] IllegalArgumentException when opening intel screen
« Reply #1 on: September 21, 2020, 07:42:05 AM »

EDIT: Solved by removing the Java Flight Recorder args from the batch file.

Code
java -XX:+UnlockCommercialFeatures -XX:+FlightRecorder MyApp
« Last Edit: September 21, 2020, 07:58:58 AM by Histidine »
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23988
    • View Profile
Re: [0.9.1a] IllegalArgumentException when opening intel screen
« Reply #2 on: September 21, 2020, 08:52:31 AM »

Huh, alright - interesting.
Logged

HySOqvs0sB8

  • Ensign
  • *
  • Posts: 8
    • View Profile
Re: [0.9.1a] IllegalArgumentException when opening intel screen
« Reply #3 on: April 05, 2021, 03:04:05 AM »

I had the exact same error a few times with the current version. It seems to appear when you have two intels of different type (like pirate activity - contract development or bounty - survey) in the same system. The faulty comparator could be fixed, but honestly, I don't think anyone cares that the items on the intel screen are sorted in the "wrong" way.

As for the interaction with jfr, it seems that the game disables the timsort algorithm programically instead of setting a vm argument, so anything that runs before the main method(like jfr or any java agent) and uses Arrays.sort() can circumvent this behaviour. The system property is only checked once when Arrays.sort() is first called, so the default algorithm(timsort) is going to be picked.

EDIT: Solved by removing the Java Flight Recorder args from the batch file.

Code
java -XX:+UnlockCommercialFeatures -XX:+FlightRecorder MyApp

If you add -Djava.util.Arrays.useLegacyMergeSort=true to the vmparams, you can keep using jfr with no problems.
Logged