View Issue Details

IDProjectCategoryLast Update
0001941AI War 1 / ClassicCrash/ExceptionDec 9, 2010 11:24 am
ReporterDraco18s Assigned Tokeith.lamothe  
Status resolvedResolutionfixed 
Product Version4.046 
Summary0001941: Piles of Unhandled Errors
DescriptionNon-crashing, they just periodically went "what's up?" and wrote a ton to the error log.
TagsNo tags attached.
Internal Weight

Relationships

duplicate of 0001874 resolvedkeith.lamothe UnhandledErrors during gameplay 
duplicate of 0001890 resolvedkeith.lamothe Unhandled Exception errors reported 

Activities

Draco18s

Dec 8, 2010 9:37 pm

developer  

Draco18s

Dec 8, 2010 9:37 pm

developer  

UnhandledErrors.txt (391,191 bytes)

Toll

Dec 8, 2010 9:38 pm

reporter   ~0005735

Looks a lot like that other issue.



-----------------------------------Error-----------------------------------
Log String: FixedUpdate: System.NullReferenceException: Object reference not set to an instance of an object
  at ForegroundUnitType.GetAttackPowerAgainstThis (.ForegroundObject AttackingUnit, Int32 ArmorBoost, Int32 ArmorDamage, Int32 Health) [0x00000] in <filename unknown>:0
  at ForegroundObject.GetAttackPowerAgainstThis (.ForegroundObject AttackingObject) [0x00000] in <filename unknown>:0
  at OtherObject.DoShotHit () [0x00000] in <filename unknown>:0
  at Game.RunOneCycleOfSimulation () [0x00000] in <filename unknown>:0
  at Game.RunNextCycle (Boolean DoRendering) [0x00000] in <filename unknown>:0
  at Game.RunFrame () [0x00000] in <filename unknown>:0
  at MainCameraLogic.FixedUpdate () [0x00000] in <filename unknown>:0
Stack Trace: at ForegroundUnitType.GetAttackPowerAgainstThis (.ForegroundObject AttackingUnit, Int32 ArmorBoost, Int32 ArmorDamage, Int32 Health) [0x00000] in <filename unknown>:0
  at ForegroundObject.GetAttackPowerAgainstThis (.ForegroundObject AttackingObject) [0x00000] in <filename unknown>:0
  at OtherObject.DoShotHit () [0x00000] in <filename unknown>:0
  at Game.RunOneCycleOfSimulation () [0x00000] in <filename unknown>:0
  at Game.RunNextCycle (Boolean DoRendering) [0x00000] in <filename unknown>:0
  at Game.RunFrame () [0x00000] in <filename unknown>:0
  at MainCameraLogic.FixedUpdate () [0x00000] in <filename unknown>:0

Draco18s

Dec 8, 2010 9:40 pm

developer   ~0005736

Ah yes, the [i]one[/i] I didn't look for first. :P

keith.lamothe

Dec 9, 2010 8:53 am

administrator   ~0005756

Last edited: Dec 9, 2010 8:53 am

Yep, already mounted on the trophy wall; hopefully 4.047 will be out today. Not that it will contain any fewer crashes, what with changing the central structures storing things like [i]all foreground objects[/i], but we have to keep things on their toes ;)

Chris_McElligottPark

Dec 9, 2010 10:59 am

administrator   ~0005769

Yeah, it will be out this morning. I decided not to release it last night because there were still a few more things I needed to check, and I didn't want to have a possibly-buggy new version out while I was asleep (not that I'm seeing any crashes at this stage, haven't seen many for a while, but the effects might be more subtle).

On the plus side, those changes have really made a dent in our ongoing goal for a mixture of speed and RAM usage lowering, so it was certainly worthwhile as a detour yesterday. I hadn't planned on it, but I was implementing one certain feature that had to check a dictionary a few hundred times a second, and so I decided to swap that over, and it kind of snowballed from there. ;)

keith.lamothe

Dec 9, 2010 11:09 am

administrator   ~0005770

Oh yea, anything touching that global dictionary isn't a snowball, it's an avalanche ;)

But great to have that transition done; Dictionary<K,T> is great for general purpose work but it's not well suited to critical-path performance on CPU, perm-alloc, or transient-alloc.

Chris_McElligottPark

Dec 9, 2010 11:11 am

administrator   ~0005771

To be fair, on .NET it seemed to be pretty fine. It's just on Mono that it results in transient allocations to this degree.

Actually, I didn't change the global dictionary, btw -- that can't really be done, since the global set of ship ids could well go into the hundreds of millions.

I changed away DOZENS of dictionaries on Player, AIPlayer, Enums, DatabaseContent, and a few other locations. Those were the ones that were actually being hit way more frequently, as the global ships dictionary is only used in rarer lookup cases.

Actually, come to that... I might be able to replace that with just a list... will look at.

keith.lamothe

Dec 9, 2010 11:19 am

administrator   ~0005775

Yea, the global set can get highly sparse due to neinzul ships, blade spawners, etc. Not to mention normal play.

A List<T> can be heap-static, but I don't see how it would get around the problem of just using an array: it's sparse. Unless you're planning to have the lookup be linear-time, which I would advise against ;) Though honestly I don't know how the dictionary lookup is done.

I'd just go with a custom datastructure, but you may not want that kind of time going into that right now.

Chris_McElligottPark

Dec 9, 2010 11:24 am

administrator   ~0005777

For now, tabling that. I was thinking of a hybrid thing like I use on the AI Loop, but it turns out that that dictionary is only enumerated exceedingly rarely, and not during normal gameplay cycles. So it's mostly a moot point as we're just using it as an actual dictionary and even that is fairly uncommon (commands to ships aside).

Issue History

Date Modified Username Field Change
Dec 8, 2010 9:37 pm Draco18s New Issue
Dec 8, 2010 9:37 pm Draco18s File Added: Screenshot_2010_12_07_22_33_41.png
Dec 8, 2010 9:37 pm Draco18s File Added: UnhandledErrors.txt
Dec 8, 2010 9:38 pm Toll Note Added: 0005735
Dec 8, 2010 9:38 pm Toll Relationship added duplicate of 0001874
Dec 8, 2010 9:39 pm Toll Relationship added duplicate of 0001890
Dec 8, 2010 9:40 pm Draco18s Note Added: 0005736
Dec 9, 2010 8:53 am keith.lamothe Note Added: 0005756
Dec 9, 2010 8:53 am keith.lamothe Status new => resolved
Dec 9, 2010 8:53 am keith.lamothe Resolution open => fixed
Dec 9, 2010 8:53 am keith.lamothe Assigned To => keith.lamothe
Dec 9, 2010 8:53 am keith.lamothe Note Edited: 0005756
Dec 9, 2010 10:59 am Chris_McElligottPark Note Added: 0005769
Dec 9, 2010 11:09 am keith.lamothe Note Added: 0005770
Dec 9, 2010 11:11 am Chris_McElligottPark Note Added: 0005771
Dec 9, 2010 11:19 am keith.lamothe Note Added: 0005775
Dec 9, 2010 11:24 am Chris_McElligottPark Note Added: 0005777
Apr 14, 2014 9:27 am Chris_McElligottPark Category Bug - Crash or Exception => Crash/Exception