Bug 198048
| Summary: | stratagus build and run issues in devel | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Patrice Dumas <pertusus> |
| Component: | stratagus | Assignee: | Peter Lemenkov <lemenkov> |
| Status: | CLOSED NEXTRELEASE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | medium | Docs Contact: | |
| Priority: | medium | ||
| Version: | rawhide | CC: | extras-qa, hdegoede |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2006-12-21 20:46:05 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Bug Depends On: | |||
| Bug Blocks: | 213321 | ||
| Attachments: | |||
|
Description
Patrice Dumas
2006-07-08 15:23:31 UTC
Created attachment 132109 [details]
diff for the specfil to include the paches and run autoconf
Created attachment 132110 [details]
patch to add -ld to link with lua and search lualib symbol in lua
Created attachment 132111 [details]
lua_getgccount seems not to be in lua so I removed the code
Fixed compilation with new Lua. Still don't work with battle of survival (including pre version): [dumas@localhost bos_1_1]$ stratagus Battle of Survival default config file loading ... Can't open file: No such file or directory error in error handling [dumas@localhost bos_1_1pre1]$ stratagus Battle of Survival default config file loading ... Can't open file: No such file or directory error in error handling Created attachment 141196 [details]
PATCH fixing stratagus 2.1 with lua 5.1
Hi all,
I've spend some hours debugging this and I now know what the problem is and
howto fix this.
The "error in error handling" error is because stratagus tries to pass lua's
internal backtrace generator as errfunc when making lua calls from C, however
this is done in a way which breaks with lua-5.1, this patch fixes this.
With this fixed a stacktrace gets generated and it becomes clear that there is
an error in the bos lua code, for which I'll attach a seperate patch shortly.
Besides that there is another problem in stratagus in src/ai/script_ai.c, where
it tries to get the lua-name of a lua-function and the code there results in
NULL being returned as name, this might have something todo with lua-5.1 too. I
didn't fix this as I didn't know how, and it isn't necesarry as that name is
only used in dead code (iow code which never gets called).
Then there is a third issue with: src/game/games.c: 352:
"ThisPlayer->Name = strdup(LocalPlayerName);"
where ThisPlayer gets used, but when Stratagus is not correctly started from
the cmdline ThisPlayer is NULL, leading to a crash. I guess we should give a
more friendly errormessage here, I'll leave this up to the package maintainer.
The correct way to invake stratagus from the bos_1_1 dir is:
"stratagus -d data maps/default.pud.gz"
With stratagus patched with this patch and bos patched with my to be attached
patch bos starts fine, I didn't play it as its bedtime now.
Notice that this is with stratagus 2.1, not SVN, I see no reason to move to
SVN.
Created attachment 141198 [details]
PATCH: fixing bos
p.s. BOS itself seems opensource to at first glance, why isn't it packaged itself? Erm, ping? I've handed you the fix for this on a silver platter, after many hours of debugging I might add some kinda response would be nice a fixed package even better! All fixes applied now! Looks like we got it work with Lua5.1. Thanks a lot, Hans ). Cool, Next time when you fix a bug which is in BZ, please add a the bz ticket number to the changelog entry (and be a little more verbose), for example in this case it would have been better to have this as changelog entry: * Thu Nov 16 2006 Peter Lemenkov <lemenkov> 2.1-10 - Applied patches from Hans de Goede fixing running with lua-5.1 (bz 198048) p.s. Don't forget to close this bug once the builds have completed successfully. p.s. Can you also send these fixes upstream please, they might find them usefull too. Ping? Peter, is it ok to close this bug? You fixed it on Nov 18. Oops! Closing... p.s. Peter you are aware that stratagus has a new 2.x release out? That probably needs my patch too, atleast it wasn't in CVS last time I checked. There also is a new bos out for use with the new stratagus, I still think we should package bos. (In reply to comment #15) > p.s. > > Peter you are aware that stratagus has a new 2.x release out? That probably > needs my patch too, atleast it wasn't in CVS last time I checked. I can't compile stratagus-2.2.1 right out-of-the-box g++ -c -DHAVE_CONFIG_H -DUSE_OPENGL -DUSE_BZ2LIB -DUSE_VORBIS -DUSE_MIKMOD -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -DUSE_ZLIB -I. -I./src/include -I./src/guichan/include -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -O2 -pipe -fsigned-char -fomit-frame-pointer -fexpensive-optimizations -ffast-math src/tolua/tolua.cpp -o src/tolua/obj/tolua.o src/tolua/tolua.cpp: In function ‘int tolua_stratagus_open(lua_State*)’: src/tolua/tolua.cpp:16152: error: ‘lua_dobuffer’ was not declared in this scope src/tolua/tolua.cpp:16215: error: ‘lua_dobuffer’ was not declared in this scope src/tolua/tolua.cpp:16463: error: ‘lua_dobuffer’ was not declared in this scope src/tolua/tolua.cpp:16859: error: ‘lua_dobuffer’ was not declared in this scope src/tolua/tolua.cpp:17059: error: ‘lua_dobuffer’ was not declared in this scope make: *** [src/tolua/obj/tolua.o] Error 1 ошибка: Неверный код возврата из /var/tmp/rpm-tmp.38317 (%build) Ошибки сборки пакетов: Неверный код возврата из /var/tmp/rpm-tmp.38317 (%build) [petro@Sulaco SPECS]$ Also they ship custom versions of tolua++ and guichan with stratagus. I'll try to use already availaible ion FE. OK, i got rid of internally shipping tolua++: http://lemenkov.newmail.ru/other/stratagus/stratagus.spec http://lemenkov.newmail.ru/other/stratagus/stratagus--use_external_tolua.diff TODO: * remove guichan Unfortunately BoS cannot be started: [petro@Sulaco bos_2_0_1]$ ./stratagus -d ./data.bos/ Battle of Survival default config file loading ... [string "./data.bos//scripts/stratagus.lua"]:52: attempt to call a table value stack traceback: [string "./data.bos//scripts/stratagus.lua"]:52: in main chunk [petro@Sulaco bos_2_0_1]$ Oops. I forgot to add link to Hans de Goede's patch: http://lemenkov.newmail.ru/other/stratagus/stratagus--use-lua51.diff Created attachment 146397 [details]
Updated patch to fix backtraces when lua errors are thrown
Just like the last time, there are 2 problems:
1) A couple of lua bugs in bos
2) Invalid traceback calling in stratagus making debugging harder
This updates patch fixes 2) I also have a patch for 1) which I will attach
next.
Any plans on packaging bos? That would be great as currently stratagus is a bit
useless to have.
Created attachment 146398 [details]
Patch fixing bos 2.0.1
OK, thanks - stratagus upgraded to 2.2.2. Although one TODO still exists (we must use the FE-provided guichan instead of one shipped with stratagus) I rebuild it for Devel, FC-6 and FC-5 branches. Another one note - I submitted Battle of Survival for review: https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=224254 |