codenamecpp / carnage3d

Reimplementation of Grand Theft Auto 1 [GTA1]
MIT License
477 stars 38 forks source link

Assertion `false' failed #56

Closed neuromancer closed 3 years ago

neuromancer commented 3 years ago

Latest revision (1d44f7a19c7ec7076f0d94aa9f483a3ae0cced0e) fails to run:

$ make run_demoversion
./bin/carnage3d-debug -mapname SANB.CMP -gtadata "gamedata/demoversions/GTAECTS/GTADATA"
Carnage3D 0.0.2
System initialize
Working directory: '/home/g/Games/carnage3d/bin'
carnage3d-debug: ../src/FileSystem.cpp:284: bool FileSystem::ReadConfig(const std::string &, cxx::json_document &): Assertion `false' failed.
make: *** [Makefile:39: run_demoversion] Aborted (core dumped)
codenamecpp commented 3 years ago

Hm, it works fine on my linux, check the config/sys_config.json , I think it can be broken - just rename it temporarily to quick test.

neuromancer commented 3 years ago

Oh, sorry about that. You are right. Using the default file will work. To reproduce this crash, use an empty config file. This probably means some default value is incorrect or invalid. Feel free to close this issue if you require some valid values in the config file.

codenamecpp commented 3 years ago

Hi! I made some changes in config reading/writing routines recently, it might be more robust than previous, could you please check if the problem still occurs?

PS: unfortunately new config format is not compatible with old one

neuromancer commented 3 years ago

Still happening in 679f07c6ed3aef5b5ab43c74de80f8189a47a0be:

$ make run_demoversion
./bin/carnage3d-debug -mapname SANB.CMP -gtadata "gamedata/demoversions/GTAECTS/GTADATA"
Carnage3D 0.0.3
System initialize
Working directory: '/home/g/Games/carnage3d/gamedata'
carnage3d-debug: ../src/FileSystem.cpp:311: bool FileSystem::ReadConfig(const std::string &, cxx::json_document &): Assertion `false' failed.
make: *** [Makefile:39: run_demoversion] Aborted (core dumped)
MiroslavR commented 3 years ago

IMO, this is a user error. An empty string is invalid JSON, maybe {} is what you want.

neuromancer commented 3 years ago

If you run jq . with an empty file, it will return zero (the same as running with a file that contains {}. However, I believe it is still acceptable to have an error saying that the file is empty and you expect at least a dictionary.

codenamecpp commented 3 years ago

Okay, I've change default build configuration to 'release', so that will stop firing asserts on users machines.