Skip to content

Launcher Resume feature may break loading savegame settings #799

@krzychu124

Description

@krzychu124

We've got one report with
System.NullReferenceException: Object reference not set to an instance of an object

Here is the problem:

GenericObserable.NotifyObservers: An exception occured while notifying an observer of observable TrafficManager.Manager.Impl.GeometryManager+GeometryUpdateObservable: System.NullReferenceException: Object reference not set to an instance of an object
  at TrafficManager.Manager.Impl.ParkingRestrictionsManager.HandleInvalidSegment (TrafficManager.API.Traffic.Data.ExtSegment& seg) [0x00000] in <filename unknown>:0 
  at TrafficManager.Manager.AbstractGeometryObservingManager.OnUpdate (GeometryUpdate update) [0x00000] in <filename unknown>:0 
  at TrafficManager.Util.GenericObservable`1[TrafficManager.API.Manager.GeometryUpdate].NotifyObservers (GeometryUpdate subject) [0x00000] in <filename unknown>:0 

HandleInvalidSegment is trying to reset info about parking space for invalid segment. The problem is that ParkingManager was somehow not available at a time of this call which shouldn't gonna happen ever.

Looking closer at sequence of initialization stuff I found that log looks a bit weird...
Inside attached log it looks like this:

Info 0.0356824: Scan complete: 0 incompatible mod(s) found
Info 0.0360659: Mono version: 2.0 (Visual Studio built mono)
Info 64.0220577: OnLevelLoaded(LoadGame) called. updateMode=LoadGame

where whole part of loading data from savegame is missing (ignore time - it's from my log):

Info 153.6250136: Loading Traffic Manager: PE Data
Info 153.6597333: Initializing flags
Info 153.8685015: OnBeforeLoadData: ExtNodeManager
Info 153.8794185: OnBeforeLoadData: ExtSegmentManager
Info 154.0481370: OnBeforeLoadData: ExtSegmentEndManager
Info 154.0581456: OnBeforeLoadData: GeometryManager
Info 154.1158374: OnBeforeLoadData: AdvancedParkingManager
Info 154.1261277: OnBeforeLoadData: CustomSegmentLightsManager
Info 154.1363800: OnBeforeLoadData: ExtBuildingManager
Info 154.1461659: OnBeforeLoadData: ExtCitizenInstanceManager
Info 154.1571907: OnBeforeLoadData: ExtCitizenManager
Info 154.1666178: OnBeforeLoadData: ExtPathManager
Info 154.1766203: OnBeforeLoadData: TurnOnRedManager
Info 154.2146041: OnBeforeLoadData: LaneArrowManager
Info 154.2244202: OnBeforeLoadData: LaneConnectionManager
Info 154.2363049: OnBeforeLoadData: OptionsManager
Info 154.2462626: OnBeforeLoadData: ParkingRestrictionsManager
Info 154.2669686: OnBeforeLoadData: RoutingManager
Info 154.2776839: OnBeforeLoadData: SpeedLimitManager
Info 154.2945321: SpeedLimitManager.OnBeforeLoadData: 503 NetInfos loaded. Verifying...
                  SpeedLimitManager.OnBeforeLoadData: Scan complete.
Info 154.3900444: OnBeforeLoadData: TrafficLightManager
Info 154.4032650: OnBeforeLoadData: TrafficLightSimulationManager
Info 154.4144037: OnBeforeLoadData: TrafficMeasurementManager
Info 154.4244099: OnBeforeLoadData: TrafficPriorityManager
Info 154.4385237: OnBeforeLoadData: UtilityManager
Info 154.4488082: OnBeforeLoadData: VehicleRestrictionsManager
Info 154.4586933: OnBeforeLoadData: ExtVehicleManager
Info 154.4684008: OnBeforeLoadData: JunctionRestrictionsManager
Info 154.4799461: Initialization done. Loading mod data now.
Info 154.5664826: Loading Data from New Load Routine! Length=8216
Info 154.7589509: Loading State from Config
Info 154.7720494: Loading 0 extended citizens
Info 154.7832055: Loading 0 extended citizen instances
Info 154.7921412: Priority segments data structure (old) undefined!
Info 154.8409477: Loading 0 priority segments (new method)
Info 154.8504138: Loading parking restrictions data. 0 elements
Info 154.8603739: Loading lane vehicle restriction data. 0 elements
Info 154.8740884: Loading 0 timed traffic lights (new method)
Info 154.8845623: Loading junction traffic light data (old method)
Info 154.8956837: Loading toggled traffic lights (new method)
Info 154.9049480: Lane arrow data structure (old) undefined!
Info 154.9153594: Loading lane arrow data (new method)
Info 154.9287736: Loading 0 lane connections
Info 154.9393352: Loading custom default speed limit data. 0 elements
Info 154.9508197: Loading lane speed limit data. 0 elements
Info 154.9624155: Loading junction restrictions. 0 elements
Info 155.2004210: OnLoadData completed successfully.
Info 155.2099294: OnAfterLoadData: ExtNodeManager
Info 155.2194567: OnAfterLoadData: ExtSegmentManager
Info 155.2293043: OnAfterLoadData: ExtSegmentEndManager
Info 155.2394664: OnAfterLoadData: GeometryManager
Info 155.2485165: OnAfterLoadData: AdvancedParkingManager
Info 155.2593730: OnAfterLoadData: CustomSegmentLightsManager
Info 155.2688926: OnAfterLoadData: ExtBuildingManager
Info 155.2808159: OnAfterLoadData: ExtCitizenInstanceManager
Info 155.2931402: OnAfterLoadData: ExtCitizenManager
Info 155.3046642: OnAfterLoadData: ExtPathManager
Info 155.3148375: OnAfterLoadData: TurnOnRedManager
Info 155.3277816: OnAfterLoadData: LaneArrowManager
Info 155.4342913: OnAfterLoadData: LaneConnectionManager
Info 155.4458555: OnAfterLoadData: OptionsManager
Info 155.4595669: OnAfterLoadData: ParkingRestrictionsManager
Info 155.4691226: OnAfterLoadData: RoutingManager
Info 155.5755454: OnAfterLoadData: SpeedLimitManager
Info 155.5871560: OnAfterLoadData: TrafficLightManager
Info 155.5997707: OnAfterLoadData: TrafficLightSimulationManager
Info 155.6138570: OnAfterLoadData: TrafficMeasurementManager
Info 155.6280801: OnAfterLoadData: TrafficPriorityManager
Info 155.6439993: OnAfterLoadData: UtilityManager
Info 155.6609458: OnAfterLoadData: VehicleRestrictionsManager
Info 155.6705848: OnAfterLoadData: ExtVehicleManager
Info 155.7061078: OnAfterLoadData: JunctionRestrictionsManager

I have no idea if it's even reproducible... (I've had no luck)
TMPE.log

Metadata

Metadata

Assignees

No one assigned

    Labels

    11 ALPHATM:PE v11 alpha editionBUGDefect detectedSTABLETM:PE STABLE branchirreproducibleUnable to reproduce problem

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions