Closed ghost closed 2 years ago
Is there any other output in the terminal? Can you please run like so and report any log on the terminal?
/usr/local/game/stratagus -p -d /home/alex/.stratagus/data.Wargus
10:28:37 alex@Enki ~ → /usr/local/games/stratagus -p -d /home/alex/.stratagus/data.Wargus
GameCycle: 0d, init seed: 87654321
backtrace() returned 7 addresses
/usr/local/games/stratagus[0x54cab2]
/usr/local/games/stratagus[0x54ed82]
/usr/local/games/stratagus[0x54c662]
/usr/local/games/stratagus[0x52d8db]
/lib64/libc.so.6(+0x2d560)[0x7f12a5886560]
/lib64/libc.so.6(__libc_start_main+0x7c)[0x7f12a588660c]
/usr/local/games/stratagus[0x40bd55]
[0x0]
[0x0]
[0x0]
[0x653a443a643a6361]
[0x69683a4767463a45]
[0x0]
[0x0]
[0x0]
[0x0]
[0x0]
[0x0]
[0x5c5c5c5c5c5c5c5c]
[0x5c5c5c5c5c5c5c5c]
[0x0]
[0x0]
[0x0]
[0x0]
[0x26a00ff]
[0x7ffdb7276c80]
[0x2f2f2f2f2f2f2f2f]
[0x2f2f2f2f2f2f2f2f]
[0x0]
[0x0]
[0x0]
[0x0]
[0x0]
[0x0]
[0x653a443a643a6361]
[0x69683a4767463a45]
[0x0]
[0x0]
[0x0]
[0x0]
[0x0]
[0x0]
[0x0]
[0x0]
[0x0]
[0x0]
[0x0]
[0x0]
[0x0]
[0x0]
[0x0]
[0x0]
[0x0]
[0x0]
[0x22]
[0x1]
[0x0]
[0x21]
[0x20]
/lib64/libc.so.6(malloc+0x1a2)[0x7f12a58f67c2]
[0x30]
/lib64/libc.so.6(+0x202c80)[0x7f12a5a5bc80]
[0x2]
[0x8000000000000006]
[0x0]
[0x0]
[0x0]
[0x0]
[0x0]
[0x0]
[0x0]
[0x21]
[0x7ffdb7278f73]
[0x123062d99a146e00]
[0x7ffdb7277780]
[0x123062d99a146e00]
[0x0]
[0x7ffdb7277780]
[0x7ffdb7277978]
/usr/local/games/stratagus[0x52d8bb]
/lib64/ld-linux-x86-64.so.2(_rtld_global_ro+0x0)[0x7f12a602fc00]
/lib64/libc.so.6(_IO_fprintf+0x9a)[0x7f12a58b68ba]
[0x3000000020]
[0x7ffdb7277780]
[0x7ffdb72776c0]
[0x123062d99a146e00]
[0x0]
[0x0]
[0x0]
[0x87654321]
[0x1]
[0x0]
[0x7ffdb7277978]
[0x40000001e]
[0x7ffdb7277740]
[0x1a]
[0x7ffdb7277820]
/usr/local/games/stratagus[0x8c0920]
[0x9]
[0x7ffdb7278f54]
Segmentation fault (core dumped)
Running GDB gives:
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7f797dd in index2adr (idx=990998, L=0x976e70) at /usr/src/debug/compat-lua-5.1.5-19.fc35.x86_64/src/lapi.c:71
Downloading 0.01 MB source file /usr/src/debug/compat-lua-5.1.5-19.fc35.x86_64/src/lapi.c
71 return (idx <= func->c.nupvalues)
(gdb) bt
#0 0x00007ffff7f797dd in index2adr (idx=990998, L=0x976e70) at /usr/src/debug/compat-lua-5.1.5-19.fc35.x86_64/src/lapi.c:71
#1 index2adr (idx=-1001000, L=0x976e70) at /usr/src/debug/compat-lua-5.1.5-19.fc35.x86_64/src/lapi.c:49
#2 lua_rawget (L=L@entry=0x976e70, idx=idx@entry=-1001000) at /usr/src/debug/compat-lua-5.1.5-19.fc35.x86_64/src/lapi.c:560
#3 0x00007ffff7da5549 in tolua_open (L=0x976e70) at src/lib/tolua_map.c:297
#4 0x000000000063f539 in tolua_stratagus_open(lua_State*) ()
#5 0x000000000053d09f in InitLua() ()
#6 0x000000000054c688 in stratagusMain(int, char**) ()
#7 0x000000000052d8db in main ()
This is what I am seeing after trying to run Wargus in the terminal.
I will try rebuilding with -DCMAKE_BUILD_TYPE=Debug and see if anything more obvious is visible.
Running GDB gives:
Program received signal SIGSEGV, Segmentation fault. 0x00007ffff7f797dd in index2adr (idx=990998, L=0x976e70) at /usr/src/debug/compat-lua-5.1.5-19.fc35.x86_64/src/lapi.c:71 Downloading 0.01 MB source file /usr/src/debug/compat-lua-5.1.5-19.fc35.x86_64/src/lapi.c 71 return (idx <= func->c.nupvalues) (gdb) bt #0 0x00007ffff7f797dd in index2adr (idx=990998, L=0x976e70) at /usr/src/debug/compat-lua-5.1.5-19.fc35.x86_64/src/lapi.c:71 #1 index2adr (idx=-1001000, L=0x976e70) at /usr/src/debug/compat-lua-5.1.5-19.fc35.x86_64/src/lapi.c:49 #2 lua_rawget (L=L@entry=0x976e70, idx=idx@entry=-1001000) at /usr/src/debug/compat-lua-5.1.5-19.fc35.x86_64/src/lapi.c:560 #3 0x00007ffff7da5549 in tolua_open (L=0x976e70) at src/lib/tolua_map.c:297 #4 0x000000000063f539 in tolua_stratagus_open(lua_State*) () #5 0x000000000053d09f in InitLua() () #6 0x000000000054c688 in stratagusMain(int, char**) () #7 0x000000000052d8db in main ()
That looks like it crashes inside the lua library somewhere... odd
I tried looking for the tolua_stratagus_open function, but I can't really see where it is implemented.
cd stratagus/
/home/alex/repos/stratagus
11:10:32 alex@Enki stratagus ±|master ✗|→ grep -R tolua_stratagus_open .
./src/stratagus/script.cpp:extern int tolua_stratagus_open(lua_State *tolua_S);
./src/stratagus/script.cpp: tolua_stratagus_open(Lua);
grep: ./build/stratagus: binary file matches
Running it in gdb after make clean
ing and rerunning cmake with -DCMAKE_BUILD_TYPE=Debug and rebuilding didn't change any of the output.
Using the same data directory with the windows version of Stratagus running on wine works. So probably just an issue with the version of lua used on Fedora 35? Maybe lua is something that should be compiled as part of the build?
I am trying currently to get it to link to luajit, which should be lua 5.1 compatible, but am running into issues with tolua++ linking to lua 5.4. I will let you know if I can get another lua working.
Argh, yes, tolua++ definitely must link to Lua5.1, I had linker confusion there in the past. I'm not sure why it would fail on Fedora, when the Debian version of 5.1 works just fine, I can only imagine some platform patches.
I managed to build tolua from (https://github.com/LuaDist/toluapp) and link it against luajit, but now compilation is failing for stratagus:
[ 99%] Generating tolua.cpp
** tolua internal error: [string "tolua embedded: src/bin/lua/package.lua"]:325: attempt to call field 'gfind' (a nil value).
stack traceback:
[string "tolua: embedded Lua code 23"]:6: in main chunk
[ 99%] Building CXX object CMakeFiles/stratagus.dir/tolua.cpp.o
cc1plus: fatal error: /home/alex/repos/stratagus/build/tolua.cpp: No such file or directory
So I might try this more next weekend and see if I can get the version of tolua++ from debian to build against luajit and try again.
you don't actually need toluapp to link against luajit. all it does is generate cpp bindings, and those are compatible between lua 5.1 and luajit.
I was building it from source since the version that ships in the fedora repos pulls in lua 5.4, and figured I may as well try using luajit since when running Wargus linked against the compat-lua-5.1 I was getting that segfault.
My thinking is that there is some combination of lua versions being used by different parts that is causing my issue since whatever versions are being used by debian/ubuntu seem to work. If compiling things against a single version works for me then I might be able to integrate the building of tolua++ and lua as part of the stratagus build, which would be ideal since then it would no longer depend on the versions shipped with the distribution. As part of that I figured luajit is at least an interesting change from the standard lua 5.1(is in a nonstandard location on my distribution, so requires lots of path changes). Plus messing around with stuff and seeing if any of it works is a decent way to get familiar with new code.
tolua++ and lua 5.1 are both fairly old at this point, at least the versions I am seeing, so it might make sense to vendor those in since they are very unlikely to change.
I am thinking one larger goal after I can get this working, would be trying to create an appimage version of the game(so it could run on any reasonable linux), which will work best if more of the dependencies are in one location(https://docs.appimage.org/packaging-guide/from-source/native-binaries.html#packaging-existing-binaries-or-manually-packaging-everything).
If you would like I can close this issue since it wasn't clear at the start it was about the system lua versions, and maybe reopen a more directed issue to keep things tidier. Especially since this seems to be a Stratagus issue, instead of Wargus.
I have opened this as an issue on Stratagus(https://github.com/Wargus/stratagus/issues/366), since this is no longer a wargus issue.
Describe the bug I built Stratagus and Wargus from a fresh git clone on Fedora 35, and ran Wargus. I pointed it at the install.exe from my BNE cd. Running Wargus after the extraction process, it fails to run with an error.
To Reproduce Steps to reproduce the behavior:
After that is a bunch of ffmpeg commands and output, and a bunch of lists of files being extracted.
(zenity:22972): Gtk-WARNING **: 10:41:26.689: Failed to set text 'Stratagus failed to load game data. If you just launched the game without any arguments, this may indicate a bug with the extraction process. Please report this on https://github.com/Wargus/stratagus/issues/new, and please give details, including: operating system, installation path, username, kind of source CD. If you got an error message about the extraction command failing, please try to run it in a console and post the output to the issue. A common problem is symbols in the path for the installation, the game data path, or the username (like an & or !). Try changing these. Try also to remove the folder /home/alex/.stratagus/data.Wargus and try the extraction again.' from markup due to error parsing markup: Error on line 1: Entity did not end with a semicolon; most likely you used an ampersand character without intending to start an entity — escape ampersand as &
/run/media/alex/WAR2BNECD/
10:41:56 alex@Enki ~ → cd /home/alex/.stratagus/data.Wargus 10:45:57 alex@Enki data.Wargus → ls campaigns data_copied.wargus extracted graphics install.exe maps music scripts shaders sounds support videos 10:45:58 alex@Enki data.Wargus → ls ./*/ ./campaigns/: credits2.txt.gz credits.txt.gz human human-exp orc orc-exp
./graphics/: human missiles neutral orc tilesets ui
./maps/: 'All You Need BNE.pud.smp.gz' 'Crosshair BNE.pud.sms.gz' 'Frosty Fjords BNE.pud.sms.gz' king scenario 'The River Kwai BNE.pud.smp.gz' 'All You Need BNE.pud.sms.gz' 'Dark Paths BNE.pud.smp.gz' ftm ladder 'Schwartzwald BNE.pud.smp.gz' 'The River Kwai BNE.pud.sms.gz' 'Ant Trails BNE.pud.smp.gz' 'Dark Paths BNE.pud.sms.gz' 'Gold Rush BNE.pud.smp.gz' 'More Precious than Gold BNE.pud.smp.gz' 'Schwartzwald BNE.pud.sms.gz' 'Training Ground BNE.pud.smp.gz' 'Ant Trails BNE.pud.sms.gz' 'Dark Peninsula BNE.pud.smp.gz' 'Gold Rush BNE.pud.sms.gz' 'More Precious than Gold BNE.pud.sms.gz' skirmish 'Training Ground BNE.pud.sms.gz' 'Big Rock Candy Mountain BNE.pud.smp.gz' 'Dark Peninsula BNE.pud.sms.gz' 'Great White North BNE.pud.smp.gz' 'Mud in Your Eye BNE.pud.smp.gz' 'Skirmish BNE.pud.smp.gz' "Widow's End BNE.pud.smp.gz" 'Big Rock Candy Mountain BNE.pud.sms.gz' demo 'Great White North BNE.pud.sms.gz' 'Mud in Your Eye BNE.pud.sms.gz' 'Skirmish BNE.pud.sms.gz' "Widow's End BNE.pud.sms.gz" Classic fl 'Isolation BNE.pud.smp.gz' 'Murky River BNE.pud.smp.gz' 'Stir Crazy BNE.pud.smp.gz' 'Winding ways BNE.pud.smp.gz' 'Cramped BNE.pud.smp.gz' 'Forsaken Isles BNE.pud.smp.gz' 'Isolation BNE.pud.sms.gz' 'Murky River BNE.pud.sms.gz' 'Stir Crazy BNE.pud.sms.gz' 'Winding ways BNE.pud.sms.gz' 'Cramped BNE.pud.sms.gz' 'Forsaken Isles BNE.pud.sms.gz' 'Kaboom BNE.pud.smp.gz' 'Rose Petal BNE.pud.smp.gz' 'Taiga BNE.pud.smp.gz' 'World Domination BNE.pud.smp.gz' 'Crosshair BNE.pud.smp.gz' 'Frosty Fjords BNE.pud.smp.gz' 'Kaboom BNE.pud.sms.gz' 'Rose Petal BNE.pud.sms.gz' 'Taiga BNE.pud.sms.gz' 'World Domination BNE.pud.sms.gz'
./music/: 'Human Battle 1.mid' 'Human Battle 3.mid' 'Human Battle 5.mid' 'Human Briefing.ogg' 'Human Victory.ogg' 'Main Menu.wav' 'Orc Battle 2.ogg' 'Orc Battle 4.ogg' 'Orc Briefing.mid' 'Orc Victory.mid' 'Human Battle 1.ogg' 'Human Battle 3.ogg' 'Human Battle 5.ogg' 'Human Defeat.mid' "I'm a Medieval Man.mid" 'Orc Battle 1.mid' 'Orc Battle 3.mid' 'Orc Battle 5.mid' 'Orc Briefing.ogg' 'Orc Victory.ogg' 'Human Battle 2.mid' 'Human Battle 4.mid' 'Human Battle 6.ogg' 'Human Defeat.ogg' "I'm a Medieval Man.ogg" 'Orc Battle 1.ogg' 'Orc Battle 3.ogg' 'Orc Battle 5.ogg' 'Orc Defeat.mid' 'Human Battle 2.ogg' 'Human Battle 4.ogg' 'Human Briefing.mid' 'Human Victory.mid' 'Main Menu.mid' 'Orc Battle 2.mid' 'Orc Battle 4.mid' 'Orc Battle 6.ogg' 'Orc Defeat.ogg'
./scripts/: ai buttons.lua constructions.lua editor.lua guichan.lua lib missiles.lua scripts.lua spells.lua translate upgrade.lua widgets.lua ai.lua cheats.lua database.lua fonts.lua human lists multiplayer.lua singleplayer.lua stratagus.lua ui.lua wc2-config.lua anim.lua commands.lua directcontrol.lua fov.lua icons.lua menus orc sound.lua tilesets units.lua wc2.lua
./shaders/: aa-jinc2-sharp.cg.glsl bloom.cg.glsl crt-easymode.cg.glsl crt-reverse-aa.cg.glsl dotmask.cg.glsl tv-highcontrast-hd.cg.glsl xbr-lv2.cg.glsl
./sounds/: buildings human misc missiles neutral orc ships spells ui units
./support/: tomes
./videos/: exp-1.ogv gameintro.ogv human-1.ogv human-2.ogv human-3.ogv human-4.ogv human-exp-2.ogv logo.ogv orc-1.ogv orc-2.ogv orc-3.ogv orc-4.ogv orc-exp-2.ogv