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] Message spam in Windows console  (Read 409 times)

Histidine

  • Admiral
  • *****
  • Posts: 4661
    • View Profile
    • GitHub profile
[0.9.1a] Message spam in Windows console
« on: September 11, 2020, 07:50:44 AM »

While playing a battle with a low framerate (I think this was the "game slows down after a few battles" thing) I noticed the batch file's debug log was spamming a NullPointerException and ArrayIndexOutOfBoundsException:



The errors do not appear in starsector.log. Also, they were generated while the game was paused.
Setting sound + music volume to zero and turning off UI (F11 + tilde) did not suppress them. They did stop appearing after the battle.

What might cause this?
« Last Edit: September 11, 2020, 08:02:07 AM by Histidine »
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile
Re: [0.9.1a] Message spam in Windows console
« Reply #1 on: September 11, 2020, 09:56:07 AM »

Ahh, it's really hard to say. "Console but not in log" means that it's most likely being printed via System.out.println(exception) or equivalent (or System.err), so this is looking like someone's debug code being left in. And since it doesn't have any string identifier and just prints an exception object, there's not even a hint of what might be doing it to go on.

Never mind that there's apparently some code that's doing a try/catch and not doing anything with the exception - I mean, in a few cases IIRC this is necessary to work around some API shortcomings, but the fact that it's printing the exception seems to indicate this might've been a "fix" to a crash...

(If this was happening in my codebase I'd sigh and start searching for not-commented-out instances of println with a single parameter (via regex, maybe), etc. After having to do that once, I always put a string ID in debug prints like this... I wonder if it might not be possible to track this down by some selective thread dumping, or setting a breakpoint in System.out.println, or something.)
Logged