Skip to content

Conversation

@cesarBLG
Copy link
Contributor

Follow-up for #1070

If the signalling is corrupted, it is possible to get a signal added to the NORMAL signal list without actually having a NORMAL head, causing a null pointer exception.

@cesarBLG cesarBLG added the bug Something isn't working label May 21, 2025
twpol pushed a commit that referenced this pull request May 21, 2025
- Pull request #570 at 362e4e7: glTF 2.0 support with PBR lighting
- Pull request #1062 at 9a76b26: Train Forces popup Window.
- Pull request #1064 at 1be1fc4: Add Train Info tab to Help window (F1)
- Pull request #1084 at 13454ed: Timetable: Calculate Delay While Stopped at a Station
- Pull request #1074 at e9a66c1: Gradient - commit 2024-16-12
- Pull request #1085 at 37e2817: updates key commands for Train Operations window and also Daylight Offset
- Pull request #1086 at e10390b: Add Settings Exporter tool (copy settings to INI, etc)
- Pull request #1087 at 1f64f02: Improve warning message for signal location mismatch.
- Pull request #1088 at 4b3fa4c: Preserve previous log file.
- Pull request #1089 at d750bd1: Fix Superelevation on Rigid Frame Rolling Stock Again
- Pull request #1090 at 33d2582: Add null check to avoid crash on corrupt signal files
- Pull request #1082 at 5845a1a: Allow variable water level in glass gauge
- Pull request #1081 at 689494b: Brake cuts power unification
twpol pushed a commit that referenced this pull request May 22, 2025
- Pull request #570 at 362e4e7: glTF 2.0 support with PBR lighting
- Pull request #1062 at 9a76b26: Train Forces popup Window.
- Pull request #1064 at 1be1fc4: Add Train Info tab to Help window (F1)
- Pull request #1074 at e9a66c1: Gradient - commit 2024-16-12
- Pull request #1085 at 37e2817: updates key commands for Train Operations window and also Daylight Offset
- Pull request #1086 at e10390b: Add Settings Exporter tool (copy settings to INI, etc)
- Pull request #1087 at 1f64f02: Improve warning message for signal location mismatch.
- Pull request #1088 at 4b3fa4c: Preserve previous log file.
- Pull request #1089 at d750bd1: Fix Superelevation on Rigid Frame Rolling Stock Again
- Pull request #1090 at 33d2582: Add null check to avoid crash on corrupt signal files
- Pull request #1092 at 18238f4: Adds $req, depart-early and passing -time to Manual
- Pull request #1082 at 5845a1a: Allow variable water level in glass gauge
- Pull request #1081 at 689494b: Brake cuts power unification
@rwf-rr
Copy link
Contributor

rwf-rr commented May 22, 2025

I created a bug for this yesterday. https://bugs.launchpad.net/or/+bug/2111454

@rwf-rr
Copy link
Contributor

rwf-rr commented May 22, 2025

Should there be a warning log to provide a hint that there is a faulty signal? Or would that be reported / detected somewhere else anyway?

@cesarBLG
Copy link
Contributor Author

This was initially reported at https://www.elvastower.com/forums/index.php?/topic/38716-sigscr-prooblem but PR #1070 was merged before I had time to say that the bug hadn't been fixed yet.

Definitely logging a warning would be useful, but not here. The TCS is merely consuming a corrupted data structure (functionHead should never be null: all the signals in the list should have one SignalHead from the requested type).

I believe the bug happens specifically for NORMAL signals, but only in Activity or Timetable mode (i.e. not in Explorer mode). This is because the information for NORMAL signals is extracted from a different place in such case:

PlayerTrainSignals[dir][SignalFunction.NORMAL].Add(thisItem);

My guess is that there is a signal in SignalObjectItems that qualifies as a NORMAL signal even though it doesn't have a NORMAL head. Not sure if this is caused by a bug in OR, or due to mismatch between SIGCFG, World and TDB files.

In my opinion, the bug should be solved by ensuring the consistency of SignalObjectItems and/or PlayerTrainSignals, but as this bug seems to happen only for specific routes, it's hard to debug. This fix at least solves the crash. The information is not used in many more places anyway, so solving the consistency bug is low priority.

twpol pushed a commit that referenced this pull request May 22, 2025
- Pull request #570 at 362e4e7: glTF 2.0 support with PBR lighting
- Pull request #1062 at 9a76b26: Train Forces popup Window.
- Pull request #1064 at 1be1fc4: Add Train Info tab to Help window (F1)
- Pull request #1085 at 37e2817: updates key commands for Train Operations window and also Daylight Offset
- Pull request #1086 at e10390b: Add Settings Exporter tool (copy settings to INI, etc)
- Pull request #1087 at 1f64f02: Improve warning message for signal location mismatch.
- Pull request #1088 at 4b3fa4c: Preserve previous log file.
- Pull request #1089 at d750bd1: Fix Superelevation on Rigid Frame Rolling Stock Again
- Pull request #1090 at 33d2582: Add null check to avoid crash on corrupt signal files
- Pull request #1092 at 18238f4: Adds $req, depart-early and passing -time to Manual
- Pull request #1082 at 5845a1a: Allow variable water level in glass gauge
- Pull request #1081 at 689494b: Brake cuts power unification
- Pull request #1091 at b0c622b: Automatic speed control
twpol pushed a commit that referenced this pull request May 22, 2025
- Pull request #570 at 362e4e7: glTF 2.0 support with PBR lighting
- Pull request #1062 at 9a76b26: Train Forces popup Window.
- Pull request #1064 at 1be1fc4: Add Train Info tab to Help window (F1)
- Pull request #1085 at 37e2817: updates key commands for Train Operations window and also Daylight Offset
- Pull request #1086 at e10390b: Add Settings Exporter tool (copy settings to INI, etc)
- Pull request #1087 at 1f64f02: Improve warning message for signal location mismatch.
- Pull request #1088 at 4b3fa4c: Preserve previous log file.
- Pull request #1089 at d750bd1: Fix Superelevation on Rigid Frame Rolling Stock Again
- Pull request #1090 at 33d2582: Add null check to avoid crash on corrupt signal files
- Pull request #1092 at d5816e4: Adds $gradient, $req, depart-early and passing-time to Manual
- Pull request #1082 at 5845a1a: Allow variable water level in glass gauge
- Pull request #1081 at 689494b: Brake cuts power unification
- Pull request #1091 at b0c622b: Automatic speed control
twpol pushed a commit that referenced this pull request May 23, 2025
- Pull request #570 at 362e4e7: glTF 2.0 support with PBR lighting
- Pull request #1062 at 9a76b26: Train Forces popup Window.
- Pull request #1064 at 1be1fc4: Add Train Info tab to Help window (F1)
- Pull request #1085 at 37e2817: updates key commands for Train Operations window and also Daylight Offset
- Pull request #1086 at e10390b: Add Settings Exporter tool (copy settings to INI, etc)
- Pull request #1087 at 1f64f02: Improve warning message for signal location mismatch.
- Pull request #1088 at 4b3fa4c: Preserve previous log file.
- Pull request #1089 at d750bd1: Fix Superelevation on Rigid Frame Rolling Stock Again
- Pull request #1090 at 9e0bfe8: Add null check to avoid crash on corrupt signal files
- Pull request #1092 at d5816e4: Adds $gradient, $req, depart-early and passing-time to Manual
- Pull request #1082 at 5845a1a: Allow variable water level in glass gauge
- Pull request #1081 at 689494b: Brake cuts power unification
- Pull request #1091 at b0c622b: Automatic speed control
twpol pushed a commit that referenced this pull request May 23, 2025
- Pull request #570 at 362e4e7: glTF 2.0 support with PBR lighting
- Pull request #1062 at 9a76b26: Train Forces popup Window.
- Pull request #1064 at 1be1fc4: Add Train Info tab to Help window (F1)
- Pull request #1085 at 37e2817: updates key commands for Train Operations window and also Daylight Offset
- Pull request #1086 at e10390b: Add Settings Exporter tool (copy settings to INI, etc)
- Pull request #1087 at 1f64f02: Improve warning message for signal location mismatch.
- Pull request #1088 at 4b3fa4c: Preserve previous log file.
- Pull request #1090 at 9e0bfe8: Add null check to avoid crash on corrupt signal files
- Pull request #1092 at d5816e4: Adds $gradient, $req, depart-early and passing-time to Manual
- Pull request #1082 at 5845a1a: Allow variable water level in glass gauge
- Pull request #1081 at 689494b: Brake cuts power unification
- Pull request #1091 at b0c622b: Automatic speed control
Copy link
Contributor

@rwf-rr rwf-rr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine, and fixes the case I reported in the bug.

twpol pushed a commit that referenced this pull request May 23, 2025
- Pull request #570 at 362e4e7: glTF 2.0 support with PBR lighting
- Pull request #1062 at 9a76b26: Train Forces popup Window.
- Pull request #1064 at 1be1fc4: Add Train Info tab to Help window (F1)
- Pull request #1085 at 37e2817: updates key commands for Train Operations window and also Daylight Offset
- Pull request #1086 at e10390b: Add Settings Exporter tool (copy settings to INI, etc)
- Pull request #1090 at 9e0bfe8: Add null check to avoid crash on corrupt signal files
- Pull request #1092 at d5816e4: Adds $gradient, $req, depart-early and passing-time to Manual
- Pull request #1082 at 5845a1a: Allow variable water level in glass gauge
- Pull request #1081 at 689494b: Brake cuts power unification
- Pull request #1091 at b0c622b: Automatic speed control
twpol pushed a commit that referenced this pull request May 24, 2025
- Pull request #570 at 362e4e7: glTF 2.0 support with PBR lighting
- Pull request #1062 at 9a76b26: Train Forces popup Window.
- Pull request #1064 at 1be1fc4: Add Train Info tab to Help window (F1)
- Pull request #1085 at 37e2817: updates key commands for Train Operations window and also Daylight Offset
- Pull request #1086 at e10390b: Add Settings Exporter tool (copy settings to INI, etc)
- Pull request #1090 at 9e0bfe8: Add null check to avoid crash on corrupt signal files
- Pull request #1092 at 7cc63cb: Adds $gradient, $req, depart-early and passing-time to Manual
- Pull request #1082 at 5845a1a: Allow variable water level in glass gauge
- Pull request #1081 at 689494b: Brake cuts power unification
- Pull request #1091 at b0c622b: Automatic speed control
twpol pushed a commit that referenced this pull request May 24, 2025
- Pull request #570 at 362e4e7: glTF 2.0 support with PBR lighting
- Pull request #1062 at 9a76b26: Train Forces popup Window.
- Pull request #1064 at 1be1fc4: Add Train Info tab to Help window (F1)
- Pull request #1085 at 37e2817: updates key commands for Train Operations window and also Daylight Offset
- Pull request #1086 at e10390b: Add Settings Exporter tool (copy settings to INI, etc)
- Pull request #1090 at 9e0bfe8: Add null check to avoid crash on corrupt signal files
- Pull request #1092 at 344634b: Adds $gradient, $req, depart-early and passing-time to Manual
- Pull request #1082 at 5845a1a: Allow variable water level in glass gauge
- Pull request #1081 at 689494b: Brake cuts power unification
- Pull request #1091 at b0c622b: Automatic speed control
@cesarBLG cesarBLG merged commit 9d6ee35 into openrails:master May 24, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Development

Successfully merging this pull request may close these issues.

2 participants