Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There are 22 known save games that crash OpenTTD (latest master) on load. #7602

Closed
James103 opened this issue May 22, 2019 · 7 comments
Closed

Comments

@James103
Copy link
Contributor

James103 commented May 22, 2019

Version

c1d26d8 (2019-05-19)

Expected results

The (22+) savegames listed below don't crash.

Actual results

  1. The savegame 'crash.sav' (!Disconnecting train #964) crashes while loading with Assertion failed at line 205 of d:\a\1\s\src\track_func.h: tracks == INVALID_TRACK_BIT || (tracks != TRACK_BIT_NONE && KillFirstBit(tracks & TRACK_BIT_MASK) == TRACK_BIT_NONE). Crash info has been generated.

  2. The savegame 'crash.sav' (Crash: Disconnecting road vehicle. #1627) crashes while loading with Disconnecting road vehicle. Crash info has been generated.

  3. The savegame 'crash.sav' (fatal application failure #1767) crashes while loading with Assertion failed at line 1035 of d:\a\1\s\src\newgrf_engine.cpp: !(e->u.air.subtype & AIR_CTOL). Crash info has been generated.

  4. The savegame 'Screenshot Apr 4th, 1976.sav' (truck got a non-existing cargo #6169) crashes with Assertion failed at line 305 of d:\a\1\s\src\cargopacket.h: this->action_counts[MTA_KEEP] + this->action_counts[MTA_DELIVER] + this->action_counts[MTA_TRANSFER] + this->action_counts[MTA_LOAD] == this->count when Road Vehicle 3 starts to unload at Wroclaw Woods. Workaround: Send Road Vehicle 3 to depot and sell/replace the vehicle. Crash info has been generated.

  5. The savegame 'crash.sav' (Loading savegame causes a crash. #5965) loads fine, but crashes with Assertion failed at line 113 of d:\a\1\s\src\pool_type.hpp: index < this->first_unused when you zoom out, scroll near certain places, or unpause the game. No crash info has been generated.

  6. The savegame 'TRT03.SV1' (Loading savegame causes a crash. #5965) loads fine, but as soon as you unpause the game, it crashes with Assertion failed at line 225 of d:\a\1\s\src\ground_vehicle.hpp: this->z_pos == GetSlopePixelZ(this->x_pos, this->y_pos). Crash info has been generated.

  7. The savegame 'TRT01.SV1' (Savegames Failing to Load #5306) crashes while loading with Assertion failed at line 4036 of d:\a\1\s\src\station_cmd.cpp: st->facilities == (FACIL_AIRPORT | FACIL_DOCK) && st->airport.type == AT_OILRIG. Crash info has been generated.

  8. The savegame 'ThunderHammer.sav' (Savegame not working for me on two computers - but works for others #5305) crashes while loading with Assertion failed at line 113 of d:\a\1\s\src\core\pool_type.hpp: index < this->first_unused. Crash info has been generated.

  9. The savegame 'Tax Fiddlers Anonymous, 31st Jul 2056.sav' (Assertion error on loading old game #5232) crashes while loading with Assertion failed at line 433 of d:\a\1\s\src\core\kdtree.hpp: this->Count() > 0. When I try to do the emergency savegame, it fails with two Windows-style "OpenTTD has stopped working" error messages in a row. Crash info has been generated.

  10. The savegame 'crash.sav' (Assertion failed after loading an earlier savegame with NewGRF #4723) loads fine, but after a few game ticks crashes with Assertion failed at line 133 of d:\a\1\s\src\pathfinder\follow_track.hpp: ... No crash info has been generated.

  11. The savegame 'crash.sav' (Came crashes for unknown reason #4683) loads fine, but after a couple of game days (25th Jan 2028), crashes with Assertion failed at line 74 of d:\a\1\s\src\yapf\yapf_ship.cpp: IsValidTrackDir(trackdir) (if using YAPF, edit: NPF crashes as well). No crash info has been generated.

  12. The savegame 'MC Transport.sav' (Crash #4524) crashes while loading with Assertion failed at line 114 of d:\a\1\s\src\gamelog.cpp: _gamelog_action_type == GLAT_NONE. Crash info has been generated.

  13. The savegame 'MC Transport-fixed2.sav' (Crash #4524) crashes while loading with Assertion failed at line 84 of d:\a\1\s\src\bitmap_type.h: this->Contains(tile) Crash info has been generated.

  14. The savegame 'Islanders Ltd., 18-04-2221.sav' (crash when unpausing old savegame #3970) loads fine, but crashes after a couple of game days (19th Apr 2221) with Assertion failed at line 263 of d:\a\1\s\src\vehicle.cpp: (this->vehstatus & VS_CRASHED) == 0. This assert is probably triggered by a bugged train in a depot at (412,352). Crash info has been generated.

  15. The savegame 'crash.sav' (Crash while loading (very) old savegame #3863) crashes while loading with a Disconnecting train error. No crash info has been generated.

  16. The savegame 'TRT01.SV1' (TTD savegame crashes after a short time #3601) crashes while loading with Assertion failed at line 4036 of d:\a\1\s\src\station_cmd.cpp: st->facilities == (FACIL_AIRPORT | FACIL_DOCK) && st->airport.type == AT_OILRIG. Crash info has been generated.

  17. All of the (3) 'crash.sav' savegames from (Assertion v->time_counter !=0 failed when rearranging path signals #3422) crash while loading with Assertion failed at line 1937 of d:\a\1\s\src\economy.cpp: v->load_unload_ticks != 0. No crash info has been generated for either of those savegames.

  18. The savegame 'totr.sav' (rewrite tunnel bridge enter proc #3304) crashes while loading with a Disconnecting train error. Crash info has been generated.

  19. The next 6 savegames from (Game Crash after loading savegame after closing program. #3049, Assertion failed at ..\src\economy.cpp:1540: front_v->cargo_payment == NULL #3046) crash after a few days with Assertion failed at line 1271 of d:\a\1\s\src\economy.cpp: front_v->cargo_payment == nullptr:

  1. The savegame 'crash.sav' (Deleting PBS-Signals can crash the game in some situations #2666) loads fine, but crashes with Assertion failed at line 1621 of d:\a\1\s\src\economy.cpp: front->current_order.IsType(OT_LOADING) when Train 5 starts loading/unloading. Crash info has been generated.

  2. The savegame 'TRT08.SV1' (Loading TTD savegame error #2560) crashes while loading with Assertion failed at line 4036 of d:\a\1\s\src\station_cmd.cpp: st->facilities == (FACIL_AIRPORT | FACIL_DOCK) && st->airport.type == AT_OILRIG. Crash info has been generated.

  3. The savegame 'Standard Transport, 20th Dec 1989' (Unable to remove rail/road tile that I created. #2311) loads fine, but can crash in two possible ways (both caused by removing level crossing tiles)

Steps to reproduce

Load each of the (22) savegames listed above and follow that savegame's specific crash-reproduction directions (if any).

@James103
Copy link
Contributor Author

James103 commented Jul 8, 2019

Version of OpenTTD

OpenTTD 1.9.2 (stable release)

Save games that don't crash in this version

  1. [1] The savegame 'crash.sav' (!Disconnecting train #964) loads fine, but outputs an error saying that 'Train 8' of 'Martin Meridius Transport' has invalid length. Upon closer inspection, the vehicle detail window shows 14 total cars (7 tiles), but the ingame length looks to be between 3 and 6 tiles.

  2. [3] The savegame 'crash.sav' (fatal application failure #1767) loads fine, but outputs many errors saying that all of the trains of 'Friedhaven Transport' has invalid length. Also, 3 out of the 4 NewGRFs loaded in the savegame are marked as 'disabled' for no reason other than that the climate is Toyland.

  3. [4] The savegame 'Screenshot Apr 4th, 1976.sav' (truck got a non-existing cargo #6169) loads fine, and the road vehicle starts unloading on the 13th of April, 1976. I think of this road vehicle as being a portal to another forest dimension whose trees are being cut down, and the cargo amount as being the health of the forest. The load percentage indicator uses a byte stored in memory, which is why it overflows many times. Also, '1,000 kg of wood' does not actually weigh 1,000 kg as expected, but only 875 kg, which is most likely a bug.

  4. [6] The savegame 'TRT03.SV1' (Loading savegame causes a crash. #5965) loads and simulates fine (as far as my testing goes).

  5. [7] The savegame 'TRT01.SV1' (Savegames Failing to Load #5306) loads and simulates fine (as far as my testing goes).

  6. [9] The savegame 'Tax Fiddlers Anonymous, 31st Jul 2056.sav' (Assertion error on loading old game #5232) loads and simulates fine (as far as my testing goes).

  7. [11] The savegame 'crash.sav' (Came crashes for unknown reason #4683) loads and simulates fine (as far as my testing goes). The reason it crashes is partly because the Original pathfinder was removed after 1.9.2, causing it to fallback to YAPF.

  8. [13] The savegame 'MC Transport-fixed2.sav' (Crash #4524) loads and simulates fine (as far as my testing goes).

  9. [14] The savegame 'Islanders Ltd., 18-04-2221.sav' (crash when unpausing old savegame #3970) loads and simulates fine (as far as my testing goes). When it would crash with the assertion in my original comment, OpenTTD 1.9.2 instead outputs 9 news messages saying "Floods! At least 0 missing, presumed dead after significant flooding!". Those messages don't disappear, indicating that the crashed trains are permanent.

  10. [16] The savegame 'TRT01.SV1' (TTD savegame crashes after a short time #3601) loads and simulates fine (as far as my testing goes).

  11. [17] All of the (3) 'crash.sav' savegames from (Assertion v->time_counter !=0 failed when rearranging path signals #3422) load and simulate fine (as far as my testing goes).

  12. [19a] 'Preset#2, 5th Aug 1946.sav' (Game Crash after loading savegame after closing program. #3049) loads and simulates fine (as far as my testing goes).

  13. [19b] 'kwx-eu2.sav' (Assertion failed at ..\src\economy.cpp:1540: front_v->cargo_payment == NULL #3046) loads and simulates fine (as far as my testing goes).

  14. [19d] 'jul_1947.sav' (Assertion failed at ..\src\economy.cpp:1540: front_v->cargo_payment == NULL #3046) loads and simulates fine (as far as my testing goes).

  15. [19e] 'jan_1947.sav' (Assertion failed at ..\src\economy.cpp:1540: front_v->cargo_payment == NULL #3046) loads and simulates fine (as far as my testing goes).

  16. [21] The savegame 'TRT08.SV1' (Loading TTD savegame error #2560) loads and simulates fine (as far as my testing goes).

  17. [22] The savegame 'Standard Transport, 20th Dec 1989' (Unable to remove rail/road tile that I created. #2311) loads and simulates fine, but demolishing the problematic railway tiles yields one error message in the form of "Message from company", and another regular error message. Both state: "Can't clear this area, owned by someone".

Save games that still crash in this version

  1. [2] The savegame 'crash.sav' (Crash: Disconnecting road vehicle. #1627) crashes while loading with Disconnecting road vehicle. No crash info has been generated.

  2. [5] The savegame 'crash.sav' (Loading savegame causes a crash. #5965) loads fine, but crashes (no crash log) when you scroll in certain places or unpause the game.

  3. [8] The savegame 'ThunderHammer.sav' (Savegame not working for me on two computers - but works for others #5305) crashes while loading with this log.

  4. [10] The savegame 'crash.sav' (Assertion failed after loading an earlier savegame with NewGRF #4723) loads fine, but after a few game ticks crashes with Disconnecting train. No crash info has been generated.

  5. [15] The savegame 'crash.sav' (Crash while loading (very) old savegame #3863) crashes while loading with a Disconnecting train error. No crash info has been generated.

  6. [18] The savegame 'totr.sav' (rewrite tunnel bridge enter proc #3304) crashes while loading with a Disconnecting train error. Crash info has been generated.

  7. [20] The savegame 'crash.sav' (Deleting PBS-Signals can crash the game in some situations #2666) loads fine, but simulating the next game tick causes the game to crash with this log.

Save games that fail to load

  1. [12] The savegame 'MC Transport.sav' (Crash #4524) fails to load, outputting Game Load Failed?Broken savegame - Invalid road vehicle subtype.

@Eddi-z
Copy link
Contributor

Eddi-z commented Jul 8, 2019

Note that 1.9.2 is a release build and has assertions disabled. This means it will less aggressively crash, but the invalid values might cause more subtle issues later.

@James103
Copy link
Contributor Author

Version of OpenTTD

20190707-master-g1e723934a1

New crashed savegame

  1. The savegames "autosave30.sav" and "crash.sav" (OpenTTD Crash Report (tunnelbridge_cmd.cpp) #4397) both crash on load with Assertion failed at line 1493 of /usr/src/OpenTTD/compile/src/tunnelbridge_cmd.cpp: GetTunnelBridgeTransportType(tile) != TRANSPORT_RAIL. Crash info has been attached. I'm adding this because the original issue was marked as fixed, without saying whatever it fixed existing savegames or not.

@Eddi-z
Copy link
Contributor

Eddi-z commented Jul 25, 2019

Uhm, what exactly are you trying to do here?

there is a huge difference between trying to fix a bug that might corrupt a savegame or trying to load a already corrupted savegame to undo the corruption. that second part is never really a goal for anyone.

@nielsmh
Copy link
Contributor

nielsmh commented Jul 25, 2019

I agree that repairing corrupted savegames should not be a goal as such. There's room for exceptions if a released version that was out for a long time had a bug that produced a large number of corrupted savegames, but one-offs are noise and would only add unnecessary complexity to the saveload code.
If you have single broken savegames that really need repair for whatever reason, make a specialised build of OTTD that repairs that specific issue, then re-save the game with the corruption fixed.

@PeterN
Copy link
Member

PeterN commented Jul 25, 2019

If it loads in 1.9.2, then yes it's very much valid and should load in master. There were known issues with the k-d tree loading, some of which was fixed, and likely issues with other big things that have been added...

@James103
Copy link
Contributor Author

James103 commented May 4, 2020

Not very useful in current state, so closing.

@James103 James103 closed this as completed May 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants