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

[Bug]: Assertion fails when loading the save while missing a newgrf #9593

Open
ldpl opened this issue Oct 2, 2021 · 1 comment
Open

[Bug]: Assertion fails when loading the save while missing a newgrf #9593

ldpl opened this issue Oct 2, 2021 · 1 comment

Comments

@ldpl
Copy link
Contributor

@ldpl ldpl commented Oct 2, 2021

Version of OpenTTD

master (78d66b7) and 12.0-RC1

Expected result

No assertion/crash, at least until unpaused.

Actual result

dbg: [script] The savegame has an GameScript by the name 'Renewed Village Growth', version 11 which is no longer available.
dbg: [script] The latest version of that GameScript has been loaded instead, but it'll not get the savegame data as it's incompatible.
dbg: [grf] NewGRF 41560103 (egrvts_v2.1-r228\egrvts2_1.grf) not found; checksum 82652C20346637F1A7F87C9CF233E4C2
openttd: /home/pavels/Projects/OpenTTD/src/road.h:227: const RoadTypeInfo* GetRoadTypeInfo(RoadType): Assertion `roadtype < ROADTYPE_END' failed.
Loading your savegame caused OpenTTD to crash.
This is most likely caused by a missing NewGRF or a NewGRF that
has been loaded as replacement for a missing NewGRF. OpenTTD
cannot easily determine whether a replacement NewGRF is of a newer
or older version.
It will load a NewGRF with the same GRF ID as the missing NewGRF.
This means that if the author makes incompatible NewGRFs with the
same GRF ID OpenTTD cannot magically do the right thing. In most
cases OpenTTD will load the savegame and not crash, but this is an
exception.
Please load the savegame with the appropriate NewGRFs installed.
The missing/compatible NewGRFs are:
NewGRF 41560103 (egrvts_v2.1-r228\egrvts2_1.grf) not found; checksum 82652C20346637F1A7F87C9CF233E4C2.

A serious fault condition occurred in the game. The game will shut down.
As you loaded an savegame for which you do not have the required NewGRFs
no crash information will be generated.
Aborted (core dumped)

Steps to reproduce

  1. Load the attached save while missing egrvts grf (checksum 82652C20346637F1A7F87C9CF233E4C2)
    Greenhills_Transport_1850.zip (provided by Brandon on reddit discord)

Not sure if me having older versions of egrvts affects anything.

Also, 1.11.2 can load the save even though it crashes later if unpaused.

@TrueBrain
Copy link
Member

@TrueBrain TrueBrain commented Oct 3, 2021

Also, 1.11.2 can load the save even though it crashes later if unpaused.

This is only true because for releases assertions are disabled. If I enable this on release/1.11 branch, it produces the exact same crash. In other words, this is not a regression from 1.11 to 12.

I have to say, I am unsure if this is actually a bug. We explicit do not support this, as it is nearly impossible to prevent crashes in all scenarios. There is a reason you cannot press the Load button unless you have newgrf_developer_tools set to true.

In short: I think this is a "working as expected" scenario. We give clear information what went wrong, we indicate what to do to resolve it. Not much more we can do about it.

I leave it for another developer to confirm my reasoning.

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants