objectoptimization section causes System.NullReferenceException

Bug #902972 reported by Andrew
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
openbve (Ubuntu)
New
Undecided
Unassigned

Bug Description

The second time I run openbve then select a standard simulation csv file, openbve crashes with "System.NullReferenceException". If I delete the settings files in .config/OpenBve/ or specifically delete the [objectoptimization] section in the options.cfg file.

Revision history for this message
Alessandro Menti (elgaton) wrote :

Hi Andrew, thanks for the report and sorry for the delay.

I have tried to reproduce the bug with the latest OpenBVE version (1.2.10.0-0ubuntu2.1, which is currently published in the "proposed" repository and will be listed among the available updates in a few days). This is what I did:
1) Renamed the ~/.config/OpenBVE folder so that I could start with a "fresh" configuration.
2) Started OpenBVE, chose the standard Birmingham Cross-City South route (specifically, the 323_Spring_2005_1128_Dry_Cloudy.csv route).
3) Did a quick ride from the starting station to the second one.
4) Exited from the program.
5) Started the program again and selected the same route from the list.

Since the program did not crash with the "standard" configuration file, I assume that the [objectoptimization] section in your configuration file was created there by an old version.

Could you please do the following to help me to find the portion of code where the problem occurs?
1) Restore the old options.cfg file with the [objectoptimization] section.
2) Run OpenBVE from the terminal.
3) Try to select the "standard simulation CSV file" you mentioned to make OpenBVE crash.
4) When OpenBVE crashes, note the exact and complete error message displayed in the terminal: it should include, beside the "System.NullReference exception" message you noted, other context information I need to find the responsible line of code.
5) Add a comment here with:
-the exact error message displayed in step 4;
-the exact sequence of steps you performed to trigger the error, so that I can reproduce it too and be able to debug and fix it (list all the buttons you clicked, the route you selected...);
-the complete content of the .config/OpenBve folder (zip it and add it to the bug report as an attachment).

Thanks!

Changed in openbve (Ubuntu):
status: New → Incomplete
Revision history for this message
Andrew (andrew-punch) wrote :

1. rm -rf .config/OpenBve/
2. openbve
3. Start new game -> browse -> Birmingham_Cross-City_South -> Day -> 323 Summer 2002 0931 Dry Clear.csv
4. Click start
5. Esc -> Quit -> Yes
6. Result on console:
FindNextFile: Bad encoding for '/home/andrewp/Music/Agnes Baltsa, Jos� Van Dam; Riccardo Muti_ Vienna Philharmonic Orchestra'
Consider using MONO_EXTERNAL_ENCODINGS

FindNextFile: Bad encoding for '/home/andrewp/Music/Blue �yster Cult'
Consider using MONO_EXTERNAL_ENCODINGS

FindNextFile: Bad encoding for '/home/andrewp/Music/Convivium Musicum M�nchen - Xaver Mayer'
Consider using MONO_EXTERNAL_ENCODINGS

FindNextFile: Bad encoding for '/home/andrewp/Music/Frank Peter Zimmermann, J�rg Faerber & W�rttembergisches Kammerorchester Heilbronn'
Consider using MONO_EXTERNAL_ENCODINGS

FindNextFile: Bad encoding for '/home/andrewp/Music/Franz Welser-M�st; Stockholm Chamber Orchestra'
Consider using MONO_EXTERNAL_ENCODINGS

FindNextFile: Bad encoding for '/home/andrewp/Music/Missy Elliott Feat. Beyonc�'
Consider using MONO_EXTERNAL_ENCODINGS

WatchdogExit: starting timer
6. openbve
7. Start new game -> browse -> already in correct directory -> 323 Summer 2002 0931 Dry Clear.csv
8. Immediately crashes (without clicking on Start or double clicking) console is:
System.NullReferenceException: Object reference not set to an instance of an object
  at System.Windows.Forms.ListView+ItemControl.ItemsMouseDown (System.Object sender, System.Windows.Forms.MouseEventArgs me) [0x00000] in <filename unknown>:0
  at System.Windows.Forms.Control.OnMouseDown (System.Windows.Forms.MouseEventArgs e) [0x00000] in <filename unknown>:0
  at System.Windows.Forms.Control.WmLButtonDown (System.Windows.Forms.Message& m) [0x00000] in <filename unknown>:0
  at System.Windows.Forms.Control.WndProc (System.Windows.Forms.Message& m) [0x00000] in <filename unknown>:0
  at System.Windows.Forms.ListView+ItemControl.WndProc (System.Windows.Forms.Message& m) [0x00000] in <filename unknown>:0
  at System.Windows.Forms.Control+ControlWindowTarget.OnMessage (System.Windows.Forms.Message& m) [0x00000] in <filename unknown>:0
  at System.Windows.Forms.Control+ControlNativeWindow.WndProc (System.Windows.Forms.Message& m) [0x00000] in <filename unknown>:0
  at System.Windows.Forms.NativeWindow.WndProc (IntPtr hWnd, Msg msg, IntPtr wParam, IntPtr lParam) [0x00000] in <filename unknown>:0
WatchdogExit: starting timer

Revision history for this message
Andrew (andrew-punch) wrote :
Revision history for this message
Andrew (andrew-punch) wrote :
Revision history for this message
Andrew (andrew-punch) wrote :

The workaround mentioned in the thread works for me: if I go up one directory then back down to the correct directory then it works correctly.

Revision history for this message
Alessandro Menti (elgaton) wrote :

Thanks for the clarifications, I'll try to reproduce the bug again and have a look at the code with a debugger. I'll also see if the bug is specific to the Ubuntu packaged version or if the error occurs in the stock OpenBVE binary as well.

Changed in openbve (Ubuntu):
status: Incomplete → New
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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