STFReader silently ignores file name with closing quotation mark only (was: MLT D&H Route causes crash during application of sand)

Bug #1197917 reported by Andrew Underwood
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Open Rails
Fix Released
Low
cjakeman

Bug Description

Open Rails is starting...
Argument 0 = -start
Argument 1 = C:\1MSTS\ROUTES\Delware & Hudson\ACTIVITIES\cdn_products.act
Version = 0.9.0.1648
Build = 0.0.4915.25550 (2013-06-16 14:11:40Z)
Logfile = C:\Users\Andrew Desktop\Desktop\OpenRailsLog.txt
--------------------------------------------------------------------------------
Alerter = False
AvatarURL = http://openrails.org/images/support-logos.jpg
BrakePipeChargingRate = 21
BreakCouplers = False
Cab2DStretch = 0
CarVibratingLevel = (registry) 1
DataLogger = False
DistantMountains = False
DistantMountainsLoweringValue = 5
DistantMountainsViewingTiles = 20
DoubleWire = False
DynamicShadows = False
FullScreen = (registry) True
GraduatedRelease = False
LODViewingExtention = False
Logging = True
LoggingFilename = OpenRailsLog.txt
LoggingPath = C:\Users\Andrew Desktop\Desktop
Menu_Selection = (registry) C:\1MSTS, C:\1MSTS\ROUTES\Delware & Hudson, C:\1MSTS\ROUTES\Delware & Hudson\ACTIVITIES\cdn_products.act
MSTSBINSound = (registry) True
Multiplayer = False
Multiplayer_Host = (registry)
Multiplayer_Port = 30000
Multiplayer_UpdateInterval = 10
Multiplayer_User = (registry)
MultiplayerClient = False
MultiplayerServer = False
Precipitation = (registry) True
Profiling = False
ProfilingFrameCount = 0
ProfilingTime = 0
ReplayPauseBeforeEnd = True
ReplayPauseBeforeEndS = 0
ScreenshotPath = C:\Users\Andrew Desktop\Pictures\Open Rails
ShaderModel = 0
ShadowAllShapes = False
ShadowMapBlur = True
ShadowMapCount = 4
ShadowMapDistance = 0
ShadowMapResolution = 1024
ShowAvatar = False
ShowErrorDialogs = True
SoundDetailLevel = 5
SoundVolumePercent = 100
SuperElevationGauge = 1435
SuperElevationMinLen = 50
SuppressConfirmations = False
TrainLights = (registry) True
UseAdvancedAdhesion = True
UseSuperElevation = 0
VerticalSync = False
ViewDispatcher = False
ViewingDistance = 2000
ViewingFOV = 45
WindowGlass = False
WindowPosition_Activity = (registry) 100, 100
WindowPosition_Compass = 50, 0
WindowPosition_ComposeMessage = 50, 50
WindowPosition_DriverAid = 100, 100
WindowPosition_Help = (registry) 48, 58
WindowPosition_NextStation = 0, 100
WindowPosition_Quit = 50, 50
WindowPosition_Switch = 0, 50
WindowPosition_TrackMonitor = 100, 0
WindowPosition_TrainOperations = (registry) 1, 100
WindowSize = 1024x768
Wire = False
WorldObjectDensity = 10
--------------------------------------------------------------------------------
Mode = Activity
Activity = C:\1MSTS\ROUTES\Delware & Hudson\ACTIVITIES\cdn_products.act
--------------------------------------------------------------------------------
Loading TRK TDB SIGCFG DAT ACT RDB CARSPAWN SIGSCR
WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW

Warning: Found a suffix 'kn' which could not be parsed as a Power unit in C:\1MSTS\trains\trainset\D&H_C424_463\D&H_C424_463.eng:line 357

Warning: Found a suffix 'kn' which could not be parsed as a Power unit in C:\1MSTS\trains\trainset\D&H_C424_461\D&H_C424_461AI.eng:line 109

Warning: Found a suffix 'kn' which could not be parsed as a Power unit in C:\1MSTS\trains\trainset\D&H_RS36_5015\D&H_RS36_5015AI.eng:line 109

 ENV SIGCFG TTYPE

Information: OpenAL 1.1 ALSOFT 1.15.1 using device OpenAL Soft by OpenAL Community

TTTTTTTTTWWWWSSSSSSSSSSSSSSSWWWWWCSCSCSCSCSCCSCCCCCSCSCCCCSCSCSCCCSCCSCSCCCCCSCSCCCCCCCCCCCCCCCCCCCSCCCCS

Information: Ignored missing animations data in shape c:\1msts\routes\delware & hudson\shapes\dh_speed.s

Error: System.ArgumentException: Illegal characters in path.
   at System.IO.Path.CheckInvalidPathChars(String path)
   at System.IO.Path.Combine(String path1, String path2)
   at ORTS.ORTSPaths.GetFileFromFolders(String[] pathArray, String branch)
   at ORTS.ORTSSoundPlayCommand.GetNextFile()
   at ORTS.ORTSStartLoopRelease.Run()
   at ORTS.ORTSDiscreteTrigger.HandleEvent(Event eventID)
   at ORTS.MSTSWagon.SignalEvent(Event evt)
   at ORTS.MSTSLocomotive.SignalEvent(Event evt)
   at ORTS.Train.SignalEvent(Event evt)
   at ORTS.SanderCommand.Redo()
   at ORTS.MSTSLocomotiveViewer.HandleUserInput(ElapsedTime elapsedTime)
   at ORTS.MSTSDieselLocomotiveViewer.HandleUserInput(ElapsedTime elapsedTime)
   at ORTS.Viewer3D.HandleUserInput(ElapsedTime elapsedTime)
   at ORTS.Viewer3D.Update(Single elapsedRealTime, RenderFrame frame)
   at ORTS.UpdaterProcess.Update()
   at ORTS.UpdaterProcess.DoUpdate()
   at ORTS.UpdaterProcess.UpdaterThread()
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.runTryCode(Object userData)
   at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()

Tags: content
Revision history for this message
Edward Keenan (edwardk) wrote :

Andrew,

I just want to confirm that the crashing is only taking place when using sand and that there are no other issues. With the above error, its possible that between SMS file for the cab or the cvf file, there is an error for the sanding entry. In the sms file a typical entry would look like this. Note: you will also have the very same entry in the CVF file utilized for the engine.

( 4 StartLoopRelease ( 1 File ( "../../SandpatchRequired/sound/d9_sand.wav" -1 ) SelectionMethod ( SequentialSelection ) ) )
     Discrete_Trigger ( 5 ReleaseLoopRelease () )

In the CVF file, you have this.

TwoState (
   Type ( SANDERS TWO_STATE )
   Position ( 128 281 19 23 )
   Graphic ( "..\\..\\SandpatchRequired\\EMDCABVIEW\\sander.ace" )
   NumFrames ( 2 2 1 )
   Style ( ONOFF )
   MouseControl ( 1 )
  )

If you can do this, you need to confirm that the path information are pointing to both files and that there are no other characters used other than what is shown above.

Edward K.

Revision history for this message
Andrew Underwood (underwood-andrewc) wrote : Re: [Bug 1197917] Re: MLT D&H Route causes crash during application of sand
Download full text (9.3 KiB)

Hi Edward,

I can confirm the crashes only occur with sand and with no other units
other than those using the Alco SMS files from MLT's D&H route. The EMD
SMS files work just fine.

I'll comb through the SMS files and see if I can find your quoted lines.
I'll let you know tomorrow whether or not it works. Odd that no one else
has reported something similar? Maybe the D&H route wasn't as popular as I
thought?

Andrew

On Fri, Jul 5, 2013 at 12:20 AM, Edward Keenan <email address hidden> wrote:

> Andrew,
>
> I just want to confirm that the crashing is only taking place when using
> sand and that there are no other issues. With the above error, its
> possible that between SMS file for the cab or the cvf file, there is an
> error for the sanding entry. In the sms file a typical entry would look
> like this. Note: you will also have the very same entry in the CVF file
> utilized for the engine.
>
> ( 4 StartLoopRelease ( 1 File (
> "../../SandpatchRequired/sound/d9_sand.wav" -1 ) SelectionMethod (
> SequentialSelection ) ) )
> Discrete_Trigger ( 5
> ReleaseLoopRelease () )
>
> In the CVF file, you have this.
>
> TwoState (
> Type ( SANDERS TWO_STATE )
> Position ( 128 281 19 23 )
> Graphic (
> "..\\..\\SandpatchRequired\\EMDCABVIEW\\sander.ace" )
> NumFrames ( 2 2 1 )
> Style ( ONOFF )
> MouseControl ( 1 )
> )
>
> If you can do this, you need to confirm that the path information are
> pointing to both files and that there are no other characters used other
> than what is shown above.
>
> Edward K.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1197917
>
> Title:
> MLT D&H Route causes crash during application of sand
>
> Status in Open Rails Tracker:
> New
>
> Bug description:
> Open Rails is starting...
> Argument 0 = -start
> Argument 1 = C:\1MSTS\ROUTES\Delware & Hudson\ACTIVITIES\cdn_products.act
> Version = 0.9.0.1648
> Build = 0.0.4915.25550 (2013-06-16 14:11:40Z)
> Logfile = C:\Users\Andrew Desktop\Desktop\OpenRailsLog.txt
>
> --------------------------------------------------------------------------------
> Alerter = False
> AvatarURL =
> http://openrails.org/images/support-logos.jpg
> BrakePipeChargingRate = 21
> BreakCouplers = False
> Cab2DStretch = 0
> CarVibratingLevel = (registry) 1
> DataLogger = False
> DistantMountains = False
> DistantMountainsLoweringValue = 5
> DistantMountainsViewingTiles = 20
> DoubleWire = False
> DynamicShadows = False
> FullScreen = (registry) True
> GraduatedRelease = False
> LODViewingExten...

Read more...

Revision history for this message
Edward Keenan (edwardk) wrote : Re: MLT D&H Route causes crash during application of sand

Andrew,

Certain mistakes will actually go unnoticed by MSTS, but will be caught by OR.

Edward K.

Revision history for this message
Andrew Underwood (underwood-andrewc) wrote : Re: [Bug 1197917] Re: MLT D&H Route causes crash during application of sand
Download full text (8.0 KiB)

Indeed! I think it makes for a more solid program though when things like
this get caught by OR. Everything worked as advertised in v0.8.

Loving OR, by the way... this is excellent.

Andrew

On Fri, Jul 5, 2013 at 3:47 AM, Edward Keenan <email address hidden> wrote:

> Andrew,
>
> Certain mistakes will actually go unnoticed by MSTS, but will be caught
> by OR.
>
> Edward K.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1197917
>
> Title:
> MLT D&H Route causes crash during application of sand
>
> Status in Open Rails Tracker:
> New
>
> Bug description:
> Open Rails is starting...
> Argument 0 = -start
> Argument 1 = C:\1MSTS\ROUTES\Delware & Hudson\ACTIVITIES\cdn_products.act
> Version = 0.9.0.1648
> Build = 0.0.4915.25550 (2013-06-16 14:11:40Z)
> Logfile = C:\Users\Andrew Desktop\Desktop\OpenRailsLog.txt
>
> --------------------------------------------------------------------------------
> Alerter = False
> AvatarURL =
> http://openrails.org/images/support-logos.jpg
> BrakePipeChargingRate = 21
> BreakCouplers = False
> Cab2DStretch = 0
> CarVibratingLevel = (registry) 1
> DataLogger = False
> DistantMountains = False
> DistantMountainsLoweringValue = 5
> DistantMountainsViewingTiles = 20
> DoubleWire = False
> DynamicShadows = False
> FullScreen = (registry) True
> GraduatedRelease = False
> LODViewingExtention = False
> Logging = True
> LoggingFilename = OpenRailsLog.txt
> LoggingPath = C:\Users\Andrew
> Desktop\Desktop
> Menu_Selection = (registry) C:\1MSTS,
> C:\1MSTS\ROUTES\Delware & Hudson, C:\1MSTS\ROUTES\Delware &
> Hudson\ACTIVITIES\cdn_products.act
> MSTSBINSound = (registry) True
> Multiplayer = False
> Multiplayer_Host = (registry)
> Multiplayer_Port = 30000
> Multiplayer_UpdateInterval = 10
> Multiplayer_User = (registry)
> MultiplayerClient = False
> MultiplayerServer = False
> Precipitation = (registry) True
> Profiling = False
> ProfilingFrameCount = 0
> ProfilingTime = 0
> ReplayPauseBeforeEnd = True
> ReplayPauseBeforeEndS = 0
> ScreenshotPath = C:\Users\Andrew
> Desktop\Pictures\Open Rails
> ShaderModel = 0
> ShadowAllSh...

Read more...

James Ross (twpol)
summary: - MLT D&H Route causes crash during application of sand
+ System.ArgumentException at ORTS.ORTSPaths.GetFileFromFolders (MLT D&H
+ Route causes crash during application of sand)
Changed in or:
status: New → Triaged
importance: Undecided → High
milestone: none → 1.0
tags: added: crash sounds
Revision history for this message
Andrew Underwood (underwood-andrewc) wrote :
Download full text (9.1 KiB)

Hi Edward,

I took a look through the .eng files for an engine, the .cvf and the .sms.
In the .sms file I found a missing quotation in relation to the sand sound
name (in this case "x_sand.wav"). I placed it, but it still didn't work.
That file is present in the directory.

The editing program I'm using is ConTEXT. As I'm sure you know, it matches
parenthesis as well and I haven't found mismatched parenthesis either.

I've ruled out the .cvf entry as being the culprit as each locomotive that
gives me the problem has a separate cab view. This is why I think it is in
the .sms somewhere - though my .sms entry for the sander looks almost
identical to yours

Let me keep looking around. In the meantime, if you need anything else,
just let me know. I'm happy to sort this out. I'm still at a loss to
understand why it is just this one set of .sms files.

Andrew

On Thu, Jul 4, 2013 at 8:59 PM, Andrew Underwood <
<email address hidden>> wrote:

> Indeed! I think it makes for a more solid program though when things like
> this get caught by OR. Everything worked as advertised in v0.8.
>
> Loving OR, by the way... this is excellent.
>
> Andrew
>
>
> On Fri, Jul 5, 2013 at 3:47 AM, Edward Keenan <email address hidden> wrote:
>
>> Andrew,
>>
>> Certain mistakes will actually go unnoticed by MSTS, but will be caught
>> by OR.
>>
>> Edward K.
>>
>> --
>> You received this bug notification because you are subscribed to the bug
>> report.
>> https://bugs.launchpad.net/bugs/1197917
>>
>> Title:
>> MLT D&H Route causes crash during application of sand
>>
>> Status in Open Rails Tracker:
>> New
>>
>> Bug description:
>> Open Rails is starting...
>> Argument 0 = -start
>> Argument 1 = C:\1MSTS\ROUTES\Delware &
>> Hudson\ACTIVITIES\cdn_products.act
>> Version = 0.9.0.1648
>> Build = 0.0.4915.25550 (2013-06-16 14:11:40Z)
>> Logfile = C:\Users\Andrew Desktop\Desktop\OpenRailsLog.txt
>>
>> --------------------------------------------------------------------------------
>> Alerter = False
>> AvatarURL =
>> http://openrails.org/images/support-logos.jpg
>> BrakePipeChargingRate = 21
>> BreakCouplers = False
>> Cab2DStretch = 0
>> CarVibratingLevel = (registry) 1
>> DataLogger = False
>> DistantMountains = False
>> DistantMountainsLoweringValue = 5
>> DistantMountainsViewingTiles = 20
>> DoubleWire = False
>> DynamicShadows = False
>> FullScreen = (registry) True
>> GraduatedRelease = False
>> LODViewingExtention = False
>> Logging = True
>> LoggingFilename = OpenRailsLog.txt
>> LoggingPath = C:\Users\Andrew
>> Desktop\Desktop
>> Menu_Selection = (registry) C:\1MSTS,
>> C:\1MSTS\R...

Read more...

Revision history for this message
Edward Keenan (edwardk) wrote : Re: System.ArgumentException at ORTS.ORTSPaths.GetFileFromFolders (MLT D&H Route causes crash during application of sand)

Andrew,

One thing you could try is to back up both sander wave files used by this particular sms file and replace them with another set. By doing this, you are checking for a possible wave file issue. If there are still problems then post the problem sms file.

Edward K.

Revision history for this message
Andrew Underwood (underwood-andrewc) wrote : Re: [Bug 1197917] Re: System.ArgumentException at ORTS.ORTSPaths.GetFileFromFolders (MLT D&H Route causes crash during application of sand)
Download full text (9.3 KiB)

Edward,

I found the problem. The problem was inside the .sms file itself. It
seems the folks at MLT left out a critical quotation when they did the
RS_eng.sms.

This is the unchanged RS_eng.sms line to do with the sand:

Stream (
                Skip ( **** This stream allows the sander to be played at
the same time **** )
                Priority ( 4 )
                Triggers ( 2
                    Discrete_Trigger ( 4 StartLoopRelease ( 1 File (
x_sand.wav" -1 ) SelectionMethod ( SequentialSelection ) ) )
                    Discrete_Trigger ( 5 ReleaseLoopRelease () )
                )
            )

This is the changed line. Note the addition of the quotation for file
x_sand.wav:

Stream (
                Skip ( **** This stream allows the sander to be played at
the same time **** )
                Priority ( 4 )
                Triggers ( 2
                    Discrete_Trigger ( 4 StartLoopRelease ( 1 File (
"x_sand.wav" -1 ) SelectionMethod ( SequentialSelection ) ) )
                    Discrete_Trigger ( 5 ReleaseLoopRelease () )
                )
            )

The same problem existed with Alcoeng.sms. Correcting this has corrected
OR crashing. I don't know why I didn't see this earlier.

Andrew

On Sat, Jul 6, 2013 at 2:48 PM, Edward Keenan <email address hidden> wrote:

> Andrew,
>
> One thing you could try is to back up both sander wave files used by
> this particular sms file and replace them with another set. By doing
> this, you are checking for a possible wave file issue. If there are
> still problems then post the problem sms file.
>
> Edward K.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1197917
>
> Title:
> System.ArgumentException at ORTS.ORTSPaths.GetFileFromFolders (MLT D&H
> Route causes crash during application of sand)
>
> Status in Open Rails Tracker:
> Triaged
>
> Bug description:
> Open Rails is starting...
> Argument 0 = -start
> Argument 1 = C:\1MSTS\ROUTES\Delware & Hudson\ACTIVITIES\cdn_products.act
> Version = 0.9.0.1648
> Build = 0.0.4915.25550 (2013-06-16 14:11:40Z)
> Logfile = C:\Users\Andrew Desktop\Desktop\OpenRailsLog.txt
>
> --------------------------------------------------------------------------------
> Alerter = False
> AvatarURL =
> http://openrails.org/images/support-logos.jpg
> BrakePipeChargingRate = 21
> BreakCouplers = False
> Cab2DStretch = 0
> CarVibratingLevel = (registry) 1
> DataLogger = False
> DistantMountains = False
> DistantMountainsLoweringValue = 5
> DistantMountainsViewingTiles = 20
> DoubleWire = False
> DynamicShadows = False
> FullScreen = (registry) True
> GraduatedRelease = False
> LODViewingExtention = ...

Read more...

Revision history for this message
Edward Keenan (edwardk) wrote : Re: System.ArgumentException at ORTS.ORTSPaths.GetFileFromFolders (MLT D&H Route causes crash during application of sand)

The cause of the crash which was caused by an error in the sms file has been found and corrected. This bug post can be officially closed..

Edward K.

Revision history for this message
Peter Gulyas (pzgulyas) wrote :

Looks like the behavior had been changed with Chris' recent changes to STFReader. Now the files with only closing quotation marks are silently ignored instead of triggering a crash. I think at least a warning should be written into log.

Peter Gulyas (pzgulyas)
tags: added: content
removed: crash sounds
Peter Gulyas (pzgulyas)
summary: - System.ArgumentException at ORTS.ORTSPaths.GetFileFromFolders (MLT D&H
- Route causes crash during application of sand)
+ STFReader silently ignores file name with closing quotation mark only
+ (was: MLT D&H Route causes crash during application of sand)
Revision history for this message
cjakeman (cjakeman) wrote :

Agree with you, Peter.

My aim was to improve diagnostics, not to hide them ! Although we now get 3 warnings in the log file about power units and kN instead of kW.

I'll look into the missing warning.

Chris

Changed in or:
importance: High → Low
assignee: nobody → cjakeman (cjakeman)
Revision history for this message
Peter Gulyas (pzgulyas) wrote :

Or, maybe, if you can, just auto-correct it. I don't know if it is possible, I just said it very silently. :)

cjakeman (cjakeman)
Changed in or:
status: Triaged → Fix Committed
Revision history for this message
cjakeman (cjakeman) wrote :

Tested again 6-Apr-2014 and poorly formed filenames with no leading "
filename.wav"
leads to a fatal exception - illegal characters in path in ORTSPaths.cs line 67

Resolved by changing STFReader.cs - ReadItem() to ignore trailing ".
The test filename is now reported as a missing sound file.

Changing STFReader.cs is dangerous, so tested on 12 different routes.

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.

Other bug subscribers

Remote bug watches

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