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

Assertion failure loading savegame with missing grf #7618

andythenorth opened this issue Jun 6, 2019 · 2 comments


Copy link

@andythenorth andythenorth commented Jun 6, 2019


This is a very specific case, involving changing grfs on a running game. This would not be valid for normal gameplay, but is absolutely inevitable for grf development

I have no expectation of support for the case described below. I added the ticket because peter1138 suggested it, with no promise of a fix.

Version of OpenTTD

a83b80bacfa4aa5da2a6043136749b164ac2b191 from #7380

Expected result

Game doesn't crash with failed assertion on load of a savegame where grfs are missing.

Actual result

Game crashes with "Assertion failed at line 229 of src/road.h: roadtype < ROADTYPE_END"

Steps to reproduce

For this specific case:

  • Road Hog grf has been recompiled multiple times and reloaded in a running game
  • the reloading has worked fine during gameplay
  • after restarting the game, OpenTTD no longer recognises the currently installed version of Road Hog as compatible with the version in the savegame
  • I have tried compiling and installing all the other recent revs of Road Hog, but the save appears to have a version with changes made in between commits
  • during grf dev, it is common for OpenTTD to not detect recompiled grfs as compatible with the version in a savegame, but usually OpenTTD does not crash, and newgrf settings can be used to swap out the grf (I am well aware of what can go wrong with this)

For additional bonuses, the save is from a game testing PR #7380, and also requires multiple unreleased grfs (in the attached zip, along with the .sav).

Additionally there is no crashlog, because OpenTTD has a guard and won't generate crashlogs when grfs are missing.

I'm not going to be shocked if this issue is rejected.


This comment has been minimized.

Copy link
Contributor Author

@andythenorth andythenorth commented Jun 6, 2019


This comment has been minimized.

Copy link
Contributor Author

@andythenorth andythenorth commented Jun 23, 2019

(lldb) up
frame #21: 0x000000010012468c openttdRoadVehicle::GetMaxTrackSpeed() const + 284 openttdRoadVehicle::GetMaxTrackSpeed:
-> 0x10012468c <+284>: leaq 0x308d3b(%rip), %rdi ; "Assertion failed at line %i of %s: %s"
0x100124693 <+291>: leaq 0x310a31(%rip), %rdx ; "OpenTTD.andythenorth/src/road_map.h"
0x10012469a <+298>: leaq 0x310a65(%rip), %rcx ; "MayHaveRoad(t)"
0x1001246a1 <+305>: movl $0xa6, %esi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
1 participant
You can’t perform that action at this time.