Elvas Tower: NullReferenceException with extended tsection.dat - Elvas Tower

Jump to content

  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

NullReferenceException with extended tsection.dat Rate Topic: -----

#1 User is offline   jonas 

  • Engineer
  • Group: Status: Contributing Member
  • Posts: 548
  • Joined: 04-April 14
  • Gender:Male
  • Simulator:MSTS & OR
  • Country:

Posted 20 June 2017 - 04:24 PM

If I start the MSTS route USA2 "Marias Pass" with my extended tsection.dat, a "NullReferenceException" occurs in line 4994 in the "Signals.cs" module.

Here my used tsection.dat as Attached File  tsection.zip (10.65K)
Number of downloads: 232

My few added lines in the tsection.dat are at line 1420 for TrackSections and at line 3215 for TrackShapes.

It does not matter which activity or activity mode or locomotive is used.

The tsection.dat works perfectly with my builded route, both in OR as well as in MSTS.

There is no problem, if I use this tsection.dat with standard routes in MSTS, but in OR.

#2 User is offline   Csantucci 

  • Member, Board of Directors
  • Group: Status: Elite Member
  • Posts: 6,986
  • Joined: 31-December 11
  • Gender:Male
  • Country:

Posted 21 June 2017 - 12:15 AM

Please attach the logfile. If e.g. we don't know the OR version you are using, it's not possible to know what version of "Signals.cs" you are referring to.

#3 User is offline   jonas 

  • Engineer
  • Group: Status: Contributing Member
  • Posts: 548
  • Joined: 04-April 14
  • Gender:Male
  • Simulator:MSTS & OR
  • Country:

Posted 21 June 2017 - 01:49 AM

View PostCsantucci, on 21 June 2017 - 12:15 AM, said:

Please attach the logfile. If e.g. we don't know the OR version you are using, it's not possible to know what version of "Signals.cs" you are referring to.


I've used the yesterdays source code version via SVN Update.
Right now I've test it again with the current version of source code. According to the SVN update protokoll no new Signals.cs were updated since yesterday.
Attached Image: Signals.cs.jpg

Here is the logfile: Attached File  OpenRailsLog.txt (10.62K)
Number of downloads: 206


For the first time I was aware of the problem about 6 Month ago.

This is seen today at line 4994 of Signals.cs while debugging :
Attached Image: Line 4994.jpg

This is the todays error box with the compiled version #3881:
Attached Image: bug.jpg

#4 User is offline   Csantucci 

  • Member, Board of Directors
  • Group: Status: Elite Member
  • Posts: 6,986
  • Joined: 31-December 11
  • Gender:Male
  • Country:

Posted 21 June 2017 - 11:46 AM

I reproduced the problem.
OR does not like cases like this one:
	TrackShape ( 266 )
	TrackShape ( 267 )
	TrackShape ( 268 )
	TrackShape ( 269 )

in case there is a tracksection using TrackShape 266 in the route, and in your case there is one
+		thisSection	{{TileX:-12557 TileZ:14761 X:-160,694 Y:1173,74 Z:-860,664 UiD:2399 Section:382 Shape:266}}	

So if you delete these empty TrackShape references (that aren't present in the original tsection.dat) the crash is avoided.
What I can do is inserting a protection avoiding this crash, but I wonder what this reference in the original Marias .tdb file should mean.
You have also emptied some TrackShapes that are present in the standard tsection.dat (e.g. TrackShape 222): these also cause crash, and I expect they shouldn't be emptied.

#5 User is offline   Csantucci 

  • Member, Board of Directors
  • Group: Status: Elite Member
  • Posts: 6,986
  • Joined: 31-December 11
  • Gender:Male
  • Country:

Posted 21 June 2017 - 12:07 PM

Fixed in x.3883.

#6 User is offline   jonas 

  • Engineer
  • Group: Status: Contributing Member
  • Posts: 548
  • Joined: 04-April 14
  • Gender:Male
  • Simulator:MSTS & OR
  • Country:

Posted 21 June 2017 - 05:02 PM

Thank you Carlo for have a look at it and fixing it by inserting a protection avoiding the crash!

Now I can leave the empty TrackShape sequences in the tsection.dat, what helps me keeping the overview which trackshape indexes are available.

I can't remember why some origin TrackShapes entries (like 222) are emptied in my tsection.dat. Maybe I have used a modified one as model instead of the origin. Or maybe I emptied them because of double existing entries in the origin.

However, version #3883 works for me now. No error apear.

#7 User is offline   jonas 

  • Engineer
  • Group: Status: Contributing Member
  • Posts: 548
  • Joined: 04-April 14
  • Gender:Male
  • Simulator:MSTS & OR
  • Country:

Posted 22 June 2017 - 05:58 AM

I've looked up a little and found 30 empty TrackShape entries in the origin tsection.dat: 77, 78, 110, 183, 190, 220, 222, 224 and a block from 241 to 262.
...
_INFO(Slips)
TrackShape ( 77 )
TrackShape ( 78 )

_INFO(Buffers)
...
TrackShape ( 110 )
TrackShape ( 111
FileName ( A2tskewRgt.s )
...
TrackShape ( 183 )
TrackShape ( 184
FileName ( A1t1000r5dTun.s )
...
TrackShape ( 190 )
TrackShape ( 191
FileName ( US1Rd2l1000r20d.s )
...
TrackShape ( 220 )
TrackShape ( 221
FileName ( A1t45dYardLftMnl.s )
...
TrackShape ( 222 )
TrackShape ( 223
FileName ( A1tPnt2_5dLftMnl.s )
...
TrackShape ( 224 )
TrackShape ( 225
FileName ( A1t2000r5dRndTun.s )
...
TrackShape ( 241 )
TrackShape ( 242 )
TrackShape ( 243 )
TrackShape ( 244 )
TrackShape ( 245 )
TrackShape ( 246 )
TrackShape ( 247 )
TrackShape ( 248 )
TrackShape ( 249 )
TrackShape ( 250 )
TrackShape ( 251 )
TrackShape ( 252 )
TrackShape ( 253 )
TrackShape ( 254 )
TrackShape ( 255 )
TrackShape ( 256 )
TrackShape ( 257 )
TrackShape ( 258 )
TrackShape ( 259 )
TrackShape ( 260 )
TrackShape ( 261 )
TrackShape ( 262 )
...

So I think it is a good thing now for OR to be robust to handle empty TrackShape entries if one of them is used in a route, for what strange reason ever, like in Marias Pass ?:-)

#8 User is offline   Csantucci 

  • Member, Board of Directors
  • Group: Status: Elite Member
  • Posts: 6,986
  • Joined: 31-December 11
  • Gender:Male
  • Country:

Posted 22 June 2017 - 12:38 PM

Marias Pass does not use empty TrackShape entries. Marias Pass uses missing (in original tsection.dat) TrackShape entries (#266), and this didn't and does not cause crashes.

#9 User is offline   jonas 

  • Engineer
  • Group: Status: Contributing Member
  • Posts: 548
  • Joined: 04-April 14
  • Gender:Male
  • Simulator:MSTS & OR
  • Country:

Posted 23 June 2017 - 07:46 AM

View PostCsantucci, on 21 June 2017 - 11:46 AM, said:

..., but I wonder what this reference in the original Marias .tdb file should mean. ...

I've looked up now Marias Pass world file -12557 / 14761 and found a (normal) dyntrack - "UiD ( 2399 )" with "SectionIdx ( 266 )".
More simpler than I expected so far.

#10 User is offline   copperpen 

  • Executive Vice President
  • Group: Status: Elite Member
  • Posts: 3,139
  • Joined: 08-August 05
  • Gender:Male
  • Simulator:MSTS & OR
  • Country:

Posted 23 June 2017 - 10:37 AM

That is a dyntrack sectionidx which is nothing to do with the global tsection.dat. That idx should be in the local route tsection.dat.

  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users