With cordite in the air, splintered steel, shell casings and powder burns, there’s only one explanation...
Discuss & improve the game engine.

Moderators: sparcdr, torhu, Tequila

[Mageia] Linux x86_64 support

Postby Mazter » Wed Apr 09, 2014 8:52 am

Hi,

I'm a developer of Mageia Linux and I'm packaging Smokin' Guns. Packages are ready but the game crashes after launching on x86_64 with this error:
Code: Select all
********************
ERROR: opStack corrupted in compiled code (offset 4)
********************
----- Client Shutdown (recursive error after: opStack corrupted in compiled code (offset 4)) -----


Doing some googleing this error seems to only occur on x86_64 systems with ioQuake3 engines. The only reference I found about this was a bug report for Fedora and tremulous with this same error.

The ioquake3 binary works, so if this error can't be fixed soon I could make mageia packages use ioquake3 as the binaries for the game. If that's the case, is this setup supported ? I mean, is Smokin' Guns officially supported on a vanilla ioquake3 engine ?
Mazter
Mazter
Drifter
 
Posts: 11
Joined: Wed Apr 19, 2006 12:12 am



Re: [Mageia] Linux x86_64 support

Postby Tequila » Wed Apr 09, 2014 10:38 am

Howdy Matzer,

nice to here about your goal !

Actually having RPM packaging support is one of my own goal for Smokin'Guns. So can you point us to your work on the spec file so I can include it in our sources providing you the credits ? But still a big THANK YOU for your involving and Mageia support try !

If you want to build a native x86_64 binary for Smokin'Guns, I would advise you to directly build it using our most up-to-date toward ioquake3 branch on GitHub: https://github.com/smokin-guns/SmokinGuns.git
I made the ioq3-synchro branch the default only one or two weeks ago.
This branch supports mostly Smokin'Guns 1.1 but may still be buggy so you'll have to tag it somewhere as 1.2dev.

Actually, the ioQ3 engine may work as this, but this branch would still be best than just ioQ3 engine.

A point about packaging, you may not have read the Makefile.local where it is explained how to use DEFAULT_BASEDIR to specify where to search for the game datas.

:twisted:

Join Smokin'Guns Return room on Discord
User avatar
Tequila
SG Team
 
Posts: 1100
Joined: Thu Nov 15, 2007 11:33 pm
Location: Montpellier, France



Re: [Mageia] Linux x86_64 support

Postby Tequila » Wed Apr 09, 2014 10:50 am

Ho !

I just found that:
http://svnweb.mageia.org/packages/cauld ... .0/5.mga4/

This tells me you're packaging Smokin'Guns 1.0 ! Don't ! Smokin'Guns 1.1 is released since summer 2012...

So please, do the effort to directly support Smokin'Guns 1.1 !!

If you don't see any problem, I'll import Mageia packaging effort in our sources and help you !

Join Smokin'Guns Return room on Discord
User avatar
Tequila
SG Team
 
Posts: 1100
Joined: Thu Nov 15, 2007 11:33 pm
Location: Montpellier, France



Re: [Mageia] Linux x86_64 support

Postby Mazter » Wed Apr 09, 2014 5:41 pm

Don't worry, those are old packages, I haven't imported the new ones yet, I can't do it until this x86_64 issue is fixed. And the new ones don't use autodownloader to get the data files, they will be packaged and included in the distro nonfree repos too.
Mazter
Mazter
Drifter
 
Posts: 11
Joined: Wed Apr 19, 2006 12:12 am



Re: [Mageia] Linux x86_64 support

Postby Mazter » Wed Apr 09, 2014 8:20 pm

Tequila wrote:Howdy Matzer,

If you want to build a native x86_64 binary for Smokin'Guns, I would advise you to directly build it using our most up-to-date toward ioquake3 branch on GitHub: https://github.com/smokin-guns/SmokinGuns.git
I made the ioq3-synchro branch the default only one or two weeks ago.
This branch supports mostly Smokin'Guns 1.1 but may still be buggy so you'll have to tag it somewhere as 1.2dev.


One question here: does the current git version work with 1.1 servers ? if that's the case then maybe we can do this, but it would be better if you can point me to the commit that fixes this issue so I can create a patch to include with the packages. This would also help me to do an update for mageia 3 and 4.

Tequila wrote:Actually, the ioQ3 engine may work as this, but this branch would still be best than just ioQ3 engine.


Currently I think this would be the best approach for us for now (until this issue is fixed). We have ioquake3 included, maybe I need to update it to a more recent version, but I tested the one we have with Smokin' Guns with no issues. If there is any patch that you would consider important to have in ioquake3 to improve Smokin' Guns support please let me know.

Tequila wrote:A point about packaging, you may not have read the Makefile.local where it is explained how to use DEFAULT_BASEDIR to specify where to search for the game datas.


hmmm this can be interesting, currently I do a default install and then on the launch script I do this:

Code: Select all
%install
%make   \
   copyfiles USE_LOCAL_HEADERS=0 \
        USE_INTERNAL_SPEEX=0 \
   USE_INTERNAL_ZLIB=0 \
   USE_INTERNAL_JPEG=0 \
   COPYDIR=%{buildroot}%{gamelibdir}

binary=`basename %{buildroot}%{gamelibdir}/%{name}`
install -d %{buildroot}%{_gamesbindir}

cat > %{buildroot}%{_gamesbindir}/%{name} <<EOF
#!/bin/sh
# We run from ~/.smokinguns, using ~/.q3a is a bad idea as that will
# cause com_standalone to not get set if regular quake3 is also present
CVARS="+set com_basegame smokinguns"
CVARS="$CVARS +set com_homepath .smokinguns"
CVARS="$CVARS +set fs_basepath %{_gamesdatadir}"
CVARS="$CVARS +set com_hunkMegs 128"

exec %{gamelibdir}/%{name}.* "$CVARS" "$@"
EOF
chmod 755 %{buildroot}%{_gamesbindir}/%{name}


I'll do some tests with that target to see if it can improve the game launch.
Mazter
Mazter
Drifter
 
Posts: 11
Joined: Wed Apr 19, 2006 12:12 am



Re: [Mageia] Linux x86_64 support

Postby Tequila » Wed Apr 09, 2014 9:07 pm

Mazter wrote:One question here: does the current git version work with 1.1 servers ? if that's the case then maybe we can do this, but it would be better if you can point me to the commit that fixes this issue so I can create a patch to include with the packages. This would also help me to do an update for mageia 3 and 4.

Yes current git version works with 1.1 servers.
I'm not sure to understand what issue you're talking about ? My english is limited ;)
But if you're talking about the ERROR: opStack corrupted in compiled code issue, yes, this fixes it as ioQuake3 do. Remember, this branch is essentially to being synchronized with ioQuake3 upstream.

Mazter wrote:Currently I think this would be the best approach for us for now (until this issue is fixed). We have ioquake3 included, maybe I need to update it to a more recent version, but I tested the one we have with Smokin' Guns with no issues. If there is any patch that you would consider important to have in ioquake3 to improve Smokin' Guns support please let me know.

There are some diffs, and I think most in the engine are for some Smokin'Guns optimizations, but not only.

Mazter wrote:
Tequila wrote:A point about packaging, you may not have read the Makefile.local where it is explained how to use DEFAULT_BASEDIR to specify where to search for the game datas.


hmmm this can be interesting, currently I do a default install and then on the launch script I do this:

Code: Select all
%install
%make   \
   copyfiles USE_LOCAL_HEADERS=0 \
        USE_INTERNAL_SPEEX=0 \
   USE_INTERNAL_ZLIB=0 \
   USE_INTERNAL_JPEG=0 \
   COPYDIR=%{buildroot}%{gamelibdir}

binary=`basename %{buildroot}%{gamelibdir}/%{name}`
install -d %{buildroot}%{_gamesbindir}

cat > %{buildroot}%{_gamesbindir}/%{name} <<EOF
#!/bin/sh
# We run from ~/.smokinguns, using ~/.q3a is a bad idea as that will
# cause com_standalone to not get set if regular quake3 is also present
CVARS="+set com_basegame smokinguns"
CVARS="$CVARS +set com_homepath .smokinguns"
CVARS="$CVARS +set fs_basepath %{_gamesdatadir}"
CVARS="$CVARS +set com_hunkMegs 128"

exec %{gamelibdir}/%{name}.* "$CVARS" "$@"
EOF
chmod 755 %{buildroot}%{_gamesbindir}/%{name}


I'll do some tests with that target to see if it can improve the game launch.

Well, first point, you can look at code/sys/sus_unix.c file, around lines 125 to 147. You'll find by default our client is looking datas in :
  • /usr/share/games/SmokinGuns, so sg_pak0.pk3 file would be at /usr/share/games/SmokinGuns/smokinguns/sg_pak0.pk3
  • /usr/local/SmokinGuns
  • /opt/SmokinGuns
  • /opt/games/SmokinGuns
  • /SmokinGuns
  • /
You have 2 ways to change that: set PREFIX=<Mageia_SmokinGuns_parent_folder_path> define for the make command. For example:
Code: Select all
make PREFIX=/usr/games

will build a binary that will search Smokin'Guns data in /usr/games/SmokinGuns in place of /usr/share/games/SmokinGuns
If you use DEFAULT_BASEDIR as in:
Code: Select all
make DEFAULT_BASEDIR=/usr/share/games/SG

The binary will search in the specified folder before the default ones.

In fact, in your SPEC file, you can still set %{gamelibdir} to /usr/share/games/SmokinGuns if this is a right place for Mageia and so you won't need to set PREFIX or DEFAULT_BASEDIR.

If you build the binary that way, you'll finaly won't need to set any of the CVAR you set in the launcher and you can even start from any folder. The CVAR you're using are only useful for ioquake3 binary. And so you can directly install smokinguns binary under /usr/bin and you won't need a launcher script.
:twisted:

Join Smokin'Guns Return room on Discord
User avatar
Tequila
SG Team
 
Posts: 1100
Joined: Thu Nov 15, 2007 11:33 pm
Location: Montpellier, France



Re: [Mageia] Linux x86_64 support

Postby Barto » Wed Apr 09, 2014 9:28 pm

Let me pop in the discussion to add one minor thing.

One great thing would be to have a sh script or unit file for Systemd (as I see it is your default init system) to easily start a server daemon.

I have tried to assemble few infos on the wiki here http://wiki.smokin-guns.org/wiki/Smokin ... /Dedicated but it's mostly about the old SysVinit system.
"Chuck Norris had to shorten his beard in the presence of Richard Stallman because two beards that awesome, so close would segfault the universe (again)."
User avatar
Barto
Jeuxlinux Admin
 
Posts: 361
Joined: Fri Oct 23, 2009 5:08 pm
Location: Switzerland



Re: [Mageia] Linux x86_64 support

Postby Mazter » Wed Apr 09, 2014 10:45 pm

Tequila wrote:Yes current git version works with 1.1 servers.


And the other way around, 1.1 clients can connect to 1.2 servers ? this can happen too, if a Mageia user starts a server (if it's decided to go this way).

Tequila wrote:I'm not sure to understand what issue you're talking about ? My english is limited ;)
But if you're talking about the ERROR: opStack corrupted in compiled code issue, yes, this fixes it as ioQuake3 do. Remember, this branch is essentially to being synchronized with ioQuake3 upstream.


Yes, this was what I was talking about. Do you know the commit that fixes this issue ?

Tequila wrote:
There are some diffs, and I think most in the engine are for some Smokin'Guns optimizations, but not only.


Can you point me to those diffs ?

Tequila wrote:Well, first point, you can look at code/sys/sus_unix.c file, around lines 125 to 147. You'll find by default our client is looking datas in :
  • /usr/share/games/SmokinGuns, so sg_pak0.pk3 file would be at /usr/share/games/SmokinGuns/smokinguns/sg_pak0.pk3
  • /usr/local/SmokinGuns
  • /opt/SmokinGuns
  • /opt/games/SmokinGuns
  • /SmokinGuns
  • /
You have 2 ways to change that: set PREFIX=<Mageia_SmokinGuns_parent_folder_path> define for the make command. For example:
Code: Select all
make PREFIX=/usr/games

will build a binary that will search Smokin'Guns data in /usr/games/SmokinGuns in place of /usr/share/games/SmokinGuns
If you use DEFAULT_BASEDIR as in:
Code: Select all
make DEFAULT_BASEDIR=/usr/share/games/SG

The binary will search in the specified folder before the default ones.

In fact, in your SPEC file, you can still set %{gamelibdir} to /usr/share/games/SmokinGuns if this is a right place for Mageia and so you won't need to set PREFIX or DEFAULT_BASEDIR.

If you build the binary that way, you'll finaly won't need to set any of the CVAR you set in the launcher and you can even start from any folder. The CVAR you're using are only useful for ioquake3 binary. And so you can directly install smokinguns binary under /usr/bin and you won't need a launcher script.
:twisted:


I'll play with this tonight and let you know how it goes.
Mazter
Mazter
Drifter
 
Posts: 11
Joined: Wed Apr 19, 2006 12:12 am



Re: [Mageia] Linux x86_64 support

Postby Mazter » Wed Apr 09, 2014 10:46 pm

Barto wrote:Let me pop in the discussion to add one minor thing.

One great thing would be to have a sh script or unit file for Systemd (as I see it is your default init system) to easily start a server daemon.

I have tried to assemble few infos on the wiki here http://wiki.smokin-guns.org/wiki/Smokin ... /Dedicated but it's mostly about the old SysVinit system.



Yes, this is in my plans too, after I get the game running without issues on x86_64.
Mazter
Mazter
Drifter
 
Posts: 11
Joined: Wed Apr 19, 2006 12:12 am



Re: [Mageia] Linux x86_64 support

Postby Tequila » Wed Apr 09, 2014 11:03 pm

Mazter wrote:And the other way around, 1.1 clients can connect to 1.2 servers ? this can happen too, if a Mageia user starts a server (if it's decided to go this way).

Yes, 1.1 clients should be able to connect to future 1.2 servers.

Mazter wrote:Yes, this was what I was talking about. Do you know the commit that fixes this issue ?

No, I don't. ioQuake3 did a really huge work since we released Smokin'Guns 1.0.

Mazter wrote:
Tequila wrote:There are some diffs, and I think most in the engine are for some Smokin'Guns optimizations, but not only.


Can you point me to those diffs ?

I won't try to compare Smokin'Guns 1.0 code against our current code !!! No way !!! I'm mad but not so much :D

Join Smokin'Guns Return room on Discord
User avatar
Tequila
SG Team
 
Posts: 1100
Joined: Thu Nov 15, 2007 11:33 pm
Location: Montpellier, France



Re: [Mageia] Linux x86_64 support

Postby /dev/random » Thu Apr 10, 2014 6:40 pm

I'd really like Smokin' Guns to work with vanilla ioquake3. All those forks break sooner or later (e.g. OpenArena, World of Padman etc.).
Furthermore most of those forks don't benefit from people porting ioq3 to new platforms (e.g. RPi), since they'd have to port their fork as well.

If you need to add functionality, try to convince upstream (i.e. ioq3) about it. If they do not agree, then there's most likely a sane reason. If you still insist, please document this additional functionality (both in tech doc, .diff etc.).


I apologize since this does not really contribute to the topic, it's just a common anti-pattern I've noticed with several ioq3 based games.
User avatar
/dev/random
Smokin' Amigo!
 
Posts: 410
Joined: Thu Jan 22, 2009 1:58 pm



Re: [Mageia] Linux x86_64 support

Postby Mazter » Thu Apr 10, 2014 7:04 pm

/dev/random wrote:I'd really like Smokin' Guns to work with vanilla ioquake3. All those forks break sooner or later (e.g. OpenArena, World of Padman etc.).
Furthermore most of those forks don't benefit from people porting ioq3 to new platforms (e.g. RPi), since they'd have to port their fork as well.

If you need to add functionality, try to convince upstream (i.e. ioq3) about it. If they do not agree, then there's most likely a sane reason. If you still insist, please document this additional functionality (both in tech doc, .diff etc.).


I apologize since this does not really contribute to the topic, it's just a common anti-pattern I've noticed with several ioq3 based games.


I agree because for distros it would be easier to have just one package to patch when a security bug appears than several ones. Believe me, that can become really cumbersome as the same patch for ioq3 not always will apply cleanly to other forks, we need to port it to each fork or wait for upstream to release an update (which not always happens).
Mazter
Mazter
Drifter
 
Posts: 11
Joined: Wed Apr 19, 2006 12:12 am



Re: [Mageia] Linux x86_64 support

Postby Mazter » Fri May 09, 2014 7:06 pm

Hi guys,

Some weeks back I had a hard drive crash and I lost part of my work on this, plus that I had to get a new drive, resinstall os, apps, work stuff, etc. I'm ready now, so I hope to work again on this this weekend.

Cheers.
Mazter
Mazter
Drifter
 
Posts: 11
Joined: Wed Apr 19, 2006 12:12 am




Return to Code

Show Sidebar
Show Sidebar

User Control Panel