X2418 restore after save of geared engine crashes

Bug #1357719 reported by Carlo Santucci
22
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Open Rails
Fix Released
High
Cédric GNIEWEK

Bug Description

Select any route, select the standard Kiha as player loco and start. Save the game. When restoring the game an exception is generated, because GearBoxController is null in the call of line 228 of MSTSDieselLocomotive.cs.

Tags: crash physics
Revision history for this message
BB25187 (bb25187) wrote :

First, the engines with manual gear box do expose the problem as well.
 Second, the issue was introduced with revision #2381/2382 "Rolling stock loading process reorganization" (everything was OK at #2380). I attached another log file to the initial thread (http://www.elvastower.com/forums/index.php?/topic/24874-crash-in-restore-for-version-x2402/#entry158804) to illustrate (I got it with rev #2382 while back tracking the problem, but it is still there at rev #2419).

Revision history for this message
Cédric GNIEWEK (sharpeserana) wrote :

I will come back from holidays tomorrow, I will now be able to work on this issue.

Changed in or:
status: New → In Progress
assignee: nobody → Cédric GNIEWEK (sharpeserana)
Revision history for this message
disc (disc86543) wrote :

This happens with electric locomotives too.

Revision history for this message
Cédric GNIEWEK (sharpeserana) wrote :

For the moment, I only had problems with geared locomotives.

Can you send a log for your crash, please ?

Revision history for this message
disc (disc86543) wrote :
Download full text (4.2 KiB)

It's not connected to consist, or route, but to activity. Same consit on same route in explore mode, and the resume works. There is no any diesel locomotive in that activity.
This is about that problem:
Warning: System.NullReferenceException: Object reference not set to an instance of an object.
   at ORTS.ControllerFactory.Restore(IController controller, BinaryReader inf) in c:\Users\James\Documents\Coding\Jenkins\jobs\Open Rails\workspace\Source\RunActivity\RollingStock\SubSystems\Controllers\ControllerFactory.cs:line 47
   at ORTS.MSTSDieselLocomotive.Restore(BinaryReader inf) in c:\Users\James\Documents\Coding\Jenkins\jobs\Open Rails\workspace\Source\RunActivity\RollingStock\MSTSDieselLocomotive.cs:line 228
   at ORTS.Train.RestoreCars(Simulator simulator, BinaryReader inf) in c:\Users\James\Documents\Coding\Jenkins\jobs\Open Rails\workspace\Source\RunActivity\Physics\Train.cs:line 776
   at ORTS.Train..ctor(Simulator simulator, BinaryReader inf) in c:\Users\James\Documents\Coding\Jenkins\jobs\Open Rails\workspace\Source\RunActivity\Physics\Train.cs:line 501
   at ORTS.Simulator.RestoreTrains(BinaryReader inf) in c:\Users\James\Documents\Coding\Jenkins\jobs\Open Rails\workspace\Source\RunActivity\Simulator\Simulator.cs:line 925
   at ORTS.Simulator.Restore(BinaryReader inf, Single initialTileX, Single initialTileZ) in c:\Users\James\Documents\Coding\Jenkins\jobs\Open Rails\workspace\Source\RunActivity\Simulator\Simulator.cs:line 331
   at ORTS.Processes.GameStateRunActivity.Resume(UserSettings settings, String[] args) in c:\Users\James\Documents\Coding\Jenkins\jobs\Open Rails\workspace\Source\RunActivity\Processes\GameStateRunActivity.cs:line 389
   at ORTS.Processes.GameStateRunActivity.<>c__DisplayClass8.<Load>b__3() in c:\Users\James\Documents\Coding\Jenkins\jobs\Open Rails\workspace\Source\RunActivity\Processes\GameStateRunActivity.cs:line 155
   at ORTS.Processes.GameStateRunActivity.Load() in c:\Users\James\Documents\Coding\Jenkins\jobs\Open Rails\workspace\Source\RunActivity\Processes\GameStateRunActivity.cs:line 190
   at ORTS.Processes.LoaderProcess.Load() in c:\Users\James\Documents\Coding\Jenkins\jobs\Open Rails\workspace\Source\RunActivity\Processes\LoaderProcess.cs:line 122
   at ORTS.Processes.LoaderProcess.DoLoad() in c:\Users\James\Documents\Coding\Jenkins\jobs\Open Rails\workspace\Source\RunActivity\Processes\LoaderProcess.cs:line 103
   at ORTS.Processes.LoaderProcess.LoaderThread() in c:\Users\James\Documents\Coding\Jenkins\jobs\Open Rails\workspace\Source\RunActivity\Processes\LoaderProcess.cs:line 74
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()

Error: ORTS.Processes.IncompatibleSaveException: Exception of type 'ORTS.Processes.IncompatibleSaveException' was thrown.
   at ORTS.Processes.GameStateRunActivity.Resume(UserSettings settings, String[] args) in c:\Users\James\Documents\Coding\Jenkins\jobs\Open Rails\workspace\Source\RunActivity\Processes\GameStateRunActivity.cs:line 410
   at ORTS.Processes.GameStateRunActivity.<>c__D...

Read more...

Revision history for this message
Cédric GNIEWEK (sharpeserana) wrote :

In your log, it is a diesel locomotive that causes the crash. The log shows that it comes from the same line of code as the first log that was sent by Carlo.

I think I will have a fix ready for this evening (in 9 hours more or less). I have to go back to work.

Revision history for this message
Cédric GNIEWEK (sharpeserana) wrote :

It should be fixed in revision 2435.

Changed in or:
status: In Progress → Fix Committed
James Ross (twpol)
Changed in or:
milestone: none → 1.0
importance: Undecided → High
James Ross (twpol)
Changed in or:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.