Arcen Idea Tracker (Bugs and Features)

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryDate SubmittedLast Update
0019028AI War 2[All Projects] Crash/ExceptionMar 9, 2017 8:48 pmMar 13, 2017 12:30 pm
Assigned Tokeith.lamothe 
Product Version0.109 Special Forces And Modding 
Fixed in Version0.110 and 0.111 Modding Overhaul And Unity Upgrade 
Summary0019028: Unity aborts when changing galaxy type
DescriptionI started a new game on Linux. I clicked "Start New Game", then "Map Type", and then the game pauses for about 10 seconds and I see this error:

[[email protected] AIWar2]$ ./AIWar2Linux.x86_64
PlayerConnection initialized from /home/user/AIWar2/AIWar2Linux_Data (debug = 0)
PlayerConnection initialized network socket : 55004
Multi-casting "[IP] [Port] 55004 [Flags] 2 [Guid] 161202516 [EditorId] 1117205967 [Version] 1048832 [Id] LinuxPlayer( [Debug] 0" to []...
Started listening to []
PlayerConnection already initialized - listening to []
displaymanager : xrandr version warning. 1.5
client has 6 screens
displaymanager screen (0)(DisplayPort-0): 1920 x 1200
displaymanager screen (1)(HDMI-0): 2560 x 1440
Using libudev for joystick management

Importing game controller configs
Aborted (core dumped)

There's nothing in the arcen logs, and it doesn't seem to be even generating a coredump
myComputer abrt-hook-ccpp: Process 7040 (AIWar2Linux.x86_64) of user X killed by SIGABRT - dumping core
myComputer abrt-hook-ccpp: Failed to create core_backtrace: dwfl_getthread_frames failed: No DWARF information found
TagsNo tags attached.
Attached Files? file icon notes [^] (769 bytes) Mar 10, 2017 10:17 am [Show Content]
txt file icon notes.txt [^] (10,212 bytes) Mar 10, 2017 10:19 am [Show Content]

- Relationships

-  Notes
x4000Bughunter (administrator)
Mar 9, 2017 8:49 pm

Any idea what map type you were clicking on? It sounds like an infinite loop.
BadgerBadger (reporter)
Mar 9, 2017 8:51 pm
edited on: Mar 9, 2017 8:51 pm

It was the very first one. "Clusters". This is 100% reproducible, so lemme know if you need any more debugging information.

x4000Bughunter (administrator)
Mar 9, 2017 8:52 pm

10-4. Thanks!
BadgerBadger (reporter)
Mar 9, 2017 8:54 pm
edited on: Mar 9, 2017 8:56 pm

This also happens if I click on the Seed: <NUMBER> button in the same window, or if I change my starting planet

BadgerBadger (reporter)
Mar 9, 2017 9:19 pm

This problem does not seem to reproduce on OSX. Seems linux specific.
x4000Bughunter (administrator)
Mar 10, 2017 10:06 am

Hmm. Do you have any log files here?

BadgerBadger (reporter)
Mar 10, 2017 10:17 am
edited on: Mar 10, 2017 10:20 am

Yeah, i see a NULL exception. Uploading the logs, they are in notes.txt. The "notes" file was the wrong file, but I can't figure out how to delete it

x4000Bughunter (administrator)
Mar 10, 2017 10:25 am

Got it, thanks -- I'll see what I can find out. The place where that has a nullref is extraordinarily strange. I'll see if I can duplicate it on my linux install. I'm not sure if this is a bug in the jobs system of the build of unity we're using at present; we may wind up needing to upgrade sooner than I had previously planned, not that that's a crisis.
x4000Bughunter (administrator)
Mar 10, 2017 4:49 pm

So, I can duplicate this on my linux box, but not windows. That's not really providing me much information, though, on what is at core happening. The debug files from your machine and mine are both pretty useless, unfortunately. It happens so fast on mine that I don't think it's an infinite loop or any other logic issue. I think it's something deeper in unity.

With that in mind, the thing I'm going to try next is an upgrade to the latest patch version of unity, and we'll see if that inherently fixes it or not. The current beta has a couple of issues that make me not want to go to that one just yet, and I want to wait until Monday for a change of this magnitude just in case it causes further issues.

Either way, moving to a newer build will be a good thing in the long run, but it's enough of a hassle that I try to do it only when there's some clear case as to why. This seems to be one of them -- at the very least, hopefully a newer build will give me a more informative error.

In the meantime, I'm going to poke into the logic directly for a bit and see if I can't fix anything that way.
x4000Bughunter (administrator)
Mar 10, 2017 5:16 pm

Interestingly, on my Surface Pro 4, it also has trouble when going into the map screen, but this time even when it first gets there at all. And it only has that trouble on OpenGLCore. It's running on 4.4, and I haven't checked lower levels of OpenGL on it. You might try one of the following command-line arguments on your linux box and see what that does, if you have time:

-force-opengl: To use the legacy OpenGL back-end
-force-glcore: To use the new OpenGL back-end. With this argument, Unity will detect all the features the platform support to run with the best OpenGL version possible and all available OpenGL extensions
-force-glcoreXY: XY can be 32, 33, 40, 41, 42, 43, 44 or 45; each number representing a specific version of OpenGL. If the platform doesn’t support a specific version of OpenGL, Unity will fallback to a supported version
-force-clamped: Request that Unity doesn’t use OpenGL extensions which guarantees that multiple platforms will execute the same code path. This is an approach to test if an issue is platform specific (a driver bug for example).

Ultimately the newer version of unity should help on that, either way, if that's what the problem is.
BadgerBadger (reporter)
Mar 10, 2017 5:35 pm

With -force-opengl I ran it once and it actually let me change the map type before crashing. On subsequent invocations it doesn't even get to the start screen, it just crashes each time.

With -force-glcore I observed the same thing.

With force-clamped, I cycled through several planets before the game crashed (possibly I was just clicking the button faster). On subsequent invocations the game did not crash immediately, but I was unable to cycle through map types, it would crash each time.

-force-glcore32: same behaviour as the original bug
-force-glcore44: I can change from "clusters" to whatever comes next before it crashes
-force-glcore45: quite unstable, it flashes the "start" screen in a most tantalizing fashion before crashing.

For additional interest's sake, I backed up to use .108 and I still see this problem now.

Also for curiousity, after running the rest of my experiments, I retried -force-opengl and it now gives me the same behaviour as the original bug. I am officially confused.
BadgerBadger (reporter)
Mar 10, 2017 5:45 pm
edited on: Mar 10, 2017 5:48 pm

Other random behaviour. It seems to be affected by the level of zoom on the galaxy. If, for example, I try to change planets without ever changing the zoom level, it works, sort of; usually it lets me change a couple planets before crashing. However, if I zoom out even one notch, changing planets will immediately crash the program.

x4000Bughunter (administrator)
Mar 10, 2017 5:50 pm

This sounds like a race condition across threads, to some extent, then. It's probably us creating or destroying something in a way that we shouldn't, but it's based around the speed at which we're doing it. And certain variants of OpenGL on linux must be more or less sensitive to it.

That's super strange -- but gives us good data, thanks!
BadgerBadger (reporter)
Mar 11, 2017 4:17 pm

In the interests of experimentation, I tried some previous versions of the code. I can not reproduce this on .106. However, .107 and everything past it does have this instability. I just didn't notice till .109
x4000Bughunter (administrator)
Mar 13, 2017 11:26 am

Awesome stuff, thanks for those added details. I've upgraded the game to 0.110 now, with also an underlying unity 3d upgrade, and I have a better error message now:

Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object
  at Arcen.AIW2.Core.World_AIW2.DoWorldStepLogic (Arcen.AIW2.Core.ArcenSimContext Context) [0x00114] in D:\vclarge\AI_War_2_Ultra\ArcenAIW2Core\src\Logic\GameState\World_AIW2.cs:204
  at Arcen.AIW2.Core.SimExecution.Execute () [0x00042] in D:\vclarge\AI_War_2_Ultra\ArcenAIW2Core\src\Logic\Sim\SimExecution\SimExecution.cs:25
  at Arcen.AIW2.Core.ArcenSimPlanningContext.InnerRun () [0x0002d] in D:\vclarge\AI_War_2_Ultra\ArcenAIW2Core\src\Logic\Sim\SimPlanningLoop.cs:80
  at Arcen.AIW2.Core.ArcenExecutionContext.InnerRun () [0x0000d] in D:\vclarge\AI_War_2_Ultra\ArcenAIW2Core\src\Logic\Sim\SimPlanningLoop.cs:216
Thread (nil) may have been prematurely finalized
Thread (nil) may have been prematurely finalized

This one puts it in Keith's area, even though it's OS-specific (kinda-sorta). I imagine that whatever is happening there is not healthy on any OS, but linux is the one that is just completely passing out over it.
x4000Bughunter (administrator)
Mar 13, 2017 12:30 pm

Okay! Keith got that fixed. :)

Oddly enough, this was an error on all the OSes, but it was only causing the program to die on linux. So I guess linux was our canary in this case, but the underlying problem was there in general.

I put in some code to hopefully make linux a bit less of a canary, as well, but we'll see what happens as that progresses.

Thanks for your help and patience!

Issue Community Support
This issue is already marked as resolved.
If you feel that is not the case, please reopen it and explain why.
Supporters: No one explicitly supports this issue yet.
Opponents: No one explicitly opposes this issue yet.

- Issue History
Date Modified Username Field Change
Mar 9, 2017 8:48 pm BadgerBadger New Issue
Mar 9, 2017 8:49 pm x4000Bughunter Note Added: 0045945
Mar 9, 2017 8:51 pm BadgerBadger Note Added: 0045946
Mar 9, 2017 8:51 pm BadgerBadger Note Edited: 0045946 View Revisions
Mar 9, 2017 8:52 pm x4000Bughunter Note Added: 0045947
Mar 9, 2017 8:54 pm BadgerBadger Note Added: 0045948
Mar 9, 2017 8:56 pm BadgerBadger Note Edited: 0045948 View Revisions
Mar 9, 2017 9:19 pm BadgerBadger Note Added: 0045949
Mar 10, 2017 10:06 am x4000Bughunter Note Added: 0045951
Mar 10, 2017 10:17 am BadgerBadger Note Added: 0045953
Mar 10, 2017 10:17 am BadgerBadger File Added: notes
Mar 10, 2017 10:19 am BadgerBadger File Added: notes.txt
Mar 10, 2017 10:20 am BadgerBadger Note Edited: 0045953 View Revisions
Mar 10, 2017 10:24 am x4000Bughunter Assigned To => x4000Bughunter
Mar 10, 2017 10:24 am x4000Bughunter Status new => assigned
Mar 10, 2017 10:25 am x4000Bughunter Note Added: 0045954
Mar 10, 2017 4:49 pm x4000Bughunter Note Added: 0045956
Mar 10, 2017 5:16 pm x4000Bughunter Note Added: 0045957
Mar 10, 2017 5:35 pm BadgerBadger Note Added: 0045958
Mar 10, 2017 5:45 pm BadgerBadger Note Added: 0045959
Mar 10, 2017 5:48 pm BadgerBadger Note Edited: 0045959 View Revisions
Mar 10, 2017 5:50 pm x4000Bughunter Note Added: 0045960
Mar 11, 2017 4:17 pm BadgerBadger Note Added: 0045965
Mar 13, 2017 11:26 am x4000Bughunter Note Added: 0045967
Mar 13, 2017 11:26 am x4000Bughunter Assigned To x4000Bughunter => keith.lamothe
Mar 13, 2017 12:30 pm x4000Bughunter Note Added: 0045968
Mar 13, 2017 12:30 pm x4000Bughunter Status assigned => resolved
Mar 13, 2017 12:30 pm x4000Bughunter Fixed in Version => 0.110 and 0.111 Modding Overhaul And Unity Upgrade
Mar 13, 2017 12:30 pm x4000Bughunter Resolution open => fixed

Copyright © 2000 - 2017 MantisBT Team
Powered by Mantis Bugtracker