System.ArgumentOutOfRangeException at ORTS.AITrain.ProcessEndOfPath (X3169, 3DTrains WP 3rd Sub, CZ Eastbound)

Bug #1468108 reported by Derek Morton
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Open Rails
Fix Released
Medium
Carlo Santucci

Bug Description

running wp3.
I was not at the controls at the time.

Tags: ai crash
Revision history for this message
Derek Morton (derek-a) wrote :
James Ross (twpol)
summary: - System.ArgumentOutOfRangeException: Index was out of range
+ System.ArgumentOutOfRangeException at ORTS.AITrain.ProcessEndOfPath
+ (X3169, 3DTrains WP 3rd Sub, CZ Eastbound)
tags: added: ai crash
Changed in or:
status: New → Triaged
Revision history for this message
Carlo Santucci (carlosanit1) wrote :

This happened to the autopiloted train. Had it arrived at its last station?

Revision history for this message
Derek Morton (derek-a) wrote : Re: [Bug 1468108] Re: System.ArgumentOutOfRangeException at ORTS.AITrain.ProcessEndOfPath (X3169, 3DTrains WP 3rd Sub, CZ Eastbound)

Hi Carlo,

As it was a crash to desktop and I was not at the controls, I am unable
to confirm.

cheers
Derek

On 25/06/2015 6:33, Carlo Santucci wrote:
> This happened to the autopiloted train. Had it arrived at its last
> station?
>

Revision history for this message
James Ross (twpol) wrote :

Might be the same as bug 1213361, though that has no further details either.

Revision history for this message
Carlo Santucci (carlosanit1) wrote :

James, thanks for the link.
The immediate cause is quite surely the same ( PresentPosition[0].RouteListIndex = -1 ), that is train front off path, the initial cause however is probably different. In bug 1213361 the train was voluntarily put off path, while this is not Derek's case (computer unattended and autopiloted player train running). A check on RouteListIndex == -1 should be added, however what should be done then? If it is a pure AI train, it could be simply removed, as standard for AI trains off path, but if it is the autopiloted player train this would replace a crash with a game end, which has the same effect. I see that in Derek's case ProcessEndOfPath is called when the train is at a station. So maybe the path is terminated just within (or immediately after) the station's platform.
Derek, could you pls. attach a screenshot of the path's end taken with the MSTS activity editor?

Revision history for this message
Derek Morton (derek-a) wrote :
  • route end.docx Edit (1.4 MiB, application/vnd.openxmlformats-officedocument.wordprocessingml.document; name="route end.docx")

Hi Carlo,

Is this pic good enough?

cheers
Derek

On 25/06/2015 19:09, Carlo Santucci wrote:
> James, thanks for the link.
> The immediate cause is quite surely the same ( PresentPosition[0].RouteListIndex = -1 ), that is train front off path, the initial cause however is probably different. In bug 1213361 the train was voluntarily put off path, while this is not Derek's case (computer unattended and autopiloted player train running). A check on RouteListIndex == -1 should be added, however what should be done then? If it is a pure AI train, it could be simply removed, as standard for AI trains off path, but if it is the autopiloted player train this would replace a crash with a game end, which has the same effect. I see that in Derek's case ProcessEndOfPath is called when the train is at a station. So maybe the path is terminated just within (or immediately after) the station's platform.
> Derek, could you pls. attach a screenshot of the path's end taken with the MSTS activity editor?
>

Revision history for this message
Carlo Santucci (carlosanit1) wrote :

Thanks Derek,
unfortunately it's not an OR screenshot what I need. You should open the MSTS activity editor, load the problematic activity, go select the player service, then its path, entering the path editor, and then you should enlarge the final part of the path and take a screenshot.

Revision history for this message
Derek Morton (derek-a) wrote :
  • route end.docx Edit (32.3 KiB, application/vnd.openxmlformats-officedocument.wordprocessingml.document; name="route end.docx")

Hi Carlo,

second try

On 26/06/2015 1:35, Carlo Santucci wrote:
> Thanks Derek,
> unfortunately it's not an OR screenshot what I need. You should open the MSTS activity editor, load the problematic activity, go select the player service, then its path, entering the path editor, and then you should enlarge the final part of the path and take a screenshot.
>

Revision history for this message
Carlo Santucci (carlosanit1) wrote :

Thanks Derek, that's the right one, and it's as I suspected. The path ends just before the switch. For some reason I expect the train reached the switch (off path) and stopped. The method called is not protected against off path positions.

Revision history for this message
Carlo Santucci (carlosanit1) wrote :

First fix in x.3176.
Derek, could you pls. check if it avoids the crash? The program should now bypass the point that causes the crash, but I don't know if it crashes a bit further, because I can't kill an autopiloted train. If necessary a check shall be added further down the code.

Changed in or:
status: Triaged → In Progress
Revision history for this message
Carlo Santucci (carlosanit1) wrote :

By the way, if you have an intermediate save you can restart from it. Pls. run in autopilot mode as happened when you had the crash.

Revision history for this message
Derek Morton (derek-a) wrote :

Hi Carlo,

No crash, and the train stops right next to the point.

cheers

On 27/06/2015 3:14, Carlo Santucci wrote:
> By the way, if you have an intermediate save you can restart from it.
> Pls. run in autopilot mode as happened when you had the crash.
>

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

Changed in or:
status: In Progress → Fix Committed
James Ross (twpol)
Changed in or:
importance: Undecided → Medium
milestone: none → 1.1
assignee: nobody → Carlo Santucci (carlosanit1)
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.