X Tutup
Skip to content

Current master build crashes when loading savefiles created with current release #5920

@mwerle

Description

@mwerle

Observed behaviour

Attempt to load a savegame created with the current AppImage release (https://github.com/pioneerspacesim/pioneer/releases/download/20240710/Pioneer-x86_64.AppImage) with the current master build crashes.

pioneer: /home/micha/Source/Pioneer/contrib/json/json.hpp:14412: const nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer>::value_type& nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer>::operator[](T*) const [with T = const char; ObjectType = std::map; ArrayType = std::vector; StringType = std::__cxx11::basic_string<char>; BooleanType = bool; NumberIntegerType = long int; NumberUnsignedType = long unsigned int; NumberFloatType = double; AllocatorType = std::allocator; JSONSerializer = nlohmann::adl_serializer; const_reference = const nlohmann::basic_json<>&]: Assertion `m_value.object->find(key) != m_value.object->end()' failed.
Aborted (core dumped)

This appears to have been broken by #5840

Despite the description stating that there would be a bump in the savefile version, both the old and the new savefile (attached below) are version 90.

A new save created with the current master build ("Micha_test_new.json") shows that the "Shields" entry of the player ship ("MW72") has moved location from the "model_body" to the "ship". There is no fall-back if the "shields" entry under "ship" does not exist and the above assertion in the JSON parser is triggered and the game crashes.

Expected behaviour

Game successfully loads older savegame.

Steps to reproduce

  • Create a savefile using the current AppImage release
  • Compile current "master" from GitHub
  • Attempt to load savefile -> assertion failure and game crashes.

My pioneer version (and OS):

OS: Debian GNU/Linux 12

Pioneer Version: as described above

My output.txt (required) and game save (optional, but recommended)

Save 1: "Micha_test.json" : created using AppImage version
Save 2: "Micha_test_new.json" : created using current "master" build

Micha_test_new.json
Micha_test.json
output.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      X Tutup